Skip to content

Commit

Permalink
chore: Check in types
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal committed Dec 20, 2023
1 parent f428d80 commit c02aec9
Show file tree
Hide file tree
Showing 414 changed files with 4,478 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/base64/atob.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export function atob(encodedData: string): string;
//# sourceMappingURL=atob.d.ts.map
1 change: 1 addition & 0 deletions packages/base64/atob.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions packages/base64/btoa.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export function btoa(stringToEncode: string): string;
//# sourceMappingURL=btoa.d.ts.map
1 change: 1 addition & 0 deletions packages/base64/btoa.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions packages/base64/decode.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { decodeBase64 } from "./src/decode.js";
//# sourceMappingURL=decode.d.ts.map
1 change: 1 addition & 0 deletions packages/base64/decode.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions packages/base64/encode.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { encodeBase64 } from "./src/encode.js";
//# sourceMappingURL=encode.d.ts.map
1 change: 1 addition & 0 deletions packages/base64/encode.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions packages/base64/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export { encodeBase64 } from "./src/encode.js";
export { decodeBase64 } from "./src/decode.js";
export { btoa } from "./btoa.js";
export { atob } from "./atob.js";
//# sourceMappingURL=index.d.ts.map
1 change: 1 addition & 0 deletions packages/base64/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions packages/base64/shim.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=shim.d.ts.map
1 change: 1 addition & 0 deletions packages/base64/shim.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions packages/base64/src/common.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export const padding: "=";
export const alphabet64: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
/**
* The numeric value corresponding to each letter of the alphabet.
* If an alphabet is named for the Greek letters alpha and beta, then clearly a
* monodu is named for the corresponding Greek numbers mono and duo.
*
* @type {Record<string, number>}
*/
export const monodu64: Record<string, number>;
//# sourceMappingURL=common.d.ts.map
1 change: 1 addition & 0 deletions packages/base64/src/common.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions packages/base64/src/decode.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/** @type {typeof jsDecodeBase64} */
export const decodeBase64: typeof jsDecodeBase64;
/**
* Decodes a Base64 string into bytes, as specified in
* https://tools.ietf.org/html/rfc4648#section-4
*
* XSnap is a JavaScript engine based on Moddable/XS.
* The algorithm below is orders of magnitude too slow on this VM, but it
* arranges a native binding on the global object.
* We use that if it is available instead.
*
* @param {string} string Base64-encoded string
* @param {string} [name] The name of the string as it will appear in error
* messages.
* @returns {Uint8Array} decoded bytes
*/
declare function jsDecodeBase64(string: string, name?: string | undefined): Uint8Array;
export {};
//# sourceMappingURL=decode.d.ts.map
1 change: 1 addition & 0 deletions packages/base64/src/decode.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions packages/base64/src/encode.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/** @type {typeof jsEncodeBase64} */
export const encodeBase64: typeof jsEncodeBase64;
/**
* Encodes bytes into a Base64 string, as specified in
* https://tools.ietf.org/html/rfc4648#section-4
*
* XSnap is a JavaScript engine based on Moddable/XS.
* The algorithm below is orders of magnitude too slow on this VM, but it
* arranges a native binding on the global object.
* We use that if it is available instead.
*
* @param {Uint8Array} data
* @returns {string} base64 encoding
*/
declare function jsEncodeBase64(data: Uint8Array): string;
export {};
//# sourceMappingURL=encode.d.ts.map
1 change: 1 addition & 0 deletions packages/base64/src/encode.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 54 additions & 0 deletions packages/bundle-source/cache.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
export namespace jsOpts {
function encodeBundle(bundle: any): string;
function toBundleName(n: any): string;
function toBundleMeta(n: any): string;
}
export namespace jsonOpts {
export function encodeBundle_1(bundle: any): string;
export { encodeBundle_1 as encodeBundle };
export function toBundleName_1(n: any): string;
export { toBundleName_1 as toBundleName };
export function toBundleMeta_1(n: any): string;
export { toBundleMeta_1 as toBundleMeta };
}
export function makeBundleCache(wr: any, cwd: any, readPowers: any, opts: any): {
add: (rootPath: any, targetName: any, log?: any) => Promise<BundleMeta>;
validate: (targetName: string, rootOpt: any, log?: Logger | undefined, meta?: BundleMeta | undefined) => Promise<BundleMeta>;
validateOrAdd: (rootPath: string, targetName: string, log?: Logger | undefined) => Promise<BundleMeta>;
load: (rootPath: string, targetName?: string | undefined, log?: Logger | undefined) => Promise<any>;
};
export function makeNodeBundleCache(dest: string, options: {
format?: string;
cacheOpts?: CacheOpts;
cacheSourceMaps: boolean;
dev?: boolean;
log?: Logger;
}, loadModule: (id: string) => Promise<any>, pid?: number | undefined, nonce?: number | undefined): Promise<{
add: (rootPath: any, targetName: any, log?: any) => Promise<BundleMeta>;
validate: (targetName: string, rootOpt: any, log?: Logger | undefined, meta?: BundleMeta | undefined) => Promise<BundleMeta>;
validateOrAdd: (rootPath: string, targetName: string, log?: Logger | undefined) => Promise<BundleMeta>;
load: (rootPath: string, targetName?: string | undefined, log?: Logger | undefined) => Promise<any>;
}>;
/**
* A message logger.
*/
export type Logger = (...args: unknown[]) => void;
export type BundleMeta = {
bundleFileName: string;
/**
* ISO format
*/
bundleTime: string;
bundleSize: number;
moduleSource: {
relative: string;
absolute: string;
};
contents: Array<{
relativePath: string;
mtime: string;
size: number;
}>;
};
export type CacheOpts = typeof jsOpts;
//# sourceMappingURL=cache.d.ts.map
1 change: 1 addition & 0 deletions packages/bundle-source/cache.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions packages/bundle-source/src/bundle-source.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default bundleSource;
/** @type {import('./types').BundleSource} */
declare const bundleSource: import('./types').BundleSource;
//# sourceMappingURL=bundle-source.d.ts.map
1 change: 1 addition & 0 deletions packages/bundle-source/src/bundle-source.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 49 additions & 0 deletions packages/bundle-source/src/fs.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
export function makeFileReader(fileName: string, { fs, path }: {
fs: {
promises: Pick<typeof import("fs/promises"), 'readFile' | 'stat'>;
};
path: Pick<import("path").PlatformPath, 'resolve' | 'relative' | 'normalize'>;
}): {
toString: () => string;
readText: () => Promise<string>;
maybeReadText: () => Promise<string | undefined>;
neighbor: (ref: any) => any;
stat: () => Promise<import("fs").Stats>;
absolute: () => string;
relative: (there: any) => string;
exists: () => Promise<boolean>;
};
/**
* @param {string} fileName
* @param {{
* fs: Pick<import('fs'), 'existsSync'> &
* { promises: Pick<
* import('fs/promises'),
* 'readFile' | 'stat' | 'writeFile' | 'mkdir' | 'rename' | 'rm'
* >,
* },
* path: Pick<import('path'), 'dirname' | 'resolve' | 'relative' | 'normalize'>,
* }} io
* @param {(there: string) => ReturnType<makeFileWriter>} make
*/
export const makeFileWriter: any;
/**
* @param {string} fileName
* @param {{
* fs: Pick<import('fs'), 'existsSync'> &
* { promises: Pick<
* import('fs/promises'),
* 'readFile' | 'stat' | 'writeFile' | 'mkdir' | 'rm'
* >,
* },
* path: Pick<import('path'), 'resolve' | 'relative' | 'normalize'>,
* }} io
* @param {number} [pid]
* @param {number} [nonce]
* @param {(there: string) => ReturnType<makeAtomicFileWriter>} make
*/
export const makeAtomicFileWriter: any;
//# sourceMappingURL=fs.d.ts.map
1 change: 1 addition & 0 deletions packages/bundle-source/src/fs.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions packages/bundle-source/src/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default bundleSource;
export * from "./exports.js";
import bundleSource from './bundle-source.js';
//# sourceMappingURL=index.d.ts.map
1 change: 1 addition & 0 deletions packages/bundle-source/src/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions packages/bundle-source/src/is-entrypoint.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export function isEntrypoint(href: any): boolean;
//# sourceMappingURL=is-entrypoint.d.ts.map
1 change: 1 addition & 0 deletions packages/bundle-source/src/is-entrypoint.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions packages/bundle-source/src/main.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export function main(args: [to: string, dest: string, ...rest: string[]], { loadModule, pid, log }: {
loadModule: (spec: string) => any;
pid: number;
log?: import("../cache.js").Logger | undefined;
}): Promise<void>;
//# sourceMappingURL=main.d.ts.map
1 change: 1 addition & 0 deletions packages/bundle-source/src/main.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions packages/bundle-source/src/nested-evaluate-and-get-exports.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* @template {'nestedEvaluate' | 'getExport'} T
* @param {string} startFilename
* @param {T} moduleFormat
* @param {any} powers
*/
export function bundleNestedEvaluateAndGetExports<T extends "nestedEvaluate" | "getExport">(startFilename: string, moduleFormat: T, powers: any): Promise<{
moduleFormat: T;
source: string;
sourceMap: string;
}>;
//# sourceMappingURL=nested-evaluate-and-get-exports.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions packages/bundle-source/src/tool.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env node
export {};
//# sourceMappingURL=tool.d.ts.map
1 change: 1 addition & 0 deletions packages/bundle-source/src/tool.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions packages/bundle-source/src/types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
export type ModuleFormat = 'endoZipBase64' | 'nestedEvaluate' | 'getExport';
export type BundleSource = BundleSourceSimple & BundleSourceWithFormat & BundleSourceWithOptions & BundleSourceGeneral;
export type BundleSourceResult<T extends ModuleFormat> = T extends 'endoZipBase64' ? {
moduleFormat: 'endoZipBase64';
endoZipBase64: string;
endoZipBase64Sha512: string;
} : T extends 'getExport' | 'nestedEvaluate' ? {
moduleFormat: T;
source: string;
sourceMap: string;
} : never;
export type BundleSourceSimple = <T extends "endoZipBase64">(startFilename: string) => Promise<BundleSourceResult<T>>;
export type BundleSourceWithFormat = <T extends ModuleFormat = "endoZipBase64">(startFilename: string, format: T, powers?: {
read?: ReadFn;
canonical?: CanonicalFn;
externals?: string[];
}) => Promise<BundleSourceResult<T>>;
export type BundleSourceWithOptions = <T extends ModuleFormat = "endoZipBase64">(startFilename: string, bundleOptions: BundleOptions<T>, powers?: {
read?: ReadFn;
canonical?: CanonicalFn;
externals?: string[];
}) => Promise<BundleSourceResult<T>>;
export type BundleSourceGeneral = <T extends ModuleFormat = "endoZipBase64">(startFilename: string, formatOrOptions?: T | BundleOptions<T> | undefined, powers?: {
read?: ReadFn;
canonical?: CanonicalFn;
externals?: string[];
}) => Promise<BundleSourceResult<T>>;
export type BundleOptions<T extends ModuleFormat> = {
format?: T | undefined;
/**
* - development mode, for test bundles that need
* access to devDependencies of the entry package.
*/
dev?: boolean | undefined;
};
export type ReadFn = (location: string) => Promise<Uint8Array>;
/**
* Returns a canonical URL for a given URL, following redirects or symbolic
* links if any exist along the path.
* Must return the given logical location if the real location does not exist.
*/
export type CanonicalFn = (location: string) => Promise<string>;
//# sourceMappingURL=types.d.ts.map
1 change: 1 addition & 0 deletions packages/bundle-source/src/types.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions packages/bundle-source/src/zip-base64.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export function bundleZipBase64(startFilename: any, options?: {}, grantedPowers?: {}): Promise<{
moduleFormat: "endoZipBase64";
endoZipBase64: string;
endoZipBase64Sha512: string;
}>;
//# sourceMappingURL=zip-base64.d.ts.map
1 change: 1 addition & 0 deletions packages/bundle-source/src/zip-base64.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions packages/captp/src/atomics.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const MIN_DATA_BUFFER_LENGTH: 1;
export const TRANSFER_OVERHEAD_LENGTH: number;
export const MIN_TRANSFER_BUFFER_LENGTH: number;
export function makeAtomicsTrapHost(transferBuffer: SharedArrayBuffer): import('./types.js').TrapHost;
export function makeAtomicsTrapGuest(transferBuffer: SharedArrayBuffer): import('./types.js').TrapGuest;
//# sourceMappingURL=atomics.d.ts.map
1 change: 1 addition & 0 deletions packages/captp/src/atomics.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c02aec9

Please sign in to comment.