@k8ts/instruments
Version:
A collection of utilities and core components for k8ts.
23 lines • 979 B
TypeScript
import { Kind } from "../api-kind";
export type RefKey<Kind extends string = string, Name extends string = string> = RefKey.RefKey<Kind, Name>;
export declare namespace RefKey {
function make<K extends string, Name extends string>(kind: Kind.Identifier<K>, name: Name): RefKey<K, Name>;
type Input = RefKey | RefKey["string"];
type Format<Kind extends string, Name extends string> = `${Kind}/${Name}`;
interface Parsed {
kind: string;
name: string;
}
function parse(ref: string): Parsed;
function tryParse(ref: string): Parsed | undefined;
class RefKey<K extends string = string, Name extends string = string> {
readonly kind: Kind.Identifier<K>;
readonly name: Name;
constructor(kind: Kind.Identifier<K>, name: Name);
get string(): Format<K, Name>;
equals(other: RefKey): boolean;
hashCode(): number;
toString(): `${K}/${Name}`;
}
}
//# sourceMappingURL=ref-key.d.ts.map