UNPKG

1.95 kBTypeScriptView Raw
1/**
2 * Descriptor that points to specific object type by it's name
3 * and optional library (or module) where this type is defined.
4 *
5 * This class has symmetric implementation across all languages supported
6 * by Pip.Services toolkit and used to support dynamic data processing.
7 */
8export declare class TypeDescriptor {
9 private _name;
10 private _library;
11 /**
12 * Creates a new instance of the type descriptor and sets its values.
13 *
14 * @param name a name of the object type.
15 * @param library a library or module where this object type is implemented.
16 */
17 constructor(name: string, library: string);
18 /**
19 * Get the name of the object type.
20 *
21 * @returns the name of the object type.
22 */
23 getName(): string;
24 /**
25 * Gets the name of the library or module where the object type is defined.
26 *
27 * @returns the name of the library or module.
28 */
29 getLibrary(): string;
30 /**
31 * Compares this descriptor to a value.
32 * If the value is also a TypeDescriptor it compares their name and library fields.
33 * Otherwise this method returns false.
34 *
35 * @param value a value to compare.
36 * @returns true if value is identical TypeDescriptor and false otherwise.
37 */
38 equals(value: any): boolean;
39 /**
40 * Gets a string representation of the object.
41 * The result has format name[,library]
42 *
43 * @returns a string representation of the object.
44 *
45 * @see [[fromString]]
46 */
47 toString(): string;
48 /**
49 * Parses a string to get descriptor fields and returns them as a Descriptor.
50 * The string must have format name[,library]
51 *
52 * @param value a string to parse.
53 * @returns a newly created Descriptor.
54 * @throws a [[ConfigException]] if the descriptor string is of a wrong format.
55 *
56 * @see [[toString]]
57 */
58 static fromString(value: string): TypeDescriptor;
59}