@k8ts/instruments
Version:
A collection of utilities and core components for k8ts.
30 lines • 1.45 kB
TypeScript
export type JoinIfNotEmpty<A extends string, J extends string, B extends string> = A extends "" ? B : B extends "" ? A : `${A}${J}${B}`;
export declare class ImageHost<Text extends string = string> {
private readonly _url;
constructor(source: Text);
author<Author extends string>(name: Author): ImageAuthor<JoinIfNotEmpty<Text, "/", Author>>;
image<Image extends string>(name: Image): BaseImage<JoinIfNotEmpty<Text, "/", Image>>;
get [Symbol.toStringTag](): Text;
}
export declare class ImageAuthor<Text extends string = string> {
private readonly _url;
constructor(base: string, name: string);
image<Image extends string>(name: Image): BaseImage<JoinIfNotEmpty<Text, "/", Image>>;
}
export declare class BaseImage<Text extends string = string> {
private readonly _base;
private readonly _name;
constructor(_base: string, _name: string);
tag<Tag extends string>(tag: Tag): TaggedImage<JoinIfNotEmpty<Text, ":", Tag>>;
}
export declare class TaggedImage<Text extends string = string> {
private readonly _family;
private readonly _tag;
constructor(_family: BaseImage<string>, _tag: string);
}
export declare namespace Image {
function author<Author extends string>(name: Author): ImageAuthor<Author>;
function name<Name extends `${string}/${string}`>(name: Name): BaseImage<Name>;
function host<Host extends string>(url: Host): ImageHost<Host>;
}
//# sourceMappingURL=family.d.ts.map