UNPKG

@itwin/ecschema-metadata

Version:

ECObjects core concepts in typescript

31 lines 1.49 kB
/** @packageDocumentation * @module Metadata */ /** The name of an item in a [[Schema]], encoded to meet restrictions on the characters usable in such names. * An ECName meets the following criteria: * - Contains at least one character. * - Does not begin with a digit. * - Consists entirely of characters in the ASCII ranges A-Z, a-z, and 0-9; and the underscore ("_") character. * * All characters not meeting the above criteria are encoded as "__x####__" where "####" is the UTF-16 character code. * Such names are often automatically generated from the item's display label, which is unrestricted in the characters it may contain. * @public */ export declare class ECName { private _name; /** Construct a new ECName from a valid EC name. * throws ECSchemaError if `name` does not meet the criteria for a valid EC name. */ constructor(name: string); /** Returns true if a string meets the criteria of a valid EC name. */ static validate(name: string): boolean; /** The underlying name as a string. */ get name(): string; /** Create an ECName from an arbitrary string, encoding any special characters as "__x####__" where "####" is the UTF-16 character code. * @throws ECSchemaError if `input` is an empty string. */ static encode(input: string): ECName; /** Decode this ECName, replacing encoded special characters with the characters they encode. */ decode(): string; } //# sourceMappingURL=ECName.d.ts.map