UNPKG

@k8ts/instruments

Version:

A collection of utilities and core components for k8ts.

44 lines 1.96 kB
import { Map, type Set } from "immutable"; import { Kind } from "../api-kind"; import { RefKey } from "../ref-key"; export type LookupKey = NodeEntry[keyof NodeEntry]; interface NodeEntry { kind: string; class: Function; ident: Kind.Identifier; } export declare class KindMap { private _entryMap; private _parent; constructor(_entryMap?: Map<LookupKey, NodeEntry>, _parent?: KindMap | undefined); refKey<Kind extends string, Name extends string>(kind: Kind | Kind.Identifier<Kind>, name: Name): RefKey<Kind, Name>; private _bindEntry; add(kind: Kind.Identifier, klass: Function): void; parse(ref: string | RefKey): RefKey.RefKey<string, string>; tryParse(ref: unknown): RefKey.RefKey | undefined; get kinds(): Set<string>; private _unknownNameError; private _unknownIdentError; private _unknownClassError; private _convert; private _getEntry; private _tryGetEntry; tryGetKind<Name extends string>(refKey: RefKey.RefKey<Name>): Kind.Identifier<Name> | undefined; tryGetKind<F extends Kind.Identifier>(klass: F): F; tryGetKind<Name extends string>(kind: Name): Kind.Identifier<Name> | undefined; tryGetKind(key: LookupKey): Kind.Identifier | undefined; getKind<K extends Kind.Identifier>(kind: K): K; getKind<Name extends string>(kind: Name): Kind.Identifier<Name>; getKind(kindOrClass: LookupKey): Kind.Identifier; tryGetClass(refKey: RefKey.RefKey): Function | undefined; tryGetClass<F extends Function>(klass: F): F; tryGetClass(kind: string): Function | undefined; tryGetClass(ident: Kind.Identifier): Function | undefined; getClass(refKey: RefKey.RefKey): Function; getClass<F extends Function>(klass: F): F; getClass(kind: string): Function; getClass<T extends Function | string>(kindOrClass: T): T extends Function ? string : Function; has(kindOrClass: LookupKey): boolean; } export {}; //# sourceMappingURL=index.d.ts.map