Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 695 Bytes

readme.md

File metadata and controls

27 lines (18 loc) · 695 Bytes

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>();