@rarible/types
Version:
`@rarible/types` is a TypeScript library that provides type definitions and interfaces for the Rarible ecosystem. This package is designed to facilitate seamless integration with Rarible's APIs and services, ensuring type safety and improved developer exp
12 lines (11 loc) • 581 B
TypeScript
import type { BlockchainLayer1Enum } from "../union/enum/domain.js";
export type Layer1ful<T extends BlockchainLayer1Enum> = string & {
__BLOCKCHAIN__: T;
};
export interface IStringValidator<T extends string> {
validate(value: string): value is T;
}
export interface ILayer1fulValidator<T extends BlockchainLayer1Enum, Base extends string> extends IStringValidator<Base> {
blockchain: T;
}
export declare function createLayer1fulValidator<T extends BlockchainLayer1Enum, Base extends string>(blockchain: T, fn: (x: string) => x is Base): ILayer1fulValidator<T, Base>;