ThreePipe
    Preparing search index...

    Function literalStrings

    • Sample usage -

      export const physicsBodyType = ['static', 'dynamic', 'kinematic'] as const
      export type PhysicsBodyType = typeof physicsBodyType[number]
      export class PhysicsComponent extends Object3DComponent {
      static ComponentType = 'PhysicsComponent'
      static StateProperties: ComponentDefn['StateProperties'] = ['mass', {
      key: 'type',
      type: literalStrings(physicsBodyType),
      }]
      // ...
      }

      Type Parameters

      • T extends string | number | boolean = string | number | boolean

      Parameters

      • type: T[] | readonly T[]

      Returns { oneOf: `"${T}"`[]; type: "Union" }