UNPKG

@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

17 lines (16 loc) 1.38 kB
import { CustomError } from "@rarible/utils"; import type { BlockchainEnum, BlockchainLayer1Enum, L1BlockchainByBlockchain, WithBlockchain, WithLayer1Blockchain } from "./domain.js"; export declare const withLayer1BlockchainRegExp: RegExp; export declare function isBlockchainSpecified(value: string): value is WithLayer1Blockchain<BlockchainLayer1Enum, string>; export declare function withLayer1Blockchain<T extends BlockchainLayer1Enum, B extends string>(blockchain: T, raw: B): WithLayer1Blockchain<T, B>; export declare const withBlockchainRegExp: RegExp; export declare function isRealBlockchainSpecified(value: string): value is WithBlockchain<BlockchainEnum, string>; export declare function withBlockchain<T extends BlockchainEnum, Base extends string>(blockchain: T, raw: Base): WithBlockchain<T, Base>; export declare function toLayerOneBlockchain<T extends BlockchainEnum>(blockchain: T): L1BlockchainByBlockchain[T]; type InferBlockchainData<T extends WithBlockchain<any, any>> = T extends WithBlockchain<infer C, infer B> ? [C, B] : never; export declare function parseBlockchain<T extends WithBlockchain>(value: T): InferBlockchainData<T>; export declare function parseBlockchainSafe<T extends WithBlockchain>(value: T): InferBlockchainData<T> | undefined; export declare class BlockchainParseError extends CustomError { constructor(value: string); } export {};