@polkadot/types-codec 14.0.1 → 14.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/cjs/abstract/Array.d.ts +89 -0
  2. package/cjs/abstract/Base.d.ts +75 -0
  3. package/cjs/abstract/Int.d.ts +80 -0
  4. package/cjs/abstract/Object.d.ts +67 -0
  5. package/cjs/abstract/index.d.ts +3 -0
  6. package/cjs/base/Compact.d.ts +88 -0
  7. package/cjs/base/DoNotConstruct.d.ts +63 -0
  8. package/cjs/base/Enum.d.ts +118 -0
  9. package/cjs/base/Int.d.ts +16 -0
  10. package/cjs/base/Null.d.ts +56 -0
  11. package/cjs/base/Option.d.ts +94 -0
  12. package/cjs/base/Result.d.ts +38 -0
  13. package/cjs/base/Tuple.d.ts +42 -0
  14. package/cjs/base/UInt.d.ts +15 -0
  15. package/cjs/base/Vec.d.ts +28 -0
  16. package/cjs/base/VecAny.d.ts +15 -0
  17. package/cjs/base/VecFixed.d.ts +30 -0
  18. package/cjs/base/index.d.ts +12 -0
  19. package/cjs/bundle.d.ts +7 -0
  20. package/cjs/extended/BTreeMap.d.ts +5 -0
  21. package/cjs/extended/BTreeSet.d.ts +64 -0
  22. package/cjs/extended/BitVec.d.ts +37 -0
  23. package/cjs/extended/Bytes.d.ts +29 -0
  24. package/cjs/extended/HashMap.d.ts +5 -0
  25. package/cjs/extended/Linkage.d.ts +37 -0
  26. package/cjs/extended/Map.d.ts +59 -0
  27. package/cjs/extended/OptionBool.d.ts +36 -0
  28. package/cjs/extended/Range.d.ts +29 -0
  29. package/cjs/extended/RangeInclusive.d.ts +6 -0
  30. package/cjs/extended/Type.d.ts +16 -0
  31. package/cjs/extended/U8aFixed.d.ts +16 -0
  32. package/cjs/extended/WrapperKeepOpaque.d.ts +40 -0
  33. package/cjs/extended/WrapperOpaque.d.ts +10 -0
  34. package/cjs/extended/index.d.ts +14 -0
  35. package/cjs/index.d.ts +2 -0
  36. package/cjs/native/Bool.d.ts +71 -0
  37. package/cjs/native/Date.d.ts +84 -0
  38. package/cjs/native/Float.d.ts +68 -0
  39. package/cjs/native/Json.d.ts +69 -0
  40. package/cjs/native/Raw.d.ts +87 -0
  41. package/cjs/native/Set.d.ts +84 -0
  42. package/cjs/native/Struct.d.ts +106 -0
  43. package/cjs/native/Text.d.ts +77 -0
  44. package/cjs/native/index.d.ts +8 -0
  45. package/cjs/packageDetect.d.ts +1 -0
  46. package/cjs/packageInfo.d.ts +6 -0
  47. package/cjs/packageInfo.js +1 -1
  48. package/cjs/primitive/F32.d.ts +11 -0
  49. package/cjs/primitive/F64.d.ts +11 -0
  50. package/cjs/primitive/I128.d.ts +11 -0
  51. package/cjs/primitive/I16.d.ts +11 -0
  52. package/cjs/primitive/I256.d.ts +11 -0
  53. package/cjs/primitive/I32.d.ts +11 -0
  54. package/cjs/primitive/I64.d.ts +11 -0
  55. package/cjs/primitive/I8.d.ts +11 -0
  56. package/cjs/primitive/ISize.d.ts +12 -0
  57. package/cjs/primitive/U128.d.ts +11 -0
  58. package/cjs/primitive/U16.d.ts +11 -0
  59. package/cjs/primitive/U256.d.ts +11 -0
  60. package/cjs/primitive/U32.d.ts +11 -0
  61. package/cjs/primitive/U64.d.ts +11 -0
  62. package/cjs/primitive/U8.d.ts +11 -0
  63. package/cjs/primitive/USize.d.ts +12 -0
  64. package/cjs/primitive/index.d.ts +16 -0
  65. package/cjs/types/codec.d.ts +113 -0
  66. package/cjs/types/helpers.d.ts +27 -0
  67. package/cjs/types/index.d.ts +4 -0
  68. package/cjs/types/interfaces.d.ts +74 -0
  69. package/cjs/types/registry.d.ts +67 -0
  70. package/cjs/utils/compareArray.d.ts +1 -0
  71. package/cjs/utils/compareMap.d.ts +1 -0
  72. package/cjs/utils/compareSet.d.ts +1 -0
  73. package/cjs/utils/decodeU8a.d.ts +26 -0
  74. package/cjs/utils/index.d.ts +8 -0
  75. package/cjs/utils/sanitize.d.ts +15 -0
  76. package/cjs/utils/sortValues.d.ts +12 -0
  77. package/cjs/utils/toConstructors.d.ts +16 -0
  78. package/cjs/utils/typesToMap.d.ts +2 -0
  79. package/cjs/utils/util.d.ts +3 -0
  80. package/package.json +952 -320
  81. package/packageInfo.js +1 -1
