forked from CopilotKit/CopilotKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.d.ts
More file actions
23 lines (21 loc) · 951 Bytes
/
Copy pathtypes.d.ts
File metadata and controls
23 lines (21 loc) · 951 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// React Native global provided by Metro bundler
declare const __DEV__: boolean;
// Polyfill files use `const g = globalThis as Record<string, unknown>` to assign
// web APIs (ReadableStream, TextEncoder, Headers, etc.) that may not exist in the
// React Native runtime. TypeScript's `globalThis` type doesn't include optional
// web APIs, so there's no way to assign them without a cast. We use a local alias
// (`g`) instead of repeating `(globalThis as any)` on every line — same pattern as
// packages/angular/src/test-setup.ts. Files without imports add `export {}` so
// TypeScript treats them as modules with isolated scope.
declare module "text-encoding" {
export class TextEncoder {
encode(input?: string): Uint8Array;
}
export class TextDecoder {
constructor(label?: string, options?: { fatal?: boolean });
decode(
input?: ArrayBufferView | ArrayBuffer,
options?: { stream?: boolean },
): string;
}
}