1 | import type { U8aLike } from '@polkadot/util/types';
|
2 | export type { U8aLike } from '@polkadot/util/types';
|
3 | interface Coder {
|
4 | decode: (value: string) => Uint8Array;
|
5 | encode: (value: Uint8Array) => string;
|
6 | }
|
7 | interface Config {
|
8 | chars: string;
|
9 | coder: Coder;
|
10 | ipfs?: string;
|
11 | regex?: RegExp;
|
12 | type: string;
|
13 | withPadding?: boolean;
|
14 | }
|
15 | type DecodeFn = (value: string, ipfsCompat?: boolean) => Uint8Array;
|
16 | type EncodeFn = (value: U8aLike, ipfsCompat?: boolean) => string;
|
17 | type ValidateFn = (value?: unknown, ipfsCompat?: boolean) => value is string;
|
18 |
|
19 | export declare function createDecode({ coder, ipfs }: Config, validate: ValidateFn): DecodeFn;
|
20 |
|
21 | export declare function createEncode({ coder, ipfs }: Config): EncodeFn;
|
22 |
|
23 | export declare function createIs(validate: ValidateFn): ValidateFn;
|
24 |
|
25 | export declare function createValidate({ chars, ipfs, type, withPadding }: Config): ValidateFn;
|