@chainfuse/helpers 3.2.9 → 3.2.10

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.
@@ -1,12 +1,13 @@
1
1
  import type { UuidExport } from '@chainfuse/types/d1';
2
+ import type { UuidExportBlobInput } from './buffers.mts';
2
3
  export declare class BufferHelpersInternals {
3
- static node_hexToBuffer(hex: UuidExport['hex']): Promise<UuidExport['blob']>;
4
- static node_bufferToHex(buffer: UuidExport['blob']): Promise<UuidExport['hex']>;
5
- static browser_hexToBuffer(hex: UuidExport['hex']): UuidExport['blob'];
6
- static browser_bufferToHex(buffer: UuidExport['blob']): UuidExport['hex'];
7
- static browser_base64UrlToBuffer(base64url: string): UuidExport['blob'];
8
- static node_base64ToBuffer(base64: string, isBase64Url: boolean): Promise<UuidExport['blob']>;
9
- static browser_base64ToBuffer(base64: string): UuidExport['blob'];
10
- static node_bufferToBase64(buffer: UuidExport['blob'], urlSafe: boolean): Promise<string>;
11
- static browser_bufferToBase64(buffer: UuidExport['blob'], urlSafe: boolean): string;
4
+ static node_hexToBuffer(hex: UuidExport['hex']): Promise<ArrayBuffer>;
5
+ static node_bufferToHex(buffer: UuidExportBlobInput): Promise<string>;
6
+ static browser_hexToBuffer(hex: UuidExport['hex']): ArrayBuffer;
7
+ static browser_bufferToHex(buffer: UuidExportBlobInput): UuidExport['hex'];
8
+ static browser_base64UrlToBuffer(base64url: string): ArrayBuffer;
9
+ static node_base64ToBuffer(base64: string, isBase64Url: boolean): Promise<ArrayBuffer>;
10
+ static browser_base64ToBuffer(base64: string): ArrayBuffer;
11
+ static node_bufferToBase64(buffer: UuidExportBlobInput, urlSafe: boolean): Promise<string>;
12
+ static browser_bufferToBase64(buffer: UuidExportBlobInput, urlSafe: boolean): string;
12
13
  }
@@ -1,19 +1,20 @@
1
1
  import type { UndefinedProperties } from '@chainfuse/types';
2
2
  import type { PrefixedUuid, UuidExport } from '@chainfuse/types/d1';
3
+ export type UuidExportBlobInput = Buffer | UuidExport['blob'];
3
4
  export declare class BufferHelpers {
4
- static bigintToBuffer(number: bigint): Promise<UuidExport['blob']>;
5
- static bigintToHex(number: bigint): UuidExport['hex'];
6
- static bufferToBigint(buffer: UuidExport['blob']): Promise<bigint>;
7
- static hexToBuffer(hex: UuidExport['hex']): Promise<UuidExport['blob']>;
8
- static bufferToHex(buffer: UuidExport['blob']): Promise<UuidExport['hex']>;
9
- static base64ToBuffer(rawBase64: string): Promise<UuidExport['blob']>;
10
- static bufferToBase64(buffer: UuidExport['blob'], urlSafe: boolean): Promise<string>;
5
+ static bigintToBuffer(number: bigint): Promise<ArrayBuffer>;
6
+ static bigintToHex(number: bigint): string;
7
+ static bufferToBigint(buffer: UuidExportBlobInput): Promise<bigint>;
8
+ static hexToBuffer(hex: UuidExport['hex']): Promise<ArrayBuffer>;
9
+ static bufferToHex(buffer: UuidExportBlobInput): Promise<string>;
10
+ static base64ToBuffer(rawBase64: string): Promise<ArrayBuffer>;
11
+ static bufferToBase64(buffer: UuidExportBlobInput, urlSafe: boolean): Promise<string>;
11
12
  static get generateUuid(): Promise<UuidExport>;
12
13
  static uuidConvert(input: undefined): Promise<UndefinedProperties<UuidExport>>;
13
14
  static uuidConvert(prefixedUtf: PrefixedUuid): Promise<UuidExport>;
14
15
  static uuidConvert(input: UuidExport['utf8']): Promise<UuidExport>;
15
16
  static uuidConvert(input: UuidExport['hex']): Promise<UuidExport>;
16
- static uuidConvert(input: UuidExport['blob']): Promise<UuidExport>;
17
+ static uuidConvert(input: UuidExportBlobInput): Promise<UuidExport>;
17
18
  static uuidConvert(input: UuidExport['base64']): Promise<UuidExport>;
18
19
  static uuidConvert(input: UuidExport['base64url']): Promise<UuidExport>;
19
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chainfuse/helpers",
3
- "version": "3.2.9",
3
+ "version": "3.2.10",
4
4
  "description": "",
5
5
  "author": "ChainFuse",
6
6
  "homepage": "https://github.com/ChainFuse/packages/tree/main/packages/helpers#readme",
@@ -48,7 +48,7 @@
48
48
  },
49
49
  "prettier": "@demosjarco/prettier-config",
50
50
  "dependencies": {
51
- "@chainfuse/types": "^2.10.17",
51
+ "@chainfuse/types": "^2.10.18",
52
52
  "@discordjs/rest": "^2.5.0",
53
53
  "chalk": "^5.4.1",
54
54
  "cloudflare": "^4.3.0",
@@ -62,5 +62,5 @@
62
62
  "@types/node": "^22.15.26",
63
63
  "wrangler": "^4.18.0"
64
64
  },
65
- "gitHead": "de5849c32295d792c79cae920c3751daf9aa581c"
65
+ "gitHead": "e7723806e2f740dd24652028891ddc4aa4fa0e57"
66
66
  }