@compas/code-gen
Version:
Generate various boring parts of your server
144 lines (143 loc) • 4.04 kB
TypeScript
export class TypeCreator {
/**
* @param {string} [group]
*/
constructor(group?: string);
group: string;
/**
* @param {string} [name]
* @returns {AnyType}
*/
any(name?: string): AnyType;
/**
* @param {string} [name]
* @returns {AnyOfType}
*/
anyOf(name?: string): AnyOfType;
/**
* @param {string} [name]
* @returns {ArrayType}
*/
array(name?: string): ArrayType;
/**
* @param {string} [name]
* @returns {BooleanType}
*/
bool(name?: string): BooleanType;
/**
* @param {string} [name]
* @returns {DateType}
*/
date(name?: string): DateType;
/**
* @param {string} [name]
* @returns {FileType}
*/
file(name?: string): FileType;
/**
* @param {string} [name]
* @returns {GenericType}
*/
generic(name?: string): GenericType;
/**
* @param {string} [name]
* @returns {NumberType}
*/
number(name?: string): NumberType;
/**
* @param {string} [name]
* @returns {ObjectType}
*/
object(name?: string): ObjectType;
/**
* @param {string} [name]
* @returns {OmitType}
*/
omit(name?: string): OmitType;
/**
* @param {string} [name]
* @returns {OptionalType}
*/
optional(name?: string): OptionalType;
/**
* @param {string} [name]
* @returns {PickType}
*/
pick(name?: string): PickType;
/**
* @param {ReferenceType} reference
* @returns {ExtendType}
*/
extendNamedObject(reference: ReferenceType): ExtendType;
/**
* @param {string|import("./TypeBuilder.js").TypeBuilder} groupOrOther
* @param {string} [name]
* @returns {ReferenceType}
*/
reference(groupOrOther: string | import("./TypeBuilder.js").TypeBuilder, name?: string): ReferenceType;
/**
* @param {string} [name]
* @returns {SearchableType}
*/
searchable(name?: string): SearchableType;
/**
* @param {string} [name]
* @returns {StringType}
*/
string(name?: string): StringType;
/**
* @param {string} [name]
* @returns {UuidType}
*/
uuid(name?: string): UuidType;
/**
* @param {string} path
* @returns {RouteCreator}
*/
router(path: string): RouteCreator;
/**
* @param {string} [path]
* @returns {CrudType}
*/
crud(path?: string): CrudType;
/**
* @param {string} ownKey
* @param {ReferenceType} reference
* @returns {RelationType}
*/
oneToMany(ownKey: string, reference: ReferenceType): RelationType;
/**
* @param {string} ownKey
* @param {ReferenceType} reference
* @param {string} referencedKey
* @returns {RelationType}
*/
manyToOne(ownKey: string, reference: ReferenceType, referencedKey: string): RelationType;
/**
* @param {string} ownKey
* @param {ReferenceType} reference
* @param {string} referencedKey
* @returns {RelationType}
*/
oneToOne(ownKey: string, reference: ReferenceType, referencedKey: string): RelationType;
}
import { AnyType } from "./AnyType.js";
import { AnyOfType } from "./AnyOfType.js";
import { ArrayType } from "./ArrayType.js";
import { BooleanType } from "./BooleanType.js";
import { DateType } from "./DateType.js";
import { FileType } from "./FileType.js";
import { GenericType } from "./GenericType.js";
import { NumberType } from "./NumberType.js";
import { ObjectType } from "./ObjectType.js";
import { OmitType } from "./OmitType.js";
import { OptionalType } from "./OptionalType.js";
import { PickType } from "./PickType.js";
import { ReferenceType } from "./ReferenceType.js";
import { ExtendType } from "./ExtendType.js";
import { SearchableType } from "./SearchableType.js";
import { StringType } from "./StringType.js";
import { UuidType } from "./UuidType.js";
import { RouteCreator } from "./RouteBuilder.js";
import { CrudType } from "./CrudType.js";
import { RelationType } from "./RelationType.js";