chore: add mobile app

This commit is contained in:
2026-02-07 22:33:02 +01:00
parent db34640acc
commit e89384ad4e
29327 changed files with 3886944 additions and 12 deletions
+47
View File
@@ -0,0 +1,47 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/**
* This is a more comprehensive declaration of the Console API that JavaScript VMs include.
*
* This declaration is from https://github.com/Microsoft/TypeScript/blob/master/lib/lib.dom.d.ts
*/
interface Console {
memory: any;
assert(condition?: boolean, message?: string, ...data: any[]): void;
clear(): void;
count(label?: string): void;
debug(message?: any, ...optionalParams: any[]): void;
dir(value?: any, ...optionalParams: any[]): void;
dirxml(value: any): void;
error(message?: any, ...optionalParams: any[]): void;
exception(message?: string, ...optionalParams: any[]): void;
group(groupTitle?: string, ...optionalParams: any[]): void;
groupCollapsed(groupTitle?: string, ...optionalParams: any[]): void;
groupEnd(): void;
info(message?: any, ...optionalParams: any[]): void;
log(message?: any, ...optionalParams: any[]): void;
markTimeline(label?: string): void;
profile(reportName?: string): void;
profileEnd(reportName?: string): void;
table(...tabularData: any[]): void;
time(label?: string): void;
timeEnd(label?: string): void;
timeStamp(label?: string): void;
timeline(label?: string): void;
timelineEnd(label?: string): void;
trace(message?: any, ...optionalParams: any[]): void;
warn(message?: any, ...optionalParams: any[]): void;
}
+12
View File
@@ -0,0 +1,12 @@
declare const global: any;
declare global {
// Augment global type for FormData prototype to include missing methods: keys, values, entries, and Symbol.iterator
// These methods are used in React for server actions.
interface FormData {
keys(): IterableIterator<string>;
values(): IterableIterator<string | Blob>;
entries(): IterableIterator<[string, string | Blob]>;
[Symbol.iterator](): IterableIterator<[string, string | Blob]>;
}
}
+34
View File
@@ -0,0 +1,34 @@
declare module 'react-native/Libraries/NativeModules/specs/NativeSourceCode' {
namespace SourceCode {
function getConstants(): { scriptURL: string };
}
export default SourceCode;
}
declare module 'react-native/Libraries/Network/FormData' {
type FormDataValue = string | { name?: string; type?: string; uri: string };
type Headers = {
[name: string]: string;
};
type FormDataPart =
| {
string: string;
headers: Headers;
}
| {
uri: string;
headers: Headers;
name?: string;
type?: string;
};
class FormData {
append(key: string, value: FormDataValue): void;
getAll(key: string): FormDataValue[];
getParts(): FormDataPart[];
}
export default FormData;
}
@@ -0,0 +1,186 @@
// NOTE(@kitten): This is based on @types/whatwg-url
declare module 'whatwg-url-without-unicode' {
/// <reference lib="es2020"/>
/** https://url.spec.whatwg.org/#url-representation */
export interface URLRecord {
scheme: string;
username: string;
password: string;
host: string | number | IPv6Address | null;
port: number | null;
path: string | string[];
query: string | null;
fragment: string | null;
}
/** https://url.spec.whatwg.org/#concept-ipv6 */
export type IPv6Address = [number, number, number, number, number, number, number, number];
// NOTE(@kitten): This is a custom modification to add static methods with an overlay
// We should make this available to users in expo/types, which should be linked to our own Winter implementation,
// and compatible with built-ins. Until then, we're adding this so we can polyfill properly in `src/winter/url.ts`
export const URL: URLConstructor;
export interface URLConstructor {
new (url: string, base?: string | URL): URL;
(url: string, base?: string | URL): URL;
canParse(url: string, base?: string): boolean;
}
/** https://url.spec.whatwg.org/#url-class */
interface URL {
constructor(url: string, base?: string | URL);
get href(): string;
set href(V: string);
get origin(): string;
get protocol(): string;
set protocol(V: string);
get username(): string;
set username(V: string);
get password(): string;
set password(V: string);
get host(): string;
set host(V: string);
get hostname(): string;
set hostname(V: string);
get port(): string;
set port(V: string);
get pathname(): string;
set pathname(V: string);
get search(): string;
set search(V: string);
get searchParams(): URLSearchParams;
get hash(): string;
set hash(V: string);
toJSON(): string;
readonly [Symbol.toStringTag]: 'URL';
}
/** https://url.spec.whatwg.org/#interface-urlsearchparams */
export class URLSearchParams {
constructor(
init?:
| readonly (readonly [name: string, value: string])[]
| Iterable<readonly [name: string, value: string]>
| { readonly [name: string]: string }
| string
);
get size(): number;
append(name: string, value: string): void;
delete(name: string, value?: string): void;
get(name: string): string | null;
getAll(name: string): string[];
has(name: string, value?: string): boolean;
set(name: string, value: string): void;
sort(): void;
keys(): IterableIterator<string>;
values(): IterableIterator<string>;
entries(): IterableIterator<[name: string, value: string]>;
forEach<THIS_ARG = void>(
callback: (this: THIS_ARG, value: string, name: string, searchParams: this) => void,
thisArg?: THIS_ARG
): void;
readonly [Symbol.toStringTag]: 'URLSearchParams';
[Symbol.iterator](): IterableIterator<[name: string, value: string]>;
}
/** https://url.spec.whatwg.org/#concept-url-parser */
export function parseURL(
input: string,
options?: { readonly baseURL?: URLRecord | undefined }
): URLRecord | null;
/** https://url.spec.whatwg.org/#concept-basic-url-parser */
export function basicURLParse(
input: string,
options?: {
baseURL?: URLRecord | undefined;
url?: URLRecord | undefined;
stateOverride?: StateOverride | undefined;
}
): URLRecord | null;
/** https://url.spec.whatwg.org/#scheme-start-state */
export type StateOverride =
| 'scheme start'
| 'scheme'
| 'no scheme'
| 'special relative or authority'
| 'path or authority'
| 'relative'
| 'relative slash'
| 'special authority slashes'
| 'special authority ignore slashes'
| 'authority'
| 'host'
| 'hostname'
| 'port'
| 'file'
| 'file slash'
| 'file host'
| 'path start'
| 'path'
| 'opaque path'
| 'query'
| 'fragment';
/** https://url.spec.whatwg.org/#concept-url-serializer */
export function serializeURL(urlRecord: URLRecord, excludeFragment?: boolean): string;
/** https://url.spec.whatwg.org/#concept-host-serializer */
export function serializeHost(host: string | number | IPv6Address): string;
/** https://url.spec.whatwg.org/#url-path-serializer */
export function serializePath(urlRecord: URLRecord): string;
/** https://url.spec.whatwg.org/#serialize-an-integer */
export function serializeInteger(number: number): string;
/** https://html.spec.whatwg.org#ascii-serialisation-of-an-origin */
export function serializeURLOrigin(urlRecord: URLRecord): string;
/** https://url.spec.whatwg.org/#set-the-username */
export function setTheUsername(urlRecord: URLRecord, username: string): void;
/** https://url.spec.whatwg.org/#set-the-password */
export function setThePassword(urlRecord: URLRecord, password: string): void;
/** https://url.spec.whatwg.org/#url-opaque-path */
export function hasAnOpaquePath(urlRecord: URLRecord): boolean;
/** https://url.spec.whatwg.org/#cannot-have-a-username-password-port */
export function cannotHaveAUsernamePasswordPort(urlRecord: URLRecord): boolean;
/** https://url.spec.whatwg.org/#percent-decode */
export function percentDecodeBytes(buffer: TypedArray): Uint8Array;
/** https://url.spec.whatwg.org/#string-percent-decode */
export function percentDecodeString(string: string): Uint8Array;
export type TypedArray =
| Uint8Array
| Uint8ClampedArray
| Uint16Array
| Uint32Array
| Int8Array
| Int16Array
| Int32Array
| Float32Array
| Float64Array;
}