NPM
  • Preparing search index...
  • The search index is not available
MCBE LevelDB
  • MCBE LevelDB
  • NBTSchemas
  • Utils
  • Conversion
  • ToTypeScriptType
  • nbtSchemaToTypeScriptType

Function nbtSchemaToTypeScriptType

  • nbtSchemaToTypeScriptType(
        schema: NBTSchema | NBTSchemaFragment,
        name: string,
        opts?: NBTSchemaToTypeScriptInterfaceConversionOptions,
    ): string

    Generates a TypeScript type from a top-level NBTSchema or NBTSchemaFragment.

    Parameters

    • schema: NBTSchema | NBTSchemaFragment

      The schema object to convert.

    • name: string

      The name of the type.

    • opts: NBTSchemaToTypeScriptInterfaceConversionOptions = {}

      Options for the conversion.

    Returns string

    The TypeScript type string.

    Todo

    Add support for oneOf, anyOf, allOf, not, patternProperties, and $ref.

    Todo

    pattern, deprecationMessage, multipleOf, and uniqueItems should add a TSDoc comment.

    Todo

    Add support for using the title property on items of lists for their labels in their tuple types.

    • Defined in nbtSchemas.ts:14303

Settings

Member Visibility
NPM
MCBE LevelDB
  • Loading...

Generated using TypeDoc