The types client provides methods for fetching types from the API. The client uses a cache to reduce the number of API calls for repeated requests.

We recommend using getByRootAndPath for most use cases.

Constructors

Properties

Methods

  • Retrieves the type specified by the root and path. example:

    const itemTypeWithProperties = await new Types(ctx).getByRootAndPath({ root: 'item', path: 'item', relations: ['typeProperties'] });
    

    Parameters

    Returns Promise<Type>

  • Parameters

    • typeId: any
    • propertySlug: any

    Returns Promise<TypeProperty>

  • Retrieves the type specified by the options. The evaluation of the options is done in the following order: If id is specified, the type is fetched by id. If root and path are specified, the type is fetched by root and path. If path is specified, the type is fetched by path.

    Parameters

    Returns Promise<Type>

  • Parameters

    • resource: any
    • key: any

    Returns Promise<any[]>

  • Clears the local types cache.

    Returns void

Generated using TypeDoc