@brizy/media-gallery
Version:
30 lines (29 loc) • 818 B
TypeScript
import { NewType } from "~/types/NewType";
import { Id } from "~/utils/number/Id";
declare enum itemUid {
type = "itemUid"
}
export type ItemUid = NewType<string, itemUid>;
/**
* Check if the string value is a ItemUid value
*/
export declare const is: (s: string) => s is ItemUid;
/**
* Try to read a ItemUid value from a string
*/
export declare const fromString: (v: string) => ItemUid;
/**
* from itemUid to string
*/
export declare const toString: (v: ItemUid) => string;
/**
* Create a ItemUid value from an numeric Id
*/
export declare const fromId: (id: Id) => ItemUid;
/**
* Converts a ItemUid value to an numeric Id
*
* Note: A ItemUid value contains a Id value inside, so we can afford this dangerous forced conversion to Id
*/
export declare const toId: (itemUid: ItemUid) => Id;
export {};