UNPKG

@itwin/ecschema-metadata

Version:

ECObjects core concepts in typescript

117 lines 4.19 kB
/** @packageDocumentation * @module Metadata */ import { SchemaKeyProps } from "./Deserialization/JsonProps"; import { SchemaMatchType } from "./ECObjects"; /** * @public @preview */ export declare class ECVersion { private _read; private _write; private _minor; /** * Using a version with all zero is invalid * for a schema, but it can be used to indicate * "no version has been specified" when locating things */ static readonly NO_VERSION: ECVersion; /** * The constructor will throw an ECSchemaError if any of the parameters below are above the threshold. * @param read Can support up to 999. * @param write Can support up to 999. * @param minor Can support up to 9999999. * */ constructor(read?: number, write?: number, minor?: number); get read(): number; get write(): number; get minor(): number; /** * Creates a string, in the format 'RR.ww.mm', representing this ECVersion. * @note The default is to pad with zeroes. * @param padZeroes If true, the returned string will strictly follow `RR.ww.mm` and add leading zeroes if necessary. */ toString(padZeroes?: boolean): string; /** * Given a valid version string the * @param versionString A valid version string of the format, 'RR.ww.mm'. */ static fromString(versionString: string): ECVersion; /** * Compares two schema versions. * @param rhs The schema to compare. * @return A negative number if this schema version is less than the given version, a positive number if greater, and 0 if are equivalent. */ compare(rhv: ECVersion): number; } /** * The SchemaKey contains a Schemas name and version. * @public @preview */ export declare class SchemaKey { private _name; private _version; constructor(name: string, version: ECVersion); constructor(name: string, readVersion?: number, writeVersion?: number, minorVersion?: number); get version(): ECVersion; get name(): string; get readVersion(): number; get writeVersion(): number; get minorVersion(): number; /** * Creates a string, in the format 'RR.ww.mm', representing this SchemaKey. * @note The default is to pad the full name with zeroes. * @param padZeroes If true, the returned string will strictly follow `Name.RR.ww.mm` and add leading zeroes if necessary. */ toString(padZeroes?: boolean): string; static parseString(fullName: string): SchemaKey; /** * Compares two schema names, case-insensitive. * @return True if they match; otherwise, false. */ compareByName(rhs: SchemaKey | string | undefined): boolean; /** * Compares two schema versions. * @param rhs The schema to compare. * @return A negative number if this schema version is less than the given version, a positive number if greater, and 0 if are equivalent. */ compareByVersion(rhs: SchemaKey): number; /** * * @param rhs The SchemaKey to compare with * @param matchType The match type to use for comparison. */ matches(rhs: SchemaKey, matchType?: SchemaMatchType): boolean; /** * Deserializes a SchemaKeyProps JSON object into a SchemaKey object. * @param props SchemaKeyProps * @returns A SchemaKey object. */ static fromJSON(props: SchemaKeyProps): SchemaKey; /** * Save this SchemaKey's properties to an object for serializing to JSON. */ toJSON(): SchemaKeyProps; } /** * The SchemaItemKey contains a SchemaItem's name and SchemaKey. * @public @preview */ export declare class SchemaItemKey { private _name; private _schemaKey; constructor(name: string, schema: SchemaKey); get schemaKey(): SchemaKey; get name(): string; get schemaName(): string; /** Returns the name in the format, {schemaName}.{name}. */ get fullName(): string; /** * Checks whether this SchemaItemKey matches the one provided. * @param rhs The SchemaItemKey to compare to this. */ matches(rhs: SchemaItemKey): boolean; matchesFullName(name: string): boolean; } //# sourceMappingURL=SchemaKey.d.ts.map