feat: initial commit

This commit is contained in:
Carlos
2024-08-12 23:06:35 -04:00
parent c581ce5ad2
commit de4ae5d068
776 changed files with 3868 additions and 15649 deletions

2
node_modules/@types/node/README.md generated vendored
View File

@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
### Additional Details
* Last updated: Fri, 02 Aug 2024 11:07:10 GMT
* Last updated: Fri, 09 Aug 2024 18:08:59 GMT
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
# Credits

47
node_modules/@types/node/fs.d.ts generated vendored
View File

@ -4324,6 +4324,18 @@ declare module "fs" {
* Function to filter out files/directories. Return true to exclude the item, false to include it.
*/
exclude?: ((fileName: string) => boolean) | undefined;
/**
* `true` if the glob should return paths as `Dirent`s, `false` otherwise.
* @default false
* @since v22.2.0
*/
withFileTypes?: boolean | undefined;
}
export interface GlobOptionsWithFileTypes extends GlobOptions {
withFileTypes: true;
}
export interface GlobOptionsWithoutFileTypes extends GlobOptions {
withFileTypes?: false | undefined;
}
/**
* Retrieves the files matching the specified pattern.
@ -4332,15 +4344,46 @@ declare module "fs" {
pattern: string | string[],
callback: (err: NodeJS.ErrnoException | null, matches: string[]) => void,
): void;
export function glob(
pattern: string | string[],
options: GlobOptionsWithFileTypes,
callback: (
err: NodeJS.ErrnoException | null,
matches: Dirent[],
) => void,
): void;
export function glob(
pattern: string | string[],
options: GlobOptionsWithoutFileTypes,
callback: (
err: NodeJS.ErrnoException | null,
matches: string[],
) => void,
): void;
export function glob(
pattern: string | string[],
options: GlobOptions,
callback: (err: NodeJS.ErrnoException | null, matches: string[]) => void,
callback: (
err: NodeJS.ErrnoException | null,
matches: Dirent[] | string[],
) => void,
): void;
/**
* Retrieves the files matching the specified pattern.
*/
export function globSync(pattern: string | string[], options?: GlobOptions): string[];
export function globSync(pattern: string | string[]): string[];
export function globSync(
pattern: string | string[],
options: GlobOptionsWithFileTypes,
): Dirent[];
export function globSync(
pattern: string | string[],
options: GlobOptionsWithoutFileTypes,
): string[];
export function globSync(
pattern: string | string[],
options: GlobOptions,
): Dirent[] | string[];
}
declare module "node:fs" {
export * from "fs";

View File

@ -21,6 +21,8 @@ declare module "fs/promises" {
Dir,
Dirent,
GlobOptions,
GlobOptionsWithFileTypes,
GlobOptionsWithoutFileTypes,
MakeDirectoryOptions,
Mode,
ObjectEncodingOptions,
@ -1243,7 +1245,19 @@ declare module "fs/promises" {
/**
* Retrieves the files matching the specified pattern.
*/
function glob(pattern: string | string[], options?: GlobOptions): AsyncIterableIterator<string>;
function glob(pattern: string | string[]): AsyncIterableIterator<string>;
function glob(
pattern: string | string[],
opt: GlobOptionsWithFileTypes,
): AsyncIterableIterator<Dirent>;
function glob(
pattern: string | string[],
opt: GlobOptionsWithoutFileTypes,
): AsyncIterableIterator<string>;
function glob(
pattern: string | string[],
opt: GlobOptions,
): AsyncIterableIterator<Dirent> | AsyncIterableIterator<string>;
}
declare module "node:fs/promises" {
export * from "fs/promises";

View File

@ -1,6 +1,6 @@
{
"name": "@types/node",
"version": "22.1.0",
"version": "22.2.0",
"description": "TypeScript definitions for node",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
"license": "MIT",
@ -212,6 +212,6 @@
"dependencies": {
"undici-types": "~6.13.0"
},
"typesPublisherContentHash": "a016324027de394c0877c1d44c03999bacaa45ed9b7249649d03dd6b9bfe4e5b",
"typesPublisherContentHash": "e8a1feecc621a4e4c40517dba1262b6a77dcb9cdd874f74c76cb391931926c7c",
"typeScriptVersion": "4.8"
}

View File

@ -31,7 +31,17 @@
*/
declare module "perf_hooks" {
import { AsyncResource } from "node:async_hooks";
type EntryType = "node" | "mark" | "measure" | "gc" | "function" | "http2" | "http" | "dns" | "net";
type EntryType =
| "dns" // Node.js only
| "function" // Node.js only
| "gc" // Node.js only
| "http2" // Node.js only
| "http" // Node.js only
| "mark" // available on the Web
| "measure" // available on the Web
| "net" // Node.js only
| "node" // Node.js only
| "resource"; // available on the Web
interface NodeGCPerformanceDetail {
/**
* When `performanceEntry.entryType` is equal to 'gc', the `performance.kind` property identifies
@ -114,6 +124,7 @@ declare module "perf_hooks" {
* @since v8.5.0
*/
class PerformanceNodeTiming extends PerformanceEntry {
readonly entryType: "node";
/**
* The high resolution millisecond timestamp at which the Node.js process
* completed bootstrapping. If bootstrapping has not yet finished, the property
@ -270,6 +281,30 @@ declare module "perf_hooks" {
* @param name
*/
mark(name: string, options?: MarkOptions): PerformanceMark;
/**
* Creates a new `PerformanceResourceTiming` entry in the Resource Timeline.
* A `PerformanceResourceTiming` is a subclass of `PerformanceEntry` whose `performanceEntry.entryType` is always `'resource'`.
* Performance resources are used to mark moments in the Resource Timeline.
* @param timingInfo [Fetch Timing Info](https://fetch.spec.whatwg.org/#fetch-timing-info)
* @param requestedUrl The resource url
* @param initiatorType The initiator name, e.g: 'fetch'
* @param global
* @param cacheMode The cache mode must be an empty string ('') or 'local'
* @param bodyInfo [Fetch Response Body Info](https://fetch.spec.whatwg.org/#response-body-info)
* @param responseStatus The response's status code
* @param deliveryType The delivery type. Default: ''.
* @since v18.2.0, v16.17.0
*/
markResourceTiming(
timingInfo: object,
requestedUrl: string,
initiatorType: string,
global: object,
cacheMode: "" | "local",
bodyInfo: object,
responseStatus: number,
deliveryType?: string,
): PerformanceResourceTiming;
/**
* Creates a new PerformanceMeasure entry in the Performance Timeline.
* A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure',
@ -543,6 +578,7 @@ declare module "perf_hooks" {
* @since v18.2.0, v16.17.0
*/
class PerformanceResourceTiming extends PerformanceEntry {
readonly entryType: "resource";
protected constructor();
/**
* The high resolution millisecond timestamp at immediately before dispatching the `fetch`

120
node_modules/@types/node/test.d.ts generated vendored
View File

@ -461,6 +461,12 @@ declare module "node:test" {
* @since v18.0.0, v16.17.0
*/
class TestContext {
/**
* An object containing assertion methods bound to the test context.
* The top-level functions from the `node:assert` module are exposed here for the purpose of creating test plans.
* @since v22.2.0
*/
readonly assert: TestContextAssert;
/**
* This function is used to create a hook running before subtest of the current test.
* @param fn The hook function. If the hook uses callbacks, the callback function is passed as the second argument.
@ -508,6 +514,42 @@ declare module "node:test" {
* @since v18.8.0, v16.18.0
*/
readonly name: string;
/**
* Used to set the number of assertions and subtests that are expected to run within the test.
* If the number of assertions and subtests that run does not match the expected count, the test will fail.
*
* To make sure assertions are tracked, the assert functions on `context.assert` must be used,
* instead of importing from the `node:assert` module.
* ```js
* test('top level test', (t) => {
* t.plan(2);
* t.assert.ok('some relevant assertion here');
* t.test('subtest', () => {});
* });
* ```
*
* When working with asynchronous code, the `plan` function can be used to ensure that the correct number of assertions are run:
* ```js
* test('planning with streams', (t, done) => {
* function* generate() {
* yield 'a';
* yield 'b';
* yield 'c';
* }
* const expected = ['a', 'b', 'c'];
* t.plan(expected.length);
* const stream = Readable.from(generate());
* stream.on('data', (chunk) => {
* t.assert.strictEqual(chunk, expected.shift());
* });
* stream.on('end', () => {
* done();
* });
* });
* ```
* @since v22.2.0
*/
plan(count: number): void;
/**
* If `shouldRunOnlyTests` is truthy, the test context will only run tests that
* have the `only` option set. Otherwise, all tests are run. If Node.js was not
@ -584,6 +626,76 @@ declare module "node:test" {
*/
readonly mock: MockTracker;
}
interface TestContextAssert {
/**
* Identical to the `deepEqual` function from the `node:assert` module, but bound to the test context.
*/
deepEqual: typeof import("node:assert").deepEqual;
/**
* Identical to the `deepStrictEqual` function from the `node:assert` module, but bound to the test context.
*/
deepStrictEqual: typeof import("node:assert").deepStrictEqual;
/**
* Identical to the `doesNotMatch` function from the `node:assert` module, but bound to the test context.
*/
doesNotMatch: typeof import("node:assert").doesNotMatch;
/**
* Identical to the `doesNotReject` function from the `node:assert` module, but bound to the test context.
*/
doesNotReject: typeof import("node:assert").doesNotReject;
/**
* Identical to the `doesNotThrow` function from the `node:assert` module, but bound to the test context.
*/
doesNotThrow: typeof import("node:assert").doesNotThrow;
/**
* Identical to the `equal` function from the `node:assert` module, but bound to the test context.
*/
equal: typeof import("node:assert").equal;
/**
* Identical to the `fail` function from the `node:assert` module, but bound to the test context.
*/
fail: typeof import("node:assert").fail;
/**
* Identical to the `ifError` function from the `node:assert` module, but bound to the test context.
*/
ifError: typeof import("node:assert").ifError;
/**
* Identical to the `match` function from the `node:assert` module, but bound to the test context.
*/
match: typeof import("node:assert").match;
/**
* Identical to the `notDeepEqual` function from the `node:assert` module, but bound to the test context.
*/
notDeepEqual: typeof import("node:assert").notDeepEqual;
/**
* Identical to the `notDeepStrictEqual` function from the `node:assert` module, but bound to the test context.
*/
notDeepStrictEqual: typeof import("node:assert").notDeepStrictEqual;
/**
* Identical to the `notEqual` function from the `node:assert` module, but bound to the test context.
*/
notEqual: typeof import("node:assert").notEqual;
/**
* Identical to the `notStrictEqual` function from the `node:assert` module, but bound to the test context.
*/
notStrictEqual: typeof import("node:assert").notStrictEqual;
/**
* Identical to the `ok` function from the `node:assert` module, but bound to the test context.
*/
ok: typeof import("node:assert").ok;
/**
* Identical to the `rejects` function from the `node:assert` module, but bound to the test context.
*/
rejects: typeof import("node:assert").rejects;
/**
* Identical to the `strictEqual` function from the `node:assert` module, but bound to the test context.
*/
strictEqual: typeof import("node:assert").strictEqual;
/**
* Identical to the `throws` function from the `node:assert` module, but bound to the test context.
*/
throws: typeof import("node:assert").throws;
}
/**
* An instance of `SuiteContext` is passed to each suite function in order to
@ -643,6 +755,14 @@ declare module "node:test" {
* @default false
*/
todo?: boolean | string | undefined;
/**
* The number of assertions and subtests expected to be run in the test.
* If the number of assertions run in the test does not match the number
* specified in the plan, the test will fail.
* @default undefined
* @since v22.2.0
*/
plan?: number | undefined;
}
/**
* This function creates a hook that runs before executing a suite.

9
node_modules/@types/node/zlib.d.ts generated vendored
View File

@ -172,6 +172,15 @@ declare module "zlib" {
interface DeflateRaw extends stream.Transform, Zlib, ZlibReset, ZlibParams {}
interface InflateRaw extends stream.Transform, Zlib, ZlibReset {}
interface Unzip extends stream.Transform, Zlib {}
/**
* Computes a 32-bit [Cyclic Redundancy Check](https://en.wikipedia.org/wiki/Cyclic_redundancy_check) checksum of `data`.
* If `value` is specified, it is used as the starting value of the checksum, otherwise, 0 is used as the starting value.
* @param data When `data` is a string, it will be encoded as UTF-8 before being used for computation.
* @param value An optional starting value. It must be a 32-bit unsigned integer. @default 0
* @returns A 32-bit unsigned integer containing the checksum.
* @since v22.2.0
*/
function crc32(data: string | Buffer | NodeJS.ArrayBufferView, value?: number): number;
/**
* Creates and returns a new `BrotliCompress` object.
* @since v11.7.0, v10.16.0