@umbraco/json-models-builders
Version:
Builders and models for Umbraco Sites
124 lines (123 loc) • 4.34 kB
TypeScript
import { DocumentTypePropertyBuilder } from './documentTypePropertyBuilder';
import { DocumentTypeContainerBuilder } from './documentTypeContainerBuilder';
import { DocumentTypeAllowedDocumentTypeBuilder } from './documentTypeAllowedDocumentTypeBuilder';
import { DocumentTypeCompositionBuilder } from './documentTypeCompositionBuilder';
import { DocumentTypeAllowedTemplateBuilder } from './documentTypeAllowedTemplateBuilder';
export declare class DocumentTypeBuilder {
alias: string;
name: string;
description: string;
icon: string;
allowedAsRoot: boolean;
variesByCulture: boolean;
variesBySegment: boolean;
collectionId: string;
isElement: boolean;
documentTypePropertyBuilder: DocumentTypePropertyBuilder[];
documentTypeAllowedDocumentTypeBuilder: DocumentTypeAllowedDocumentTypeBuilder[];
documentTypeAllowedTemplateBuilder: DocumentTypeAllowedTemplateBuilder[];
documentTypeCompositionBuilder: DocumentTypeCompositionBuilder[];
documentTypeContainerBuilder: DocumentTypeContainerBuilder[];
id: string;
folderId: string;
defaultTemplateId: string;
preventCleanup: boolean;
keepAllVersionsNewerThanDays: number;
keepLatestVersionPerDayForDays: number;
allowedInLibrary: boolean;
constructor();
withAlias(alias: string): this;
withName(name: string): this;
withDescription(description: string): this;
withIcon(icon: string): this;
withAllowedAsRoot(allowedAsRoot: boolean): this;
withVariesByCulture(variesByCulture: boolean): this;
withVariesBySegment(variesBySegment: boolean): this;
withIsElement(isElement: boolean): this;
addProperty(): DocumentTypePropertyBuilder;
addContainer(): DocumentTypeContainerBuilder;
addAllowedDocumentType(): DocumentTypeAllowedDocumentTypeBuilder;
addAllowedTemplateId(): DocumentTypeAllowedTemplateBuilder;
addComposition(): DocumentTypeCompositionBuilder;
withId(id: string): this;
withDefaultTemplateId(defaultTemplateId: string): this;
withPreventCleanup(preventCleanup: boolean): this;
withKeepAllVersionsNewerThanDays(keepAllVersionsNewerThanDays: number): this;
withKeepLatestVersionPerDayForDays(keepLatestVersionPerDayForDays: number): this;
withCollectionId(collectionId: string): this;
withAllowedInLibrary(allowedInLibrary: boolean): this;
build(): {
alias: string;
name: string;
description: string;
icon: string;
allowedAsRoot: boolean;
allowedInLibrary: boolean;
variesByCulture: boolean;
variesBySegment: boolean;
collection: {
id: string;
} | null;
isElement: boolean;
properties: {
id: string;
container: {
id: string | null;
};
sortOrder: number;
alias: string;
name: string;
description: string;
dataType: {
id: string | null;
};
variesByCulture: boolean;
variesBySegment: boolean;
validation: {
mandatory: boolean;
mandatoryMessage: string | null;
regEx: string | null;
regExMessage: string | null;
};
appearance: {
labelOnTop: boolean;
};
}[];
containers: {
id: string | null;
parent: {
id: string;
} | null;
name: string;
type: string;
sortOrder: number;
}[];
allowedDocumentTypes: {
documentType: {
id: string | null;
};
sortOrder: number;
}[];
compositions: {
[key: string]: string | {
id: string | null;
};
compositionType: string;
}[];
id: string;
folder: {
id: string;
} | null;
allowedTemplates: {
id: string | null;
}[];
defaultTemplate: {
id: string;
} | null;
cleanup: {
preventCleanup: boolean;
keepAllVersionsNewerThanDays: number | null;
keepLatestVersionPerDayForDays: number | null;
};
};
}