@apexkit/cli 1.0.2 → 1.0.3

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +48 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexkit/cli",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "The official CLI and developer sync engine for ApexKit",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
package/src/index.js CHANGED
@@ -528,10 +528,58 @@ declare global {
528
528
  base64EncodeBuffer(buffer: ArrayBuffer | Uint8Array): string;
529
529
  base64Decode(text: string): string;
530
530
  base64DecodeBuffer(text: string): ArrayBuffer;
531
+ textEncode(text: string): ArrayBuffer;
532
+ textDecode(data: ArrayBuffer | Uint8Array): string;
533
+ hexEncode(data: string | ArrayBuffer | Uint8Array): string;
534
+ hexDecode(hex: string): ArrayBuffer;
531
535
  sleep(ms: number): Promise<void>;
532
536
  randomHex(len?: number): string;
533
537
  };
534
538
 
539
+ /** Standard Web APIs */
540
+ const crypto: {
541
+ randomUUID(): string;
542
+ getRandomValues<T extends Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | null>(array: T): T;
543
+ subtle: {
544
+ digest(algorithm: string | any, data: ArrayBuffer | Uint8Array): Promise<ArrayBuffer>;
545
+ importKey(format: string, keyData: any, algo: any, extractable: boolean, usages: string[]): Promise<any>;
546
+ sign(algorithm: string | any, key: any, data: ArrayBuffer | Uint8Array): Promise<ArrayBuffer>;
547
+ verify(algorithm: string | any, key: any, signature: ArrayBuffer | Uint8Array, data: ArrayBuffer | Uint8Array): Promise<boolean>;
548
+ }
549
+ };
550
+
551
+ class Blob {
552
+ constructor(sources?: any[], options?: any);
553
+ arrayBuffer(): Promise<ArrayBuffer>;
554
+ text(): Promise<string>;
555
+ readonly size: number;
556
+ readonly type: string;
557
+ }
558
+
559
+ class ReadableStream {
560
+ constructor(underlyingSource?: any);
561
+ getReader(): any;
562
+ cancel(): Promise<void>;
563
+ readonly locked: boolean;
564
+ }
565
+
566
+ const btoa: (data: string) => string;
567
+ const atob: (data: string) => string;
568
+
569
+ class TextEncoder {
570
+ constructor(encoding?: string);
571
+ encode(input?: string): Uint8Array;
572
+ encodeInto(source: string, destination: Uint8Array): { read: number; written: number };
573
+ }
574
+
575
+ class TextDecoder {
576
+ constructor(label?: string, options?: { fatal?: boolean; ignoreBOM?: boolean });
577
+ decode(input?: ArrayBuffer | Uint8Array, options?: { stream?: boolean }): string;
578
+ }
579
+
580
+ function setTimeout(callback: Function, ms: number): string;
581
+ function clearTimeout(id: string): void;
582
+
535
583
  /** Environment & Configuration Secrets Accessor */
536
584
  const $env: {
537
585
  get(key: string): Promise<string>;