@n0safe/indirectus
Version:
Directus Tools CLI.
54 lines • 1.92 kB
TypeScript
import { type Relationship } from "./relationships";
import type { DirectusCollection, DirectusField, Schema } from "./schema";
export declare class Type {
readonly raw: Partial<DirectusField> | null;
readonly raw_relation: Relationship | null;
constructor(raw: Partial<DirectusField> | null, raw_relation: Relationship | null);
get directus(): string;
get database(): string;
get is_json(): boolean;
is_special(flag: string): boolean;
get is_data(): boolean;
get is_relationship(): boolean;
get is_unmapped(): boolean;
get relationship(): import("./relationships").OneToMany | import("./relationships").ManyToOne | import("./relationships").AnyToOne | import("./relationships").Unmapped | undefined;
get is_system(): boolean;
}
export declare class Identifier {
readonly raw: string;
constructor(raw: string);
get pascal(): string;
get camel(): string;
toString(): string;
}
export declare class Field {
readonly type: Type;
readonly name: Identifier;
constructor(name: string, type: Type);
get is_system(): boolean;
get is_translations(): boolean;
get is_data(): boolean;
get is_alias(): boolean;
get translations_collection(): any;
}
export declare class Collection {
readonly raw: DirectusCollection;
readonly name: Identifier;
readonly fields: Field[];
constructor(raw: DirectusCollection);
get is_system(): boolean;
get is_singleton(): boolean;
}
export type RegistryData = {
collections: Record<string, Collection>;
};
export declare class Registry {
readonly schema: Schema;
readonly collections: Collection[];
constructor(schema: Schema);
collection(name: string): Collection | undefined;
toJSON(): Schema;
static fromJSON(json: object): Registry;
}
export declare function createRegistry(schema: Schema): Registry;
//# sourceMappingURL=registry.d.ts.map