Skip to content

Commit

Permalink
fix(react-builder): export CodecComponentType as record (polkadot-a…
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosala authored Nov 9, 2024
1 parent f89132b commit ccbb6b3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
6 changes: 6 additions & 0 deletions packages/react-builder/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## Unreleased

## 0.2.0 - 2024-11-09

### Changed

- Export `CodecComponentType` as record instead of enum

## 0.1.0 - 2024-11-09

### Changed
Expand Down
2 changes: 1 addition & 1 deletion packages/react-builder/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@polkadot-api/react-builder",
"version": "0.1.0",
"version": "0.2.0",
"author": "Josep M Sobrepere (https://github.com/josepot)",
"repository": {
"type": "git",
Expand Down
14 changes: 8 additions & 6 deletions packages/react-builder/src/get-codec-component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,19 @@ import { NOTIN } from "./types"

export type MetadataType = V14 | V15

export const enum CodecComponentType {
Initial,
Updated,
}
export const CodecComponentType = {
Initial: "Initial",
Updated: "Updated",
} as const
export type CodecComponentType =
(typeof CodecComponentType)[keyof typeof CodecComponentType]

export type CodecComponentUpdate =
| { empty: true }
| { empty: false; decoded: any; encoded?: Uint8Array }
export type CodecComponentValue =
| { type: CodecComponentType.Initial; value?: Uint8Array | HexString }
| { type: CodecComponentType.Updated; value: CodecComponentUpdate }
| { type: typeof CodecComponentType.Initial; value?: Uint8Array | HexString }
| { type: typeof CodecComponentType.Updated; value: CodecComponentUpdate }

export type LookupType = Var["type"]

Expand Down

0 comments on commit ccbb6b3

Please sign in to comment.