UNPKG

@yellicode/elements

Version:

The meta model API for Yellicode - an extensible code generator.

41 lines (40 loc) 1.62 kB
import * as elements from './interfaces'; import { ModelDelegate } from './model-delegate-interface'; import { ModelEditable } from './editable-interfaces'; export interface DocumentProperties { id?: string; creator?: string; modelTypeName?: string; modelTypeVersion?: string; } export interface DocumentEditable extends elements.Document { /** * Sets the main model. */ setModel(name: string, initFn: (model: ModelEditable) => void): this; /** * Sets the profiles model. */ setProfiles(name: string, initFn: (model: ModelEditable) => void): this; } export declare class Document implements elements.Document, DocumentEditable { private modelDelegate; constructor(modelDelegate: ModelDelegate); id: string; creator: string; modelTypeName: string; modelTypeVersion: string; model: elements.Model | null; profiles: elements.Model | null; references: elements.DocumentReference[]; /** * Returns an Element representing the element whose id property matches the specified string. * @returns {elements.Element} The model element matching the specified ID, or null if no matching * element was found in the model. * @param {string} id The ID of the element to search for. */ findElementById(id: string): elements.Element | null; setModel(name: string, initFn: (model: ModelEditable) => void): this; setProfiles(name: string, initFn: (model: ModelEditable) => void): this; static create(modelDelegate: ModelDelegate, properties?: DocumentProperties): Document; }