@@ -0,0 +1,15 @@
1
+ import type { AnyString } from '../types/index.js';
2
+ type Mapper = (value: string) => string;
3
+ export declare function trim(): Mapper;
4
+ export declare function findClosing(value: string, start: number): number;
5
+ export declare function alias(src: string, dest: string, withChecks?: boolean): Mapper;
6
+ export declare function cleanupCompact(): Mapper;
7
+ export declare function flattenSingleTuple(): Mapper;
8
+ export declare function removeExtensions(type: string, isSized: boolean): Mapper;
9
+ export declare function removeColons(): Mapper;
10
+ export declare function removeGenerics(): Mapper;
11
+ export declare function removePairOf(): Mapper;
12
+ export declare function removeTraits(): Mapper;
13
+ export declare function removeWrap(check: string): Mapper;
14
+ export declare function sanitize(value: AnyString): string;
15
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { BN } from '@polkadot/util';
2
+ import type { Codec } from '../types/index.js';
3
+ type SortArg = Codec | Codec[] | number[] | BN | bigint | number | Uint8Array;
4
+ /**
5
+ * Sort keys/values of BTreeSet/BTreeMap in ascending order for encoding compatibility with Rust's BTreeSet/BTreeMap
6
+ * (https://doc.rust-lang.org/stable/std/collections/struct.BTreeSet.html)
7
+ * (https://doc.rust-lang.org/stable/std/collections/struct.BTreeMap.html)
8
+ */
9
+ export declare function sortAsc<V extends SortArg = Codec>(a: V, b: V): number;
10
+ export declare function sortSet<V extends Codec = Codec>(set: Set<V>): Set<V>;
11
+ export declare function sortMap<K extends Codec = Codec, V extends Codec = Codec>(map: Map<K, V>): Map<K, V>;
12
+ export {};
@@ -0,0 +1,16 @@
1
+ import type { Codec, CodecClass, Registry } from '../types/index.js';
2
+ /**
3
+ * @internal
4
+ * From a type string or class, return the associated type class
5
+ */
6
+ export declare function typeToConstructor<T extends Codec = Codec>(registry: Registry, type: string | CodecClass<T>): CodecClass<T>;
7
+ /**
8
+ * @internal
9
+ * Takes an input array of types and returns the associated classes for it
10
+ */
11
+ export declare function typesToConstructors<T extends Codec = Codec>(registry: Registry, types: (string | CodecClass<T>)[]): CodecClass<T>[];
12
+ /**
13
+ * @internal
14
+ * Takes an input map of the form `{ [string]: string | CodecClass }` and returns a map of `{ [string]: CodecClass }`
15
+ */
16
+ export declare function mapToTypeMap(registry: Registry, input: Record<string, string | CodecClass>): [CodecClass[], string[]];
@@ -0,0 +1,2 @@
1
+ import type { CodecClass, Registry } from '../types/index.js';
2
+ export declare function typesToMap(registry: Registry, [Types, keys]: [CodecClass[], string[]]): Record<string, string>;
@@ -0,0 +1,3 @@
1
+ export declare function hasEq(o: unknown): o is {
2
+ eq: (other: unknown) => boolean;
3
+ };