@devix-tecnologia/directus2ts
v1.0.4
Published
Create typescript types from any directus api
Downloads
5
Readme
Directus2Ts
Create typescript types from any directus api. Forked from: https://github.com/elierotenberg/directus-typescript-gen
Installation
yarn add -D @devix-tecnologia/directus2ts
Usage
yarn directus2ts --host <directus-host> --token <auth-token> --typeName <group-name> --prefix <prefix-collection> --outFile <output-file.d.ts> --simplified
The simplified option generates a smaller file without too much pollution. It is suitable for most uses.
Instancing the Directus SDK
import { Directus } from "@directus/sdk";
import { MyCollections } from "./my-collections.d.ts";
const directus = new Directus<MyCollections>();