diff --git a/astra_scene_test/X_03/node_modules/@types/d3-array/LICENSE b/astra_scene_test/X_03/node_modules/@types/d3-array/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9e841e7a26e4eb057b24511e7b92d42b257a80e5 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/d3-array/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/astra_scene_test/X_03/node_modules/@types/d3-array/README.md b/astra_scene_test/X_03/node_modules/@types/d3-array/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ef4ba6b18399f549e4b3ce827d9e968d3e3c7d28 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/d3-array/README.md @@ -0,0 +1,15 @@ +# Installation +> `npm install --save @types/d3-array` + +# Summary +This package contains type definitions for d3-array (https://github.com/d3/d3-array). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-array. + +### Additional Details + * Last updated: Fri, 12 Sep 2025 20:02:35 GMT + * Dependencies: none + +# Credits +These definitions were written by [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [Tom Wanzek](https://github.com/tomwanzek), [denisname](https://github.com/denisname), [Hugues Stefanski](https://github.com/ledragon), [Nathan Bierema](https://github.com/Methuselah96), and [Fil](https://github.com/Fil). diff --git a/astra_scene_test/X_03/node_modules/@types/d3-array/index.d.ts b/astra_scene_test/X_03/node_modules/@types/d3-array/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..aa489e7676f906e6a86ee065429866bc76ec4eb1 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/d3-array/index.d.ts @@ -0,0 +1,1118 @@ +// Last module patch version validated against: 3.2.4 + +// -------------------------------------------------------------------------- +// Shared Types and Interfaces +// -------------------------------------------------------------------------- + +/** + * Administrivia: JavaScript primitive types and Date + */ +export type Primitive = number | string | boolean | Date; + +/** + * Administrivia: anything with a valueOf(): number method is comparable, so we allow it in numeric operations + */ +export interface Numeric { + valueOf(): number; +} + +/** + * Administrivia: a matrix of numeric values. + * If height is not specified, it is inferred from the given width and data.length. + */ +export interface Matrix { + data: ArrayLike; + width: number; + height?: number; +} + +/** + * Represents a nested/recursive InternMap type + * + * The first generic "TObject" refers to the type of the data object that is available in the accessor functions. + * The second generic "TReduce" refers to the type of the data available at the deepest level (the result data). + * The third generic "TKeys" refers to the type of the keys at each level of the nestes InternMap. + */ +export type NestedInternMap = TKeys extends [infer TFirst, ...infer TRest] + ? InternMap> + : TReduce; + +/** + * Represents a nested/recursive Array type + * + * The first generic "TObject" refers to the type of the data object that is available in the accessor functions. + * The second generic "TReduce" refers to the type of the data available at the deepest level (the result data). + * The third generic "TKeys" refers to the type of the keys at each level of the nestes Array. + */ +export type NestedArray = TKeys extends [infer TFirst, ...infer TRest] + ? Array<[TFirst, NestedArray]> + : TReduce; + +// -------------------------------------------------------------------------------------- +// Statistics +// -------------------------------------------------------------------------------------- + +/** + * Return the minimum value in the array using natural order. + */ +export function min(iterable: Iterable): string | undefined; + +/** + * Return the minimum value in the array using natural order. + */ +export function min(iterable: Iterable): T | undefined; +/** + * Return the minimum value in the array using natural order. + */ +export function min( + iterable: Iterable, + accessor: (datum: T, index: number, array: Iterable) => string | undefined | null, +): string | undefined; +/** + * Return the minimum value in the array using natural order. + */ +export function min( + iterable: Iterable, + accessor: (datum: T, index: number, array: Iterable) => U | undefined | null, +): U | undefined; + +/** + * Return the index of the minimum value in the array using natural order. + */ +export function minIndex(iterable: Iterable): number; +/** + * Return the index of the minimum value in the array using natural order and a projection function to map values. + */ +export function minIndex( + iterable: Iterable, + accessor: (datum: TDatum, index: number, array: Iterable) => unknown, +): number; +/** + * Return the index of the minimum value in the array using natural order. + */ +export function minIndex(iterable: Iterable): number; + +/** + * Return the maximum value in the array of strings using natural order. + */ +export function max(iterable: Iterable): string | undefined; +/** + * Return the maximum value in the array of numbers using natural order. + */ +export function max(iterable: Iterable): T | undefined; +/** + * Return the maximum value in the array using natural order and a projection function to map values to strings. + */ +export function max( + iterable: Iterable, + accessor: (datum: T, index: number, array: Iterable) => string | undefined | null, +): string | undefined; +/** + * Return the maximum value in the array using natural order and a projection function to map values to easily-sorted values. + */ +export function max( + iterable: Iterable, + accessor: (datum: T, index: number, array: Iterable) => U | undefined | null, +): U | undefined; + +/** + * Return the index of the maximum value in the array using natural order. + */ +export function maxIndex(iterable: Iterable): number; +/** + * Return the index of the maximum value in the array using natural order and a projection function to map values. + */ +export function maxIndex( + iterable: Iterable, + accessor: (datum: TDatum, index: number, array: Iterable) => unknown, +): number; + +/** + * Return the min and max simultaneously. + */ +export function extent(iterable: Iterable): [string, string] | [undefined, undefined]; +/** + * Return the min and max simultaneously. + */ +export function extent(iterable: Iterable): [T, T] | [undefined, undefined]; +/** + * Return the min and max simultaneously. + */ +export function extent( + iterable: Iterable, + accessor: (datum: T, index: number, array: Iterable) => string | undefined | null, +): [string, string] | [undefined, undefined]; +/** + * Return the min and max simultaneously. + */ +export function extent( + iterable: Iterable, + accessor: (datum: T, index: number, array: Iterable) => U | undefined | null, +): [U, U] | [undefined, undefined]; + +/** + * Returns the mode of the given iterable, i.e. the value which appears the most often. + * In case of equality, returns the first of the relevant values. + * If the iterable contains no comparable values, returns undefined. + * An optional accessor function may be specified, which is equivalent to calling Array.from before computing the mode. + * This method ignores undefined, null and NaN values; this is useful for ignoring missing data. + */ +export function mode(iterable: Iterable): number; +/** + * Returns the mode of the given iterable, i.e. the value which appears the most often. + * In case of equality, returns the first of the relevant values. + * If the iterable contains no comparable values, returns undefined. + * An optional accessor function may be specified, which is equivalent to calling Array.from before computing the mode. + * This method ignores undefined, null and NaN values; this is useful for ignoring missing data. + */ +export function mode( + iterable: Iterable, + accessor: (datum: T, index: number, array: Iterable) => number | undefined | null, +): number; + +/** + * Compute the sum of an array of numbers. + */ +export function sum(iterable: Iterable): number; +/** + * Compute the sum of an array, using the given accessor to convert values to numbers. + */ +export function sum( + iterable: Iterable, + accessor: (datum: T, index: number, array: Iterable) => number | undefined | null, +): number; + +/** + * Return the mean of an array of numbers + */ +export function mean(iterable: Iterable): number | undefined; +/** + * Return the mean of an array of numbers + */ +export function mean( + iterable: Iterable, + accessor: (datum: T, index: number, array: Iterable) => number | undefined | null, +): number | undefined; + +/** + * Return the median of an array of numbers + */ +export function median(iterable: Iterable): number | undefined; +/** + * Return the median of an array of numbers + */ +export function median( + iterable: Iterable, + accessor: (element: T, i: number, array: Iterable) => number | undefined | null, +): number | undefined; + +/** + * Like median, but returns the index of the element to the left of the median. + */ +export function medianIndex(iterable: Iterable): number; +/** + * Like median, but returns the index of the element to the left of the median. + */ +export function medianIndex( + iterable: Iterable, + accessor: (element: T, i: number, array: Iterable) => number | undefined | null, +): number; + +/** + * Returns the cumulative sum of the given iterable of numbers, as a Float64Array of the same length. + * If the iterable contains no numbers, returns zeros. + * An optional accessor function may be specified, which is equivalent to calling Array.from before computing the cumulative sum. + * This method ignores undefined and NaN values; this is useful for ignoring missing data. + */ +export function cumsum(iterable: Iterable): Float64Array; +/** + * Returns the cumulative sum of the given iterable of numbers, as a Float64Array of the same length. + * If the iterable contains no numbers, returns zeros. + * An optional accessor function may be specified, which is equivalent to calling Array.from before computing the cumulative sum. + * This method ignores undefined and NaN values; this is useful for ignoring missing data. + */ +export function cumsum( + iterable: Iterable, + accessor: (element: T, i: number, array: Iterable) => number | undefined | null, +): Float64Array; + +/** + * Returns the p-quantile of the given iterable of numbers, where p is a number in the range [0, 1]. + * + * An optional accessor function may be specified, which is equivalent to calling array.map(accessor) before computing the quantile. + */ +export function quantile(iterable: Iterable, p: number): number | undefined; +/** + * Returns the p-quantile of the given iterable of numbers, where p is a number in the range [0, 1]. + * + * An optional accessor function may be specified, which is equivalent to calling array.map(accessor) before computing the quantile. + */ +export function quantile( + iterable: Iterable, + p: number, + accessor: (element: T, i: number, array: Iterable) => number | undefined | null, +): number | undefined; + +/** + * Similar to quantile, but returns the index to the left of p. + */ +export function quantileIndex(iterable: Iterable, p: number): number; +/** + * Similar to quantile, but returns the index to the left of p. + */ +export function quantileIndex( + iterable: Iterable, + p: number, + accessor: (element: T, i: number, array: Iterable) => number | undefined | null, +): number; + +/** + * Similar to quantile, but expects the input to be a sorted array of values. + * In contrast with quantile, the accessor is only called on the elements needed to compute the quantile. + */ +export function quantileSorted( + array: Array, + p: number, +): number | undefined; +/** + * Similar to quantile, but expects the input to be a sorted array of values. + * In contrast with quantile, the accessor is only called on the elements needed to compute the quantile. + */ +export function quantileSorted( + array: T[], + p: number, + accessor: (element: T, i: number, array: T[]) => number | undefined | null, +): number | undefined; + +/** + * Returns an array with the rank of each value in the iterable, i.e. the zero-based index of the value when the iterable is sorted. + * Nullish values are sorted to the end and ranked NaN. + * An optional comparator or accessor function may be specified; the latter is equivalent to calling array.map(accessor) before computing the ranks. + * If comparator is not specified, it defaults to ascending. + * Ties (equivalent values) all get the same rank, defined as the first time the value is found. + */ +export function rank(iterable: Iterable): Float64Array; +/** + * Returns an array with the rank of each value in the iterable, i.e. the zero-based index of the value when the iterable is sorted. + * Nullish values are sorted to the end and ranked NaN. + * An optional comparator or accessor function may be specified; the latter is equivalent to calling array.map(accessor) before computing the ranks. + * If comparator is not specified, it defaults to ascending. + * Ties (equivalent values) all get the same rank, defined as the first time the value is found. + */ +export function rank( + iterable: Iterable, + accessorOrComparator: + | ((datum: T, index: number, array: Iterable) => number | undefined | null) + | ((a: T, b: T) => number | undefined | null), +): Float64Array; + +/** + * Returns an unbiased estimator of the population variance of the given iterable of numbers using Welford’s algorithm. + * If the iterable has fewer than two numbers, returns undefined. + * An optional accessor function may be specified, which is equivalent to calling Array.from before computing the variance. + * This method ignores undefined and NaN values; this is useful for ignoring missing data. + */ +export function variance(iterable: Iterable): number | undefined; +/** + * Returns an unbiased estimator of the population variance of the given iterable of numbers using Welford’s algorithm. + * If the iterable has fewer than two numbers, returns undefined. + * An optional accessor function may be specified, which is equivalent to calling Array.from before computing the variance. + * This method ignores undefined and NaN values; this is useful for ignoring missing data. + */ +export function variance( + iterable: Iterable, + accessor: (datum: T, index: number, array: Iterable) => number | undefined | null, +): number | undefined; + +/** + * Compute the standard deviation, defined as the square root of the bias-corrected variance, of the given array of numbers. + */ +export function deviation(iterable: Iterable): number | undefined; +/** + * Compute the standard deviation, defined as the square root of the bias-corrected variance, of the given array, + * using the given accessor to convert values to numbers. + */ +export function deviation( + iterable: Iterable, + accessor: (datum: T, index: number, array: Iterable) => number | undefined | null, +): number | undefined; + +/** + * Returns a full precision summation of the given values. + * Although slower, d3.fsum can replace d3.sum wherever greater precision is needed. Uses d3.Adder. + */ +export function fsum(values: Iterable): number; +/** + * Returns a full precision summation of the given values. + * Although slower, d3.fsum can replace d3.sum wherever greater precision is needed. Uses d3.Adder. + */ +export function fsum( + values: Iterable, + accessor: (datum: T, index: number, array: Iterable) => number | undefined | null, +): number; + +/** + * Returns a full precision cumulative sum of the given values. + * Although slower, d3.fcumsum can replace d3.cumsum when greater precision is needed. Uses d3.Adder. + */ +export function fcumsum(values: Iterable): Float64Array; +/** + * Returns a full precision cumulative sum of the given values. + * Although slower, d3.fcumsum can replace d3.cumsum when greater precision is needed. Uses d3.Adder. + */ +export function fcumsum( + values: Iterable, + accessor: (datum: T, index: number, array: Iterable) => number | undefined | null, +): Float64Array; + +export class Adder { + /** + * Creates a full precision adder for IEEE 754 floating point numbers, setting its initial value to 0. + */ + constructor(); + + /** + * Adds the specified number to the adder’s current value and returns the adder. + */ + add(number: number): Adder; + + /** + * Returns the IEEE 754 double precision representation of the adder’s current value. + * Most useful as the short-hand notation +adder. + */ + valueOf(): number; +} + +// -------------------------------------------------------------------------------------- +// Search +// -------------------------------------------------------------------------------------- + +/** + * Returns the least element of the specified iterable according to the specified comparator. + * If comparator is not specified, it defaults to ascending. + */ +export function least(iterable: Iterable, comparator?: (a: T, b: T) => number): T | undefined; +/** + * Returns the least element of the specified iterable according to the specified accessor. + */ +export function least(iterable: Iterable, accessor: (a: T) => unknown): T | undefined; + +/** + * Returns the index of the least element of the specified iterable according to the specified comparator. + */ +export function leastIndex(iterable: Iterable): number | undefined; +/** + * Returns the index of the least element of the specified iterable according to the specified comparator. + */ +export function leastIndex(iterable: Iterable, comparator: (a: T, b: T) => number): number | undefined; +/** + * Returns the index of the least element of the specified iterable according to the specified accessor. + */ +// tslint:disable-next-line:unified-signatures +export function leastIndex(iterable: Iterable, accessor: (a: T) => unknown): number | undefined; + +/** + * Returns the greatest element of the specified iterable according to the specified comparator or accessor. + * If the given iterable contains no comparable elements (i.e., the comparator returns NaN when comparing each element to itself), returns undefined. + * If comparator is not specified, it defaults to ascending. + */ +export function greatest(iterable: Iterable, comparator?: (a: T, b: T) => number): T | undefined; +/** + * Returns the greatest element of the specified iterable according to the specified comparator or accessor. + * If the given iterable contains no comparable elements (i.e., the comparator returns NaN when comparing each element to itself), returns undefined. + * If comparator is not specified, it defaults to ascending. + */ +export function greatest(iterable: Iterable, accessor: (a: T) => unknown): T | undefined; + +/** + * Returns the index of the greatest element of the specified iterable according to the specified comparator or accessor. + * If the given iterable contains no comparable elements (i.e., the comparator returns NaN when comparing each element to itself), returns -1. + * If comparator is not specified, it defaults to ascending. + */ +export function greatestIndex(iterable: Iterable): number | undefined; +/** + * Returns the index of the greatest element of the specified iterable according to the specified comparator or accessor. + * If the given iterable contains no comparable elements (i.e., the comparator returns NaN when comparing each element to itself), returns -1. + * If comparator is not specified, it defaults to ascending. + */ +export function greatestIndex(iterable: Iterable, comparator: (a: T, b: T) => number): number | undefined; +/** + * Returns the index of the greatest element of the specified iterable according to the specified comparator or accessor. + * If the given iterable contains no comparable elements (i.e., the comparator returns NaN when comparing each element to itself), returns -1. + * If comparator is not specified, it defaults to ascending. + */ +// tslint:disable-next-line:unified-signatures +export function greatestIndex(iterable: Iterable, accessor: (a: T) => unknown): number | undefined; + +export function bisectLeft(array: ArrayLike, x: number, lo?: number, hi?: number): number; +export function bisectLeft(array: ArrayLike, x: string, lo?: number, hi?: number): number; +export function bisectLeft(array: ArrayLike, x: Date, lo?: number, hi?: number): number; + +export function bisectRight(array: ArrayLike, x: number, lo?: number, hi?: number): number; +export function bisectRight(array: ArrayLike, x: string, lo?: number, hi?: number): number; +export function bisectRight(array: ArrayLike, x: Date, lo?: number, hi?: number): number; + +export function bisectCenter(array: ArrayLike, x: number, lo?: number, hi?: number): number; +export function bisectCenter(array: ArrayLike, x: string, lo?: number, hi?: number): number; +export function bisectCenter(array: ArrayLike, x: Date, lo?: number, hi?: number): number; + +export const bisect: typeof bisectRight; + +export interface Bisector { + left(array: ArrayLike, x: U, lo?: number, hi?: number): number; + right(array: ArrayLike, x: U, lo?: number, hi?: number): number; + center(array: ArrayLike, x: U, lo?: number, hi?: number): number; +} + +export function bisector(comparator: (a: T, b: U) => number): Bisector; +// tslint:disable-next-line:unified-signatures +export function bisector(accessor: (x: T) => U): Bisector; + +/** + * Rearranges items so that all items in the [left, k] are the smallest. The k-th element will have the (k - left + 1)-th smallest value in [left, right]. + * + * @param array The array to partially sort (in place). + * @param k The middle index for partial sorting. + * @param left The left index of the range to sort. + * @param right The right index. + * @param compare The compare function. + */ +export function quickselect( + array: ArrayLike, + k: number, + left?: number, + right?: number, + compare?: (a: Primitive | undefined, b: Primitive | undefined) => number, +): T[]; + +// NB. this is limited to primitive values due to D3's use of the <, >, and >= operators. Results get weird for object instances. +/** + * Compares two primitive values for sorting (in ascending order). + */ +export function ascending(a: Primitive | undefined, b: Primitive | undefined): number; + +// NB. this is limited to primitive values due to D3's use of the <, >, and >= operators. Results get weird for object instances. +/** + * Compares two primitive values for sorting (in descending order). + */ +export function descending(a: Primitive | undefined, b: Primitive | undefined): number; + +// -------------------------------------------------------------------------------------- +// Transformations +// -------------------------------------------------------------------------------------- + +/** + * Groups the specified iterable of values into an InternMap from key to array of value. + * + * @param iterable The iterable to group. + * @param keys The key functions. + */ +export function group( + iterable: Iterable, + ...keys: { + [Index in keyof TKeys]: (value: TObject, index: number, values: TObject[]) => TKeys[Index]; + } +): NestedInternMap; + +/** + * Equivalent to group, but returns nested arrays instead of nested maps. + * + * @param iterable The iterable to group. + * @param keys The key functions. + */ +export function groups( + iterable: Iterable, + ...keys: { + [Index in keyof TKeys]: (value: TObject, index: number, values: TObject[]) => TKeys[Index]; + } +): NestedArray; + +/** + * Equivalent to group, but returns a flat array of [key0, key1, …, values] instead of nested maps. + * + * @param iterable The iterable to group. + * @param keys The key functions. + */ +export function flatGroup( + iterable: Iterable, + ...keys: { + [Index in keyof TKeys]: (value: TObject, index: number, values: TObject[]) => TKeys[Index]; + } +): Array<[...TKeys, TObject[]]>; + +/** + * Equivalent to group but returns a unique value per compound key instead of an array, throwing if the key is not unique. + * + * @param iterable The iterable to group. + * @param key The key functions. + */ +export function index( + iterable: Iterable, + ...keys: { + [Index in keyof TKeys]: (value: TObject, index: number, values: TObject[]) => TKeys[Index]; + } +): NestedInternMap; + +/** + * Equivalent to index, but returns nested arrays instead of nested maps. + * + * @param iterable The iterable to group. + * @param keys The key functions. + */ +export function indexes( + iterable: Iterable, + ...keys: { + [Index in keyof TKeys]: (value: TObject, index: number, values: TObject[]) => TKeys[Index]; + } +): NestedArray; + +/** + * Groups and reduces the specified array of values into an InternMap from key to value. + * + * @param iterable The iterable to group. + * @param reduce The reduce function. + * @param keys The key functions. + */ +export function rollup( + iterable: Iterable, + reduce: (values: TObject[]) => TReduce, + ...keys: { + [Index in keyof TKeys]: (value: TObject, index: number, values: TObject[]) => TKeys[Index]; + } +): NestedInternMap; + +/** + * Equivalent to rollup, but returns nested arrays instead of nested maps. + * + * @param iterable The iterable to group. + * @param reduce The reduce function. + * @param keys The key functions. + */ +export function rollups( + iterable: Iterable, + reduce: (values: TObject[]) => TReduce, + ...keys: { + [Index in keyof TKeys]: (value: TObject, index: number, values: TObject[]) => TKeys[Index]; + } +): NestedArray; + +/** + * Equivalent to rollup, but returns a flat array of [key0, key1, …, value] instead of nested maps. + * + * @param iterable The iterable to group. + * @param reduce The reduce function. + * @param keys The key functions. + */ +export function flatRollup( + iterable: Iterable, + reduce: (values: TObject[]) => TReduce, + ...keys: { + [Index in keyof TKeys]: (value: TObject, index: number, values: TObject[]) => TKeys[Index]; + } +): Array<[...TKeys, TReduce]>; + +/** + * Groups the specified iterable of elements according to the specified key function, sorts the groups according to the specified comparator, and then returns an array of keys in sorted order. + * The comparator will be asked to compare two groups a and b and should return a negative value if a should be before b, a positive value if a should be after b, or zero for a partial ordering. + */ +export function groupSort( + iterable: Iterable, + comparator: (a: TObject[], b: TObject[]) => number, + key: (value: TObject) => TKey, +): TKey[]; +/** + * Groups the specified iterable of elements according to the specified key function, sorts the groups according to the specified accessor, and then returns an array of keys in sorted order. + */ +export function groupSort( + iterable: Iterable, + // tslint:disable-next-line:unified-signatures + accessor: (value: TObject[]) => unknown, + key: (value: TObject) => TKey, +): TKey[]; + +/** + * Returns the number of valid number values (i.e., not null, NaN, or undefined) in the specified iterable; accepts an accessor. + * + * @param iterable Input array. + */ +export function count(iterable: Iterable): number; +/** + * Returns the number of valid number values (i.e., not null, NaN, or undefined) in the specified iterable; accepts an accessor. + * + * @param iterable Input array. + * @param accessor Accessor method. + */ +export function count( + iterable: Iterable, + accessor: (a: TObject, b: TObject) => number | null | undefined, +): number; + +/** + * Computes the Cartesian product of any number of iterables. + * + * When called **without** a reducer, the result is an array of tuples, + * where each tuple contains one element from each input iterable. + * + * @typeParam T - A tuple type describing the element type of each iterable argument. + * For example, passing `[number[], string[]]` infers `T` as `[number, string]`. + * + * @param iterables - Two or more iterables to combine into a Cartesian product. + * @returns An array of tuples containing one value from each iterable. + * + * @example + * ```ts + * const nums = [1, 2]; + * const chars = ['a', 'b']; + * const out = cross(nums, chars); + * // ^? type: [number, string][] + * // Example value: [[1,'a'], [1,'b'], [2,'a'], [2,'b']] + * ``` + */ +export function cross( + ...iterables: { [K in keyof T]: Iterable } +): T[]; + +/** + * Computes the Cartesian product of any number of iterables and then applies + * a reducer to each tuple, returning the reduced values. + * + * The final argument **must** be the reducer function; all prior arguments are iterables. + * + * @typeParam T - A tuple type describing the element type of each iterable argument. + * @typeParam U - The result type produced by the reducer. + * + * @param args - The iterables to combine, followed by a reducer function. + * @param args.reducer - A function invoked with one element from each iterable + * (spread as individual parameters) that returns a reduced value. + * @returns An array of reduced values returned by the reducer. + * + * @example + * ```ts + * const nums = [1, 2]; + * const chars = ['a', 'b']; + * const out = cross(nums, chars, (n, c) => `${n}${c}`); + * // ^? type: string[] + * // Example value: ['1a', '1b', '2a', '2b'] + * ``` + */ +export function cross( + ...args: [...iterables: { [K in keyof T]: Iterable }, reducer: (...values: T) => U] +): U[]; + +/** + * Merges the specified arrays into a single array. + */ +export function merge(iterables: Iterable>): T[]; + +/** + * For each adjacent pair of elements in the specified array, returns a new array of tuples of elements i and i - 1. + * Returns the empty array if the input array has fewer than two elements. + * + * @param iterable Array of input elements + */ +export function pairs(iterable: Iterable): Array<[T, T]>; +/** + * For each adjacent pair of elements in the specified array, in order, invokes the specified reducer function passing the element i and element i - 1. + * Returns the resulting array of pair-wise reduced elements. + * Returns the empty array if the input array has fewer than two elements. + * + * @param iterable Array of input elements + * @param reducer A reducer function taking as input to adjacent elements of the input array and returning a reduced value. + */ +export function pairs(iterable: Iterable, reducer: (a: T, b: T) => U): U[]; + +/** + * Returns a permutation of the specified source object (or array) using the specified iterable of keys. + * The returned array contains the corresponding property of the source object for each key in keys, in order. + * For example, `permute(["a", "b", "c"], [1, 2, 0]) // ["b", "c", "a"]` + * + * It is acceptable to have more keys than source elements, and for keys to be duplicated or omitted. + */ +export function permute(source: { [key: number]: T }, keys: Iterable): T[]; +/** + * Extract the values from an object into an array with a stable order. For example: + * `var object = {yield: 27, year: 1931, site: "University Farm"};` + * `d3.permute(object, ["site", "yield"]); // ["University Farm", 27]` + */ +export function permute(source: T, keys: Iterable): Array; + +/** + * Randomizes the order of the specified array using the Fisher–Yates shuffle. + */ +export function shuffle(array: T[], lo?: number, hi?: number): T[]; +export function shuffle(array: Int8Array, lo?: number, hi?: number): Int8Array; +export function shuffle(array: Uint8Array, lo?: number, hi?: number): Uint8Array; +export function shuffle(array: Uint8ClampedArray, lo?: number, hi?: number): Uint8ClampedArray; +export function shuffle(array: Int16Array, lo?: number, hi?: number): Int16Array; +export function shuffle(array: Uint16Array, lo?: number, hi?: number): Uint16Array; +export function shuffle(array: Int32Array, lo?: number, hi?: number): Int32Array; +export function shuffle(array: Uint32Array, lo?: number, hi?: number): Uint32Array; +export function shuffle(array: Float32Array, lo?: number, hi?: number): Float32Array; +export function shuffle(array: Float64Array, lo?: number, hi?: number): Float64Array; + +/** + * Returns a shuffle function given the specified random source. + */ +export function shuffler(random: () => number): typeof shuffle; + +/** + * Generate an array of approximately count + 1 uniformly-spaced, nicely-rounded values between start and stop (inclusive). + * Each value is a power of ten multiplied by 1, 2 or 5. See also d3.tickIncrement, d3.tickStep and linear.ticks. + * + * Ticks are inclusive in the sense that they may include the specified start and stop values if (and only if) they are exact, + * nicely-rounded values consistent with the inferred step. More formally, each returned tick t satisfies start ≤ t and t ≤ stop. + * + * @param start Start value for ticks + * @param stop Stop value for ticks + * @param count count + 1 is the approximate number of ticks to be returned by d3.ticks. + */ +export function ticks(start: number, stop: number, count: number): number[]; + +/** + * Returns the difference between adjacent tick values if the same arguments were passed to d3.ticks: + * a nicely-rounded value that is a power of ten multiplied by 1, 2 or 5. + * + * Like d3.tickStep, except requires that start is always less than or equal to stop, and if the tick step for the given start, + * stop and count would be less than one, returns the negative inverse tick step instead. + * + * This method is always guaranteed to return an integer, and is used by d3.ticks to avoid guarantee that the returned tick values + * are represented as precisely as possible in IEEE 754 floating point. + * + * @param start Start value for ticks + * @param stop Stop value for ticks + * @param count count + 1 is the approximate number of ticks to be returned by d3.ticks. + */ +export function tickIncrement(start: number, stop: number, count: number): number; + +/** + * Returns the difference between adjacent tick values if the same arguments were passed to d3.ticks: + * a nicely-rounded value that is a power of ten multiplied by 1, 2 or 5. + * + * Note that due to the limited precision of IEEE 754 floating point, the returned value may not be exact decimals; + * use d3-format to format numbers for human consumption. + * + * @param start Start value for ticks + * @param stop Stop value for ticks + * @param count count + 1 is the approximate number of ticks to be returned by d3.ticks. + */ +export function tickStep(start: number, stop: number, count: number): number; + +/** + * Returns a new interval [niceStart, niceStop] covering the given interval [start, stop] and where niceStart and niceStop are guaranteed to align with the corresponding tick step. + * Like d3.tickIncrement, this requires that start is less than or equal to stop. + * + * @param start Start value for ticks + * @param stop Stop value for ticks + * @param count count + 1 is the approximate number of ticks to be returned by d3.ticks. + */ +export function nice(start: number, stop: number, count: number): [number, number]; + +/** + * Generates a 0-based numeric sequence. The output range does not include 'stop'. + */ +export function range(stop: number): number[]; +/** + * Generates a numeric sequence starting from the given start and stop values. 'step' defaults to 1. The output range does not include 'stop'. + */ +// tslint:disable-next-line:unified-signatures +export function range(start: number, stop: number, step?: number): number[]; + +/** + * Transpose a matrix provided in Array of Arrays format. + */ +export function transpose(matrix: ArrayLike>): T[][]; + +/** + * Returns an array of arrays, where the ith array contains the ith element from each of the argument arrays. + * The returned array is truncated in length to the shortest array in arrays. If arrays contains only a single array, the returned array + * contains one-element arrays. With no arguments, the returned array is empty. + */ +export function zip(...arrays: Array>): T[][]; + +// -------------------------------------------------------------------------------------- +// Blur +// -------------------------------------------------------------------------------------- + +/** + * Blurs an array of data in-place by applying three iterations of a moving average transform (box filter) + * for a fast approximation of a Gaussian kernel of the given radius, a non-negative number. + * Returns the given data. + */ +export function blur(data: ArrayLike, radius: number): ArrayLike; + +/** + * Blurs a matrix of the given width and height in-place by applying a horizontal blur of radius rx + * and a vertical blur of radius ry (which defaults to rx). + * The matrix values data are stored in a flat (one-dimensional) array. + * If height is not specified, it is inferred from the given width and data.length. + * Returns the blurred matrix {data, width, height}. + */ +export function blur2(data: Matrix, rx: number, ry?: number): Matrix; + +/** + * Blurs the given ImageData in-place, blurring each of the RGBA layers independently by applying an horizontal blur of radius rx + * and a vertical blur of radius ry (which defaults to rx). + * Returns the blurred ImageData. + */ +export function blurImage(imageData: ImageData, rx: number, ry?: number): ImageData; + +// -------------------------------------------------------------------------------------- +// Iterables +// -------------------------------------------------------------------------------------- + +/** + * Returns true if the given test function returns true for every value in the given iterable. + * This method returns as soon as test returns a non-truthy value or all values are iterated over. + * Equivalent to array.every. + */ +export function every( + iterable: Iterable, + test: (value: T, index: number, iterable: Iterable) => unknown, +): boolean; + +/** + * Returns true if the given test function returns true for any value in the given iterable. + * This method returns as soon as test returns a truthy value or all values are iterated over. + * Equivalent to array.some. + */ +export function some( + iterable: Iterable, + test: (value: T, index: number, iterable: Iterable) => unknown, +): boolean; + +/** + * Returns a new array containing the values from iterable, in order, for which the given test function returns true. + * Equivalent to array.filter. + */ +export function filter( + iterable: Iterable, + test: (value: T, index: number, iterable: Iterable) => unknown, +): T[]; + +/** + * Returns a new array containing the mapped values from iterable, in order, as defined by given mapper function. + * Equivalent to array.map and Array.from. + */ +export function map(iterable: Iterable, mapper: (value: T, index: number, iterable: Iterable) => U): U[]; + +/** + * Returns the reduced value defined by given reducer function, which is repeatedly invoked for each value in iterable, being passed the current reduced value and the next value. + * Equivalent to array.reduce. + */ +export function reduce( + iterable: Iterable, + reducer: (previousValue: T, currentValue: T, currentIndex: number, iterable: Iterable) => T, + initialValue?: T, +): T; +/** + * Returns the reduced value defined by given reducer function, which is repeatedly invoked for each value in iterable, being passed the current reduced value and the next value. + * Equivalent to array.reduce. + */ +export function reduce( + iterable: Iterable, + reducer: (previousValue: U, currentValue: T, currentIndex: number, iterable: Iterable) => U, + initialValue: U, +): U; + +/** + * Returns an array containing the values in the given iterable in reverse order. + * Equivalent to array.reverse, except that it does not mutate the given iterable. + */ +export function reverse(iterable: Iterable): T[]; + +/** + * Returns an array containing the values in the given iterable in the sorted order defined by the given comparator function. + * If comparator is not specified, it defaults to d3.ascending. + * Equivalent to array.sort, except that it does not mutate the given iterable, and the comparator defaults to natural order instead of lexicographic order. + */ +export function sort(iterable: Iterable, comparator?: (a: T, b: T) => number): T[]; +/** + * Returns an array containing the values in the given iterable in the sorted order defined by the given accessor function. + * This is equivalent to a comparator using natural order. + * The accessor is only invoked once per element, and thus may be nondeterministic. + * Multiple accessors may be specified to break ties. + */ +export function sort(iterable: Iterable, ...accessors: Array<(a: T) => unknown>): T[]; + +// -------------------------------------------------------------------------------------- +// Sets +// -------------------------------------------------------------------------------------- + +/** + * Returns a new InternSet containing every value in iterable that is not in any of the others iterables. + */ +export function difference(iterable: Iterable, ...others: Array>): InternSet; + +/** + * Returns a new InternSet containing every (distinct) value that appears in any of the given iterables. + * The order of values in the returned set is based on their first occurrence in the given iterables. + */ +export function union(...iterables: Array>): InternSet; + +/** + * Returns a new InternSet containing every (distinct) value that appears in all of the given iterables. + * The order of values in the returned set is based on their first occurrence in the given iterables. + */ +export function intersection(...iterables: Array>): InternSet; + +/** + * Returns true if a is a superset of b: if every value in the given iterable b is also in the given iterable a. + */ +export function superset(a: Iterable, b: Iterable): boolean; + +/** + * Returns true if a is a subset of b: if every value in the given iterable a is also in the given iterable b. + */ +export function subset(a: Iterable, b: Iterable): boolean; + +/** + * Returns true if a and b are disjoint: if a and b contain no shared value. + */ +export function disjoint(a: Iterable, b: Iterable): boolean; + +// -------------------------------------------------------------------------------------- +// Bins +// -------------------------------------------------------------------------------------- + +export interface Bin extends Array { + x0: Value | undefined; + x1: Value | undefined; +} + +/** + * Type definition for threshold generator which returns the count of recommended thresholds + */ +export type ThresholdCountGenerator = ( + values: ArrayLike, + min: number, + max: number, +) => number; + +/** + * Type definition for threshold generator which returns an array of recommended numbers thresholds + */ +export type ThresholdNumberArrayGenerator = ( + values: ArrayLike, + min: number, + max: number, +) => Value[]; + +/** + * Type definition for threshold generator which returns an array of recommended dates thresholds + */ +export type ThresholdDateArrayGenerator = ( + values: ArrayLike, + min: Date, + max: Date, +) => Value[]; + +export interface HistogramCommon { + (data: ArrayLike): Array>; + + value(): (d: Datum, i: number, data: ArrayLike) => Value; + value(valueAccessor: (d: Datum, i: number, data: ArrayLike) => Value): this; +} + +export interface HistogramGeneratorDate extends HistogramCommon { + domain(): (values: ArrayLike) => [Date, Date]; + domain(domain: [Date, Date] | ((values: ArrayLike) => [Date, Date])): this; + + thresholds(): ThresholdDateArrayGenerator; + /** + * Set the array of values to be used as thresholds in determining the bins. + * + * Any threshold values outside the domain are ignored. The first bin.x0 is always equal to the minimum domain value, + * and the last bin.x1 is always equal to the maximum domain value. + * + * @param thresholds Either an array of threshold values used for binning. The elements must + * be of the same type as the materialized values of the histogram. + * Or a function which accepts as arguments the array of materialized values, and + * optionally the domain minimum and maximum. The function calculates and returns the array of values to be used as + * thresholds in determining the bins. + */ + thresholds(thresholds: ArrayLike | ThresholdDateArrayGenerator): this; +} + +export interface HistogramGeneratorNumber + extends HistogramCommon +{ + domain(): (values: Iterable) => [number, number] | [undefined, undefined]; + domain(domain: [number, number] | ((values: Iterable) => [number, number] | [undefined, undefined])): this; + + thresholds(): ThresholdCountGenerator | ThresholdNumberArrayGenerator; + /** + * Divide the domain uniformly into approximately count bins. IMPORTANT: This threshold + * setting approach only works, when the materialized values are numbers! + * + * Any threshold values outside the domain are ignored. The first bin.x0 is always equal to the minimum domain value, + * and the last bin.x1 is always equal to the maximum domain value. + * + * @param count Either the desired number of uniform bins or a function which accepts as arguments the array of + * materialized values, and optionally the domain minimum and maximum. The function calculates and returns the + * suggested number of bins. + */ + thresholds(count: number | ThresholdCountGenerator): this; + /** + * Set the array of values to be used as thresholds in determining the bins. + * + * Any threshold values outside the domain are ignored. The first bin.x0 is always equal to the minimum domain value, + * and the last bin.x1 is always equal to the maximum domain value. + * + * @param thresholds Either an array of threshold values used for binning. The elements must + * be of the same type as the materialized values of the histogram. + * Or a function which accepts as arguments the array of materialized values, and + * optionally the domain minimum and maximum. The function calculates and returns the array of values to be used as + * thresholds in determining the bins. + */ + // tslint:disable-next-line:unified-signatures + thresholds(thresholds: ArrayLike | ThresholdNumberArrayGenerator): this; +} + +/** + * @deprecated Use bin instead. + */ +export function histogram(): HistogramGeneratorNumber; + +/** + * @deprecated Use bin instead. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function histogram(): HistogramGeneratorNumber; + +/** + * @deprecated Use bin instead. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function histogram(): HistogramGeneratorDate; + +export function bin(): HistogramGeneratorNumber; +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function bin(): HistogramGeneratorNumber; +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function bin(): HistogramGeneratorDate; + +// -------------------------------------------------------------------------------------- +// Histogram Thresholds +// -------------------------------------------------------------------------------------- + +export function thresholdFreedmanDiaconis(values: ArrayLike, min: number, max: number): number; // of type ThresholdCountGenerator + +export function thresholdScott(values: ArrayLike, min: number, max: number): number; // of type ThresholdCountGenerator + +export function thresholdSturges(values: ArrayLike): number; // of type ThresholdCountGenerator + +// -------------------------------------------------------------------------------------- +// Interning +// -------------------------------------------------------------------------------------- + +/** + * The InternMap class extends the native JavaScript Map class, allowing Dates and other non-primitive keys by bypassing the SameValueZero algorithm when determining key equality. + */ +export class InternMap extends Map { +} + +/** + * The InternSet class extends the native JavaScript Set class, allowing Dates and other non-primitive keys by bypassing the SameValueZero algorithm when determining key equality. + */ +export class InternSet extends Set { +} diff --git a/astra_scene_test/X_03/node_modules/@types/d3-array/package.json b/astra_scene_test/X_03/node_modules/@types/d3-array/package.json new file mode 100644 index 0000000000000000000000000000000000000000..59a3c9d43c9dd13e4094af90a11953c1a7016c99 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/d3-array/package.json @@ -0,0 +1,56 @@ +{ + "name": "@types/d3-array", + "version": "3.2.2", + "description": "TypeScript definitions for d3-array", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-array", + "license": "MIT", + "contributors": [ + { + "name": "Alex Ford", + "githubUsername": "gustavderdrache", + "url": "https://github.com/gustavderdrache" + }, + { + "name": "Boris Yankov", + "githubUsername": "borisyankov", + "url": "https://github.com/borisyankov" + }, + { + "name": "Tom Wanzek", + "githubUsername": "tomwanzek", + "url": "https://github.com/tomwanzek" + }, + { + "name": "denisname", + "githubUsername": "denisname", + "url": "https://github.com/denisname" + }, + { + "name": "Hugues Stefanski", + "githubUsername": "ledragon", + "url": "https://github.com/ledragon" + }, + { + "name": "Nathan Bierema", + "githubUsername": "Methuselah96", + "url": "https://github.com/Methuselah96" + }, + { + "name": "Fil", + "githubUsername": "Fil", + "url": "https://github.com/Fil" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/d3-array" + }, + "scripts": {}, + "dependencies": {}, + "peerDependencies": {}, + "typesPublisherContentHash": "d8ff015b14e99aec79f6ac45682bd8237145131c804b94de0ed1e6bc003d5190", + "typeScriptVersion": "5.2" +} \ No newline at end of file diff --git a/astra_scene_test/X_03/node_modules/@types/d3-color/LICENSE b/astra_scene_test/X_03/node_modules/@types/d3-color/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9e841e7a26e4eb057b24511e7b92d42b257a80e5 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/d3-color/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/astra_scene_test/X_03/node_modules/@types/d3-color/README.md b/astra_scene_test/X_03/node_modules/@types/d3-color/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b4b375b8d272872ae5f278b00e76c9481f1cd609 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/d3-color/README.md @@ -0,0 +1,15 @@ +# Installation +> `npm install --save @types/d3-color` + +# Summary +This package contains type definitions for d3-color (https://github.com/d3/d3-color/). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-color. + +### Additional Details + * Last updated: Tue, 07 Nov 2023 15:11:36 GMT + * Dependencies: none + +# Credits +These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [denisname](https://github.com/denisname), [Hugues Stefanski](https://github.com/ledragon), [Nathan Bierema](https://github.com/Methuselah96), and [Fil](https://github.com/Fil). diff --git a/astra_scene_test/X_03/node_modules/@types/d3-color/index.d.ts b/astra_scene_test/X_03/node_modules/@types/d3-color/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0ffcfae7ab591e0c30ac116825538fb051b43817 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/d3-color/index.d.ts @@ -0,0 +1,669 @@ +// Last module patch version validated against: 3.1.0 + +// --------------------------------------------------------------------------- +// Shared Type Definitions and Interfaces +// --------------------------------------------------------------------------- + +/** + * Type allowing for color objects from a specified color space + */ +export type ColorSpaceObject = RGBColor | HSLColor | LabColor | HCLColor | CubehelixColor; + +/** + * A helper interface of methods common to color objects (including colors defined outside the d3-color standard module, + * e.g. in d3-hsv). This interface + */ +export interface ColorCommonInstance { + /** + * Returns true if and only if the color is displayable on standard hardware. + * For example, this returns false for an RGB color if any channel value is less than zero or greater than 255, or if the opacity is not in the range [0, 1]. + */ + displayable(): boolean; + /** + * Returns a string representing this color according to the CSS Object Model specification, + * such as rgb(247, 234, 186) or rgba(247, 234, 186, 0.2). + * If this color is not displayable, a suitable displayable color is returned instead. + * For example, RGB channel values greater than 255 are clamped to 255. + */ + toString(): string; + /** + * Returns a brighter copy of this color. If k is specified, it controls how much brighter the returned color should be. + * If k is not specified, it defaults to 1. The behavior of this method is dependent on the implementing color space. + * + * @param k A color space dependent number to determine, how much brighter the returned color should be. + */ + brighter(k?: number): this; + /** + * Returns a darker copy of this color. If k is specified, it controls how much darker the returned color should be. + * If k is not specified, it defaults to 1. The behavior of this method is dependent on the implementing color space. + * + * @param k A color space dependent number to determine, how much darker the returned color should be. + */ + darker(k?: number): this; + /** + * Returns the RGB equivalent of this color. For RGB colors, that’s "this". + */ + rgb(): RGBColor; + /** + * Returns a hexadecimal string representing this color. + * If this color is not displayable, a suitable displayable color is returned instead. + * For example, RGB channel values greater than 255 are clamped to 255. + */ + hex(): string; +} + +/** + * A Color object which serves as a base class for + * colorspace-specific sub-class implementations. + */ +export interface Color { + /** + * Returns true if and only if the color is displayable on standard hardware. + * For example, this returns false for an RGB color if any channel value is less than zero or greater than 255, or if the opacity is not in the range [0, 1]. + */ + displayable(): boolean; // Note: While this method is used in prototyping for colors of specific colorspaces, it should not be called directly, as 'this.rgb' would not be implemented on Color + /** + * Returns a string representing this color according to the CSS Object Model specification, + * such as rgb(247, 234, 186) or rgba(247, 234, 186, 0.2). + * If this color is not displayable, a suitable displayable color is returned instead. + * For example, RGB channel values greater than 255 are clamped to 255. + */ + toString(): string; // Note: While this method is used in prototyping for colors of specific colorspaces, it should not be called directly, as 'this.rgb' would not be implemented on Color + /** + * Returns a hexadecimal string representing this color in RGB space, such as #f7eaba. + * If this color is not displayable, a suitable displayable color is returned instead. + * For example, RGB channel values greater than 255 are clamped to 255. + */ + formatHex(): string; + /** + * Returns a hexadecimal string representing this color in RGBA space, such as #f7eaba90. + * If this color is not displayable, a suitable displayable color is returned instead. + * For example, RGB channel values greater than 255 are clamped to 255. + */ + formatHex8(): string; + /** + * Returns a string representing this color according to the CSS Color Module Level 3 specification, such as hsl(257, 50%, 80%) or hsla(257, 50%, 80%, 0.2). + * If this color is not displayable, a suitable displayable color is returned instead by clamping S and L channel values to the interval [0, 100]. + */ + formatHsl(): string; + /** + * Returns a string representing this color according to the CSS Object Model specification, such as rgb(247, 234, 186) or rgba(247, 234, 186, 0.2). + * If this color is not displayable, a suitable displayable color is returned instead by clamping RGB channel values to the interval [0, 255]. + */ + formatRgb(): string; + /** + * @deprecated Use color.formatHex. + */ + hex(): string; +} + +/** + * A Color factory object, which may also be used with instanceof to test if an object is a color instance. + */ +export interface ColorFactory extends Function { + /** + * Parses the specified CSS Color Module Level 3 specifier string, returning an RGB or HSL color. + * If the specifier was not valid, null is returned. + * + * @param cssColorSpecifier A CSS Color Module Level 3 specifier string. + */ + (cssColorSpecifier: string): RGBColor | HSLColor | null; + /** + * Converts the provided color instance and returns an RGB or HSL color. + * + * @param color A permissible color space instance. + */ + (color: ColorSpaceObject | ColorCommonInstance): RGBColor | HSLColor; + /** + * Prototype of the factory, which can be used for instanceof testing + */ + readonly prototype: Color; +} + +/** + * An RGB color object. + */ +export interface RGBColor extends Color { + /** + * Value of red channel + */ + r: number; + /** + * Value of green channel + */ + g: number; + /** + * Value of blue channel + */ + b: number; + /** + * Opacity value + */ + opacity: number; + /** + * Returns a brighter copy of this color. If k is specified, it controls how much brighter the returned color should be. + * If k is not specified, it defaults to 1. + * + * @param k A color space dependent number to determine, how much brighter the returned color should be. + */ + brighter(k?: number): this; + /** + * Returns a darker copy of this color. If k is specified, it controls how much darker the returned color should be. + * If k is not specified, it defaults to 1. + * + * @param k A color space dependent number to determine, how much darker the returned color should be. + */ + darker(k?: number): this; + /** + * Returns the RGB equivalent of this color. + */ + rgb(): this; + /** + * Returns a copy of this color. + * + * @param values If values is specified, any enumerable own properties of values are assigned to the new returned color. + */ + copy( + values?: { + r?: number | undefined; + g?: number | undefined; + b?: number | undefined; + opacity?: number | undefined; + }, + ): this; + /** + * Returns a new RGB color where the r, g, and b channels are clamped to the range [0, 255] and rounded to the nearest integer value, + * and the opacity is clamped to the range [0, 1]. + */ + clamp(): this; +} + +/** + * An RGB color factory object, which may also be used with instanceof to test if an object + * is an RGB color instance. + */ +export interface RGBColorFactory extends Function { + /** + * Constructs a new RGB color based on the specified channel values and opacity. + * + * @param r Red channel value. + * @param g Green channel value. + * @param b Blue channel value. + * @param opacity Optional opacity value, defaults to 1. + */ + (r: number, g: number, b: number, opacity?: number): RGBColor; + /** + * Parses the specified CSS Color Module Level 3 specifier string, returning an RGB color. + * If the specifier was not valid, null is returned. + * + * @param cssColorSpecifier A CSS Color Module Level 3 specifier string. + */ + (cssColorSpecifier: string): RGBColor; + /** + * Converts the provided color instance and returns an RGB color. The color instance is converted to the RGB color space using color.rgb. + * Note that unlike color.rgb this method always returns a new instance, even if color is already an RGB color. + * + * @param color A permissible color space instance. + */ + // tslint:disable-next-line:unified-signatures + (color: ColorSpaceObject | ColorCommonInstance): RGBColor; + /** + * Prototype of the factory, which can be used for instanceof testing + */ + readonly prototype: RGBColor; +} + +/** + * An HSL color object. + */ +export interface HSLColor extends Color { + /** + * Hue channel value. + */ + h: number; + /** + * Saturation channel value. + */ + s: number; + /** + * Lightness channel value. + */ + l: number; + /** + * Opacity value. + */ + opacity: number; + /** + * Returns a brighter copy of this color. If k is specified, it controls how much brighter the returned color should be. + * If k is not specified, it defaults to 1. + * + * @param k A color space dependent number to determine, how much brighter the returned color should be. + */ + brighter(k?: number): this; + /** + * Returns a darker copy of this color. If k is specified, it controls how much darker the returned color should be. + * If k is not specified, it defaults to 1. + * + * @param k A color space dependent number to determine, how much darker the returned color should be. + */ + darker(k?: number): this; + /** + * Returns the RGB color equivalent of this color. + */ + rgb(): RGBColor; + /** + * Returns a copy of this color. + * + * @param values If values is specified, any enumerable own properties of values are assigned to the new returned color. + */ + copy( + values?: { + h?: number | undefined; + s?: number | undefined; + l?: number | undefined; + opacity?: number | undefined; + }, + ): this; + /** + * Returns a new HSL color where the h channel is clamped to the range [0, 360), and the s, l, and opacity channels are clamped to the range [0, 1]. + */ + clamp(): this; +} + +/** + * An HSL color factory object, which may also be used with instanceof to test if an object + * is an HSL color instance. + */ +export interface HSLColorFactory extends Function { + /** + * Constructs a new HSL color based on the specified channel values and opacity. + * + * @param h Hue channel value. + * @param s Saturation channel value. + * @param l Lightness channel value. + * @param opacity Optional opacity value, defaults to 1. + */ + (h: number, s: number, l: number, opacity?: number): HSLColor; + /** + * Parses the specified CSS Color Module Level 3 specifier string, returning an HSL color. + * If the specifier was not valid, null is returned. + * + * @param cssColorSpecifier A CSS Color Module Level 3 specifier string. + */ + (cssColorSpecifier: string): HSLColor; + /** + * Converts the provided color instance and returns an HSL color. + * The color instance is converted to the RGB color space using color.rgb and then converted to HSL. + * (Colors already in the HSL color space skip the conversion to RGB.) + * + * @param color A permissible color space instance. + */ + // tslint:disable-next-line:unified-signatures + (color: ColorSpaceObject | ColorCommonInstance): HSLColor; + /** + * Prototype of the factory, which can be used for instanceof testing + */ + readonly prototype: HSLColor; +} + +/** + * A Lab (CIELAB) color object. + */ +export interface LabColor extends Color { + /** + * Lightness typically in the range [0, 100]. + */ + l: number; + /** + * Position between red/magenta and green typically in [-160, +160]. + */ + a: number; + /** + * Position between yellow and blue typically in [-160, +160]. + */ + b: number; + /** + * Opacity value + */ + opacity: number; + /** + * Returns a brighter copy of this color. If k is specified, it controls how much brighter the returned color should be. + * If k is not specified, it defaults to 1. + * + * @param k A color space dependent number to determine, how much brighter the returned color should be. + */ + brighter(k?: number): this; + /** + * Returns a darker copy of this color. If k is specified, it controls how much darker the returned color should be. + * If k is not specified, it defaults to 1. + * + * @param k A color space dependent number to determine, how much darker the returned color should be. + */ + darker(k?: number): this; + /** + * Returns the RGB color equivalent of this color. + */ + rgb(): RGBColor; + /** + * Returns a copy of this color. + * + * @param values If values is specified, any enumerable own properties of values are assigned to the new returned color. + */ + copy( + values?: { + l?: number | undefined; + a?: number | undefined; + b?: number | undefined; + opacity?: number | undefined; + }, + ): this; +} + +/** + * A Lab (CIELAB) color factory object, which may also be used with instanceof to test if an object + * is a Lab color instance. + */ +export interface LabColorFactory extends Function { + /** + * Constructs a new CIELAB color based on the specified channel values and opacity. + * + * @param l Lightness typically in the range [0, 100]. + * @param a Position between red/magenta and green typically in [-160, +160]. + * @param b Position between yellow and blue typically in [-160, +160]. + * @param opacity Optional opacity value, defaults to 1. + */ + (l: number, a: number, b: number, opacity?: number): LabColor; + /** + * Parses the specified CSS Color Module Level 3 specifier string, returning a Lab color. + * If the specifier was not valid, null is returned. + * + * @param cssColorSpecifier A CSS Color Module Level 3 specifier string. + */ + (cssColorSpecifier: string): LabColor; + /** + * Converts the provided color instance and returns a Lab color. + * The color instance is converted to the RGB color space using color.rgb and then converted to CIELAB. + * (Colors already in the Lab color space skip the conversion to RGB, + * and colors in the HCL color space are converted directly to CIELAB.) + * + * @param color A permissible color space instance. + */ + // tslint:disable-next-line:unified-signatures + (color: ColorSpaceObject | ColorCommonInstance): LabColor; + /** + * Prototype of the factory, which can be used for instanceof testing + */ + readonly prototype: LabColor; +} + +/** + * A gray color factory for Lab (CIELAB) colors. + */ +export type GrayColorFactory = + /** + * Constructs a new CIELAB color with the specified l value and a = b = 0. + * + * @param l Lightness typically in the range [0, 100]. + * @param opacity Optional opacity value, defaults to 1. + */ + (l: number, opacity?: number) => LabColor; + +/** + * An HCL (CIELCH) color object. + */ +export interface HCLColor extends Color { + /** + * Hue channel value typically in [0, 360). + */ + h: number; + /** + * Chroma channel value typically in [0, 230]. + */ + c: number; + /** + * Luminance channel value typically in the range [0, 100]. + */ + l: number; + /** + * Opacity value + */ + opacity: number; + /** + * Returns a brighter copy of this color. If k is specified, it controls how much brighter the returned color should be. + * If k is not specified, it defaults to 1. + * + * @param k A color space dependent number to determine, how much brighter the returned color should be. + */ + brighter(k?: number): this; + /** + * Returns a darker copy of this color. If k is specified, it controls how much darker the returned color should be. + * If k is not specified, it defaults to 1. + * + * @param k A color space dependent number to determine, how much darker the returned color should be. + */ + darker(k?: number): this; + /** + * Returns the RGB color equivalent of this color. + */ + rgb(): RGBColor; + /** + * Returns a copy of this color. + * + * @param values If values is specified, any enumerable own properties of values are assigned to the new returned color. + */ + copy( + values?: { + h?: number | undefined; + c?: number | undefined; + l?: number | undefined; + opacity?: number | undefined; + }, + ): this; +} + +/** + * An HCL (CIELCH) color factory object, which may also be used with instanceof to test if an object + * is an HCL color instance. + */ +export interface HCLColorFactory extends Function { + /** + * Constructs a new HCL color based on the specified channel values and opacity. + * + * @param h Hue channel value typically in [0, 360). + * @param c Chroma channel value typically in [0, 230]. + * @param l Luminance channel value typically in the range [0, 100]. + * @param opacity Optional opacity value, defaults to 1. + */ + (h: number, c: number, l: number, opacity?: number): HCLColor; + /** + * Parses the specified CSS Color Module Level 3 specifier string, returning an HCL color. + * If the specifier was not valid, null is returned. + * + * @param cssColorSpecifier A CSS Color Module Level 3 specifier string. + */ + (cssColorSpecifier: string): HCLColor; + /** + * Converts the provided color instance and returns an HCL color. + * The color instance is converted to the RGB color space using color.rgb and then converted to HCL. + * (Colors already in the HCL color space skip the conversion to RGB, + * and colors in the Lab color space are converted directly to HCL.) + * + * @param color A permissible color space instance. + */ + // tslint:disable-next-line:unified-signatures + (color: ColorSpaceObject | ColorCommonInstance): HCLColor; + /** + * Prototype of the factory, which can be used for instanceof testing + */ + readonly prototype: HCLColor; +} + +/** + * An LCH (CIELCH) color factory function to create an HCL color object. + */ +export interface LCHColorFactory { + /** + * Constructs a new HCL color based on the specified channel values and opacity. + * + * @param l Luminance channel value typically in the range [0, 100]. + * @param c Chroma channel value typically in [0, 230]. + * @param h Hue channel value typically in [0, 360). + * @param opacity Optional opacity value, defaults to 1. + */ + (l: number, c: number, h: number, opacity?: number): HCLColor; + /** + * Parses the specified CSS Color Module Level 3 specifier string, returning an HCL color. + * If the specifier was not valid, null is returned. + * + * @param cssColorSpecifier A CSS color Module Level 3 specifier string. + */ + (cssColorSpecifier: string): HCLColor; + /** + * Converts the provided color instance and returns an HCL color. + * The color instance is converted to the RGB color space using color.rgb and then converted to HCL. + * (Colors already in the HCL color space skip the conversion to RGB, + * and colors in the Lab color space are converted directly to HCL.) + * + * @param color A permissible color space instance. + */ + // tslint:disable-next-line:unified-signatures + (color: ColorSpaceObject | ColorCommonInstance): HCLColor; +} + +/** + * Dave Green’s Cubehelix color object. + */ +export interface CubehelixColor extends Color { + /** + * Hue channel value. + */ + h: number; + /** + * Saturation channel value. + */ + s: number; + /** + * Lightness channel value. + */ + l: number; + /** + * Opacity value. + */ + opacity: number; + /** + * Returns a brighter copy of this color. If k is specified, it controls how much brighter the returned color should be. + * If k is not specified, it defaults to 1. + * + * @param k A color space dependent number to determine, how much brighter the returned color should be. + */ + brighter(k?: number): this; + /** + * Returns a darker copy of this color. If k is specified, it controls how much darker the returned color should be. + * If k is not specified, it defaults to 1. + * + * @param k A color space dependent number to determine, how much darker the returned color should be. + */ + darker(k?: number): this; + /** + * Returns the RGB color equivalent of this color. + */ + rgb(): RGBColor; + /** + * Returns a copy of this color. + * + * @param values If values is specified, any enumerable own properties of values are assigned to the new returned color. + */ + copy( + values?: { + h?: number | undefined; + s?: number | undefined; + l?: number | undefined; + opacity?: number | undefined; + }, + ): this; +} + +/** + * A color factory object for Dave Green's Cubehelix colors, which may also be used with instanceof to test if an object + * is a Cubehelix color instance. + */ +export interface CubehelixColorFactory extends Function { + /** + * Constructs a new Cubehelix color based on the specified channel values and opacity. + * + * @param h Hue channel value. + * @param s Saturation channel value. + * @param l Lightness channel value. + * @param opacity Optional opacity value, defaults to 1. + */ + (h: number, s: number, l: number, opacity?: number): CubehelixColor; + /** + * Parses the specified CSS Color Module Level 3 specifier string, returning an Cubehelix color. + * If the specifier was not valid, null is returned. + * + * @param cssColorSpecifier A CSS Color Module Level 3 specifier string. + */ + (cssColorSpecifier: string): CubehelixColor; + /** + * Converts the provided color instance and returns a Cubehelix color. + * The color instance is specified, it is converted to the RGB color space using color.rgb and then converted to Cubehelix. + * (Colors already in the Cubehelix color space skip the conversion to RGB.) + * + * @param color A permissible color space instance. + */ + // tslint:disable-next-line:unified-signatures + (color: ColorSpaceObject | ColorCommonInstance): CubehelixColor; + /** + * Prototype of the factory, which can be used for instanceof testing + */ + readonly prototype: CubehelixColor; +} + +// -------------------------------------------------------------------------- +// Color object factories +// -------------------------------------------------------------------------- + +/** + * A Color factory object, which may also be used with instanceof to test if an object is a color instance. + */ +export const color: ColorFactory; + +/** + * An RGB color factory object, which may also be used with instanceof to test if an object + * is an RGB color instance. + */ +export const rgb: RGBColorFactory; + +/** + * An HSL color factory object, which may also be used with instanceof to test if an object + * is an HSL color instance. + */ +export const hsl: HSLColorFactory; + +/** + * A Lab (CIELAB) color factory object, which may also be used with instanceof to test if an object + * is a Lab color instance. + */ +export const lab: LabColorFactory; + +/** + * A gray color factory for Lab (CIELAB) colors. + */ +export const gray: GrayColorFactory; + +/** + * An HCL (CIELCH) color factory object, which may also be used with instanceof to test if an object + * is an HCL color instance. + */ +export const hcl: HCLColorFactory; + +/** + * An LCH (CIELCH) color factory function to create an HCL color object. + */ +export const lch: LCHColorFactory; + +/** + * A color factory object for Dave Green's Cubehelix colors, which may also be used with instanceof to test if an object + * is a Cubehelix color instance. + */ +export const cubehelix: CubehelixColorFactory; diff --git a/astra_scene_test/X_03/node_modules/@types/d3-color/package.json b/astra_scene_test/X_03/node_modules/@types/d3-color/package.json new file mode 100644 index 0000000000000000000000000000000000000000..6a59cadbaad79bbc68c8a61f33c32c42f7741d0a --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/d3-color/package.json @@ -0,0 +1,55 @@ +{ + "name": "@types/d3-color", + "version": "3.1.3", + "description": "TypeScript definitions for d3-color", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-color", + "license": "MIT", + "contributors": [ + { + "name": "Tom Wanzek", + "githubUsername": "tomwanzek", + "url": "https://github.com/tomwanzek" + }, + { + "name": "Alex Ford", + "githubUsername": "gustavderdrache", + "url": "https://github.com/gustavderdrache" + }, + { + "name": "Boris Yankov", + "githubUsername": "borisyankov", + "url": "https://github.com/borisyankov" + }, + { + "name": "denisname", + "githubUsername": "denisname", + "url": "https://github.com/denisname" + }, + { + "name": "Hugues Stefanski", + "githubUsername": "ledragon", + "url": "https://github.com/ledragon" + }, + { + "name": "Nathan Bierema", + "githubUsername": "Methuselah96", + "url": "https://github.com/Methuselah96" + }, + { + "name": "Fil", + "githubUsername": "Fil", + "url": "https://github.com/Fil" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/d3-color" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "89cf9357324cddaa31cfb539b1c33d118648ed55319f2a0d26f24b004975a947", + "typeScriptVersion": "4.5" +} \ No newline at end of file diff --git a/astra_scene_test/X_03/node_modules/@types/d3-interpolate/LICENSE b/astra_scene_test/X_03/node_modules/@types/d3-interpolate/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9e841e7a26e4eb057b24511e7b92d42b257a80e5 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/d3-interpolate/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/astra_scene_test/X_03/node_modules/@types/d3-interpolate/README.md b/astra_scene_test/X_03/node_modules/@types/d3-interpolate/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b57b552a607a28684d0dcf059f6bf17c3055dd34 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/d3-interpolate/README.md @@ -0,0 +1,15 @@ +# Installation +> `npm install --save @types/d3-interpolate` + +# Summary +This package contains type definitions for d3-interpolate (https://github.com/d3/d3-interpolate/). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-interpolate. + +### Additional Details + * Last updated: Tue, 07 Nov 2023 15:11:37 GMT + * Dependencies: [@types/d3-color](https://npmjs.com/package/@types/d3-color) + +# Credits +These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [denisname](https://github.com/denisname), and [Nathan Bierema](https://github.com/Methuselah96). diff --git a/astra_scene_test/X_03/node_modules/@types/d3-interpolate/index.d.ts b/astra_scene_test/X_03/node_modules/@types/d3-interpolate/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cbb655be6681b6653cec5a3edd4e7f6cbcb88406 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/d3-interpolate/index.d.ts @@ -0,0 +1,387 @@ +// Last module patch version validated against: 3.0.1 + +import { ColorCommonInstance } from "d3-color"; + +// --------------------------------------------------------------------------- +// Shared Type Definitions and Interfaces +// --------------------------------------------------------------------------- + +export interface ZoomInterpolator extends Function { + (t: number): ZoomView; + /** + * Recommended duration of zoom transition in milliseconds. + */ + duration: number; + + /** + * Given a zoom interpolator, returns a new zoom interpolator using the specified curvature rho. + * When rho is close to 0, the interpolator is almost linear. + * The default curvature is sqrt(2). + * @param rho + */ + rho(rho: number): this; +} + +export interface ColorGammaInterpolationFactory extends Function { + (a: string | ColorCommonInstance, b: string | ColorCommonInstance): (t: number) => string; + /** + * Returns a new interpolator factory of the same type using the specified *gamma*. + * For example, to interpolate from purple to orange with a gamma of 2.2 in RGB space: `d3.interpolateRgb.gamma(2.2)("purple", "orange")`. + * See Eric Brasseur’s article, [Gamma error in picture scaling](https://web.archive.org/web/20160112115812/http://www.4p8.com/eric.brasseur/gamma.html), for more on gamma correction. + */ + gamma(g: number): ColorGammaInterpolationFactory; +} + +/** + * Type zoomView is used to represent a numeric array with three elements. + * In order of appearance the elements correspond to: + * - cx: *x*-coordinate of the center of the viewport + * - cy: *y*-coordinate of the center of the viewport + * - width: size of the viewport + */ +export type ZoomView = [number, number, number]; + +export type TypedArray = + | Int8Array + | Uint8Array + | Int16Array + | Uint16Array + | Int32Array + | Uint32Array + | Uint8ClampedArray + | Float32Array + | Float64Array; + +export type NumberArray = TypedArray | DataView; + +// --------------------------------------------------------------------------- +// Interpolation Function Factories +// --------------------------------------------------------------------------- + +/** + * Returns an `null` constant interpolator. + */ +export function interpolate(a: any, b: null): (t: number) => null; +/** + * Returns an boolean constant interpolator of value `b`. + */ +export function interpolate(a: any, b: boolean): (t: number) => boolean; +/** + * Returns a `interpolateRgb` interpolator. + */ +export function interpolate(a: string | ColorCommonInstance, b: ColorCommonInstance): (t: number) => string; +/** + * Returns a `interpolateDate` interpolator. + */ +export function interpolate(a: Date, b: Date): (t: number) => Date; +/** + * Returns a `interpolateNumber` interpolator. + */ +export function interpolate( + a: number | { valueOf(): number }, + b: number | { valueOf(): number }, +): (t: number) => number; +/** + * Returns a `interpolateNumberArray` interpolator. + */ +export function interpolate(a: NumberArray | number[], b: T): (t: number) => T; +/** + * Returns a `interpolateString` interpolator. If `b` is a string coercible to a color use use `interpolateRgb`. + */ +export function interpolate(a: string | { toString(): string }, b: string): (t: number) => string; +/** + * Returns a `interpolateArray` interpolator. + */ +export function interpolate(a: any[], b: U): (t: number) => U; +/** + * Returns a `interpolateObject` interpolator. + */ +export function interpolate(a: any, b: U): (t: number) => U; + +/** + * Returns an interpolator between the two numbers `a` and `b`. + * The returned interpolator is equivalent to: `(t) => a * (1 - t) + b * t`. + */ +export function interpolateNumber( + a: number | { valueOf(): number }, + b: number | { valueOf(): number }, +): (t: number) => number; + +/** + * Returns an interpolator between the two numbers `a` and `b`; the interpolator is similar to `interpolateNumber`, + * except it will round the resulting value to the nearest integer. + */ +export function interpolateRound( + a: number | { valueOf(): number }, + b: number | { valueOf(): number }, +): (t: number) => number; + +/** + * Returns an interpolator between the two strings `a` and `b`. + * The string interpolator finds numbers embedded in `a` and `b`, where each number is of the form understood by JavaScript. + * A few examples of numbers that will be detected within a string: `-1`, `42`, `3.14159`, and `6.0221413e+23`. + * + * For each number embedded in `b`, the interpolator will attempt to find a corresponding number in `a`. + * If a corresponding number is found, a numeric interpolator is created using `interpolateNumber`. + * The remaining parts of the string `b` are used as a template. + * + * For example, if `a` is `"300 12px sans-serif"`, and `b` is `"500 36px Comic-Sans"`, two embedded numbers are found. + * The remaining static parts (of string `b`) are a space between the two numbers (`" "`), and the suffix (`"px Comic-Sans"`). + * The result of the interpolator at `t` = 0.5 is `"400 24px Comic-Sans"`. + */ +export function interpolateString( + a: string | { toString(): string }, + b: string | { toString(): string }, +): (t: number) => string; + +/** + * Returns an interpolator between the two dates `a` and `b`. + * + * Note: *no defensive copy* of the returned date is created; the same Date instance is returned for every evaluation of the interpolator. + * No copy is made for performance reasons; interpolators are often part of the inner loop of animated transitions. + */ +export function interpolateDate(a: Date, b: Date): (t: number) => Date; + +export type ArrayInterpolator = (t: number) => A; + +/** + * Returns an interpolator between the two arrays `a` and `b`. Internally, an array template is created that is the same length in `b`. + * For each element in `b`, if there exists a corresponding element in `a`, a generic interpolator is created for the two elements using `interpolate`. + * If there is no such element, the static value from `b` is used in the template. + * Then, for the given parameter `t`, the template’s embedded interpolators are evaluated. The updated array template is then returned. + * + * For example, if `a` is the array `[0, 1]` and `b` is the array `[1, 10, 100]`, then the result of the interpolator for `t = 0.5` is the array `[0.5, 5.5, 100]`. + * + * Note: *no defensive copy* of the template array is created; modifications of the returned array may adversely affect subsequent evaluation of the interpolator. + * No copy is made for performance reasons; interpolators are often part of the inner loop of animated transitions. + */ +export function interpolateArray(a: any[], b: A): ArrayInterpolator; +/** + * interpolateNumberArray is called + */ +export function interpolateArray(a: NumberArray | number[], b: T): (t: number) => T; + +/** + * Returns an interpolator between the two arrays of numbers a and b. + * Internally, an array template is created that is the same type and length as b. + * For each element in b, if there exists a corresponding element in a, the values are directly interpolated in the array template. + * If there is no such element, the static value from b is copied. + * The updated array template is then returned. + * + * Note: For performance reasons, no defensive copy is made of the template array and the arguments a and b; modifications of these arrays may affect subsequent evaluation of the interpolator. + */ +export function interpolateNumberArray( + a: NumberArray | number[], + b: T, +): (t: number) => T; + +/** + * Returns an interpolator between the two objects `a` and `b`. Internally, an object template is created that has the same properties as `b`. + * For each property in `b`, if there exists a corresponding property in `a`, a generic interpolator is created for the two elements using `interpolate`. + * If there is no such property, the static value from `b` is used in the template. + * Then, for the given parameter `t`, the template's embedded interpolators are evaluated and the updated object template is then returned. + * + * For example, if `a` is the object `{x: 0, y: 1}` and `b` is the object `{x: 1, y: 10, z: 100}`, the result of the interpolator for `t = 0.5` is the object `{x: 0.5, y: 5.5, z: 100}`. + * + * Note: *no defensive copy* of the template object is created; modifications of the returned object may adversely affect subsequent evaluation of the interpolator. + * No copy is made for performance reasons; interpolators are often part of the inner loop of animated transitions. + */ +export function interpolateObject(a: any, b: U): (t: number) => U; + +/** + * Returns an interpolator between the two 2D CSS transforms represented by `a` and `b`. + * Each transform is decomposed to a standard representation of translate, rotate, *x*-skew and scale; these component transformations are then interpolated. + * This behavior is standardized by CSS: see [matrix decomposition for animation](http://www.w3.org/TR/css3-2d-transforms/#matrix-decomposition). + */ +export function interpolateTransformCss(a: string, b: string): (t: number) => string; + +/** + * Returns an interpolator between the two 2D SVG transforms represented by `a` and `b`. + * Each transform is decomposed to a standard representation of translate, rotate, *x*-skew and scale; these component transformations are then interpolated. + * This behavior is standardized by CSS: see [matrix decomposition for animation](http://www.w3.org/TR/css3-2d-transforms/#matrix-decomposition). + */ +export function interpolateTransformSvg(a: string, b: string): (t: number) => string; + +/** + * Returns an interpolator between the two views `a` and `b` of a two-dimensional plane, + * based on [“Smooth and efficient zooming and panning”](http://www.win.tue.nl/~vanwijk/zoompan.pdf). + * Each view is defined as an array of three numbers: *cx*, *cy* and *width*. + * The first two coordinates *cx*, *cy* represent the center of the viewport; the last coordinate *width* represents the size of the viewport. + * + * The returned interpolator exposes a *duration* property which encodes the recommended transition duration in milliseconds. + * This duration is based on the path length of the curved trajectory through *x,y* space. + * If you want to a slower or faster transition, multiply this by an arbitrary scale factor (*V* as described in the original paper). + */ +export function interpolateZoom(a: ZoomView, b: ZoomView): ZoomInterpolator; + +/** + * Returns a discrete interpolator for the given array of values. The returned interpolator maps `t` in `[0, 1 / n)` to values[0], + * `t` in `[1 / n, 2 / n)` to `values[1]`, and so on, where `n = values.length`. In effect, this is a lightweight quantize scale with a fixed domain of [0, 1]. + */ +export function interpolateDiscrete(values: T[]): (t: number) => T; + +// Sampling ------------------------------------------------------------------ + +/** + * Returns `n` uniformly-spaced samples from the specified `interpolator`, where `n` is an integer greater than one. + * The first sample is always at `t = 0`, and the last sample is always at `t = 1`. + * This can be useful in generating a fixed number of samples from a given interpolator, + * such as to derive the range of a [quantize scale](https://github.com/d3/d3-scale#quantize-scales) from a [continuous interpolator](https://github.com/d3/d3-scale#interpolateWarm). + * + * Caution: this method will not work with interpolators that do not return defensive copies of their output, + * such as `d3.interpolateArray`, `d3.interpolateDate` and `d3.interpolateObject`. For those interpolators, you must wrap the interpolator and create a copy for each returned value. + */ +export function quantize(interpolator: (t: number) => T, n: number): T[]; + +// Color Spaces + +/** + * Returns an RGB color space interpolator between the two colors `a` and `b` with a configurable gamma. If the gamma is not specified, it defaults to 1.0. + * The colors `a` and `b` need not be in RGB; they will be converted to RGB using [`d3.rgb`](https://github.com/d3/d3-color#rgb). The return value of the interpolator is an RGB string. + */ +export const interpolateRgb: ColorGammaInterpolationFactory; + +/** + * Returns a uniform nonrational B-spline interpolator through the specified array of *colors*, which are converted to RGB color space. + * Implicit control points are generated such that the interpolator returns `colors[0]` at `t = 0` and `colors[colors.length - 1]` at `t = 1`. + * Opacity interpolation is not currently supported. See also `d3.interpolateBasis`, and see [d3-scale-chromatic](https://github.com/d3/d3-scale-chromatic) for examples. + */ +export function interpolateRgbBasis(colors: Array): (t: number) => string; + +/** + * Returns a uniform nonrational B-spline interpolator through the specified array of colors, which are converted to RGB color space. + * The control points are implicitly repeated such that the resulting spline has cyclical C² continuity when repeated around `t` in [0,1]; + * this is useful, for example, to create cyclical color scales. Opacity interpolation is not currently supported. + * See also `d3.interpolateBasisClosed, and see [d3-scale-chromatic](https://github.com/d3/d3-scale-chromatic) for examples. + */ +export function interpolateRgbBasisClosed(colors: Array): (t: number) => string; + +/** + * Returns an HSL color space interpolator between the two colors *a* and *b*. The colors *a* and *b* need not be in HSL; + * they will be converted to HSL using `d3.hsl`. If either color’s hue or saturation is NaN, the opposing color’s channel value is used. + * The shortest path between hues is used. The return value of the interpolator is an RGB string. + */ +export function interpolateHsl(a: string | ColorCommonInstance, b: string | ColorCommonInstance): (t: number) => string; + +/** + * Like `interpolateHsl`, but does not use the shortest path between hues. + */ +export function interpolateHslLong( + a: string | ColorCommonInstance, + b: string | ColorCommonInstance, +): (t: number) => string; + +/** + * Returns a Lab color space interpolator between the two colors *a* and *b*. The colors *a* and *b* need not be in Lab; + * they will be converted to Lab using `d3.lab`. The return value of the interpolator is an RGB string. + */ +export function interpolateLab(a: string | ColorCommonInstance, b: string | ColorCommonInstance): (t: number) => string; + +/** + * Returns an HCL color space interpolator between the two colors `a` and `b`. The colors `a` and `b` need not be in HCL; + * they will be converted to HCL using `d3.hcl`. If either color’s hue or chroma is NaN, the opposing color’s channel value is used. + * The shortest path between hues is used. The return value of the interpolator is an RGB string. + */ +export function interpolateHcl(a: string | ColorCommonInstance, b: string | ColorCommonInstance): (t: number) => string; + +/** + * Like `interpolateHcl`, but does not use the shortest path between hues. + */ +export function interpolateHclLong( + a: string | ColorCommonInstance, + b: string | ColorCommonInstance, +): (t: number) => string; + +/** + * Returns a Cubehelix color space interpolator between the two colors `a` and `b` using a configurable `gamma`. + * If the gamma is not specified, it defaults to 1.0. The colors `a` and `b` need not be in Cubehelix; + * they will be converted to Cubehelix using [`d3.cubehelix`](https://github.com/d3/d3-color#cubehelix). + * If either color’s hue or saturation is NaN, the opposing color’s channel value is used. The shortest path between hues is used. The return value of the interpolator is an RGB string. + */ +export const interpolateCubehelix: ColorGammaInterpolationFactory; + +/** + * Like `interpolateCubehelix`, but does not use the shortest path between hues. + */ +export const interpolateCubehelixLong: ColorGammaInterpolationFactory; + +/** + * Returns an interpolator between the two hue angles `a` and `b`. If either hue is NaN, the opposing value is used. + * The shortest path between hues is used. The return value of the interpolator is a number in `[0, 360)`. + */ +export function interpolateHue(a: number, b: number): (t: number) => number; + +// Splines ------------------------------------------------------------------- + +/** + * Returns a uniform nonrational B-spline interpolator through the specified array of `values`, which must be numbers. + * Implicit control points are generated such that the interpolator returns `values[0]` at `t` = 0 and `values[values.length - 1]` at `t` = 1. + * See also [`d3.curveBasis`](https://github.com/d3/d3-shape#curveBasis). + */ +export function interpolateBasis(splineNodes: number[]): (t: number) => number; + +/** + * Returns a uniform nonrational B-spline interpolator through the specified array of `values`, which must be numbers. + * The control points are implicitly repeated such that the resulting one-dimensional spline has cyclical C² continuity when repeated around `t` in [0,1]. + * See also [`d3.curveBasisClosed`](https://github.com/d3/d3-shape#curveBasisClosed). + */ +export function interpolateBasisClosed(splineNodes: number[]): (t: number) => number; + +// Piecewise ----------------------------------------------------------------- + +/** + * Returns a piecewise zoom interpolator, composing zoom interpolators for each adjacent pair of zoom view. + * The returned interpolator maps `t` in `[0, 1 / (n - 1)]` to `interpolate(values[0], values[1])`, `t` in `[1 / (n - 1), 2 / (n - 1)]` to `interpolate(values[1], values[2])`, + * and so on, where `n = values.length`. In effect, this is a lightweight linear scale. + * For example, to blend through three different zoom views: `d3.piecewise(d3.interpolateZoom, [[0, 0, 1], [0, 0, 10], [0, 0, 15]])`. + * + * interpolate defaults to d3.interpolate. + */ +export function piecewise(values: ZoomView[]): ZoomInterpolator; +/** + * Returns a piecewise zoom interpolator, composing zoom interpolators for each adjacent pair of zoom view. + * The returned interpolator maps `t` in `[0, 1 / (n - 1)]` to `interpolate(values[0], values[1])`, `t` in `[1 / (n - 1), 2 / (n - 1)]` to `interpolate(values[1], values[2])`, + * and so on, where `n = values.length`. In effect, this is a lightweight linear scale. + * For example, to blend through three different zoom views: `d3.piecewise(d3.interpolateZoom, [[0, 0, 1], [0, 0, 10], [0, 0, 15]])`. + */ +export function piecewise( + interpolate: (a: ZoomView, b: ZoomView) => ZoomInterpolator, + values: ZoomView[], +): ZoomInterpolator; + +/** + * Returns a piecewise array interpolator, composing array interpolators for each adjacent pair of arrays. + * The returned interpolator maps `t` in `[0, 1 / (n - 1)]` to `interpolate(values[0], values[1])`, `t` in `[1 / (n - 1), 2 / (n - 1)]` to `interpolate(values[1], values[2])`, + * and so on, where `n = values.length`. In effect, this is a lightweight linear scale. + * For example, to blend through three different arrays: `d3.piecewise(d3.interpolateArray, [[0, 0, 1], [0, 0, 10], [0, 0, 15]])`. + * + * interpolate defaults to d3.interpolate. + */ +export function piecewise(values: A[]): ArrayInterpolator; +/** + * Returns a piecewise array interpolator, composing array interpolators for each adjacent pair of arrays. + * The returned interpolator maps `t` in `[0, 1 / (n - 1)]` to `interpolate(values[0], values[1])`, `t` in `[1 / (n - 1), 2 / (n - 1)]` to `interpolate(values[1], values[2])`, + * and so on, where `n = values.length`. In effect, this is a lightweight linear scale. + * For example, to blend through three different arrays: `d3.piecewise(d3.interpolateArray, [[0, 0, 1], [0, 0, 10], [0, 0, 15]])`. + */ +export function piecewise( + interpolate: (a: any[], b: A) => ArrayInterpolator, + values: A[], +): ArrayInterpolator; + +/** + * Returns a piecewise interpolator, composing interpolators for each adjacent pair of values. + * The returned interpolator maps `t` in `[0, 1 / (n - 1)]` to `interpolate(values[0], values[1])`, `t` in `[1 / (n - 1), 2 / (n - 1)]` to `interpolate(values[1], values[2])`, + * and so on, where `n = values.length`. In effect, this is a lightweight linear scale. + * For example, to blend through red, green and blue: `d3.piecewise(d3.interpolateRgb.gamma(2.2), ["red", "green", "blue"])`. + * + * interpolate defaults to d3.interpolate. + */ +export function piecewise(values: unknown[]): (t: number) => any; +/** + * Returns a piecewise interpolator, composing interpolators for each adjacent pair of values. + * The returned interpolator maps `t` in `[0, 1 / (n - 1)]` to `interpolate(values[0], values[1])`, `t` in `[1 / (n - 1), 2 / (n - 1)]` to `interpolate(values[1], values[2])`, + * and so on, where `n = values.length`. In effect, this is a lightweight linear scale. + * For example, to blend through red, green and blue: `d3.piecewise(d3.interpolateRgb.gamma(2.2), ["red", "green", "blue"])`. + */ +export function piecewise(interpolate: (a: TData, b: TData) => unknown, values: TData[]): (t: number) => any; diff --git a/astra_scene_test/X_03/node_modules/@types/d3-interpolate/package.json b/astra_scene_test/X_03/node_modules/@types/d3-interpolate/package.json new file mode 100644 index 0000000000000000000000000000000000000000..9d687bb3179e525e0bc60f2ee926593f542fa2a6 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/d3-interpolate/package.json @@ -0,0 +1,47 @@ +{ + "name": "@types/d3-interpolate", + "version": "3.0.4", + "description": "TypeScript definitions for d3-interpolate", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-interpolate", + "license": "MIT", + "contributors": [ + { + "name": "Tom Wanzek", + "githubUsername": "tomwanzek", + "url": "https://github.com/tomwanzek" + }, + { + "name": "Alex Ford", + "githubUsername": "gustavderdrache", + "url": "https://github.com/gustavderdrache" + }, + { + "name": "Boris Yankov", + "githubUsername": "borisyankov", + "url": "https://github.com/borisyankov" + }, + { + "name": "denisname", + "githubUsername": "denisname", + "url": "https://github.com/denisname" + }, + { + "name": "Nathan Bierema", + "githubUsername": "Methuselah96", + "url": "https://github.com/Methuselah96" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/d3-interpolate" + }, + "scripts": {}, + "dependencies": { + "@types/d3-color": "*" + }, + "typesPublisherContentHash": "d315fc677144695b44f1447ef7429c9ff248886716c2e9f742d031abcb319115", + "typeScriptVersion": "4.5" +} \ No newline at end of file diff --git a/astra_scene_test/X_03/node_modules/@types/d3-scale/LICENSE b/astra_scene_test/X_03/node_modules/@types/d3-scale/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9e841e7a26e4eb057b24511e7b92d42b257a80e5 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/d3-scale/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/astra_scene_test/X_03/node_modules/@types/d3-scale/README.md b/astra_scene_test/X_03/node_modules/@types/d3-scale/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f462893cac76bae7c99457c950852da380bff99e --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/d3-scale/README.md @@ -0,0 +1,15 @@ +# Installation +> `npm install --save @types/d3-scale` + +# Summary +This package contains type definitions for d3-scale (https://github.com/d3/d3-scale/). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-scale. + +### Additional Details + * Last updated: Wed, 05 Feb 2025 00:46:59 GMT + * Dependencies: [@types/d3-time](https://npmjs.com/package/@types/d3-time) + +# Credits +These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [denisname](https://github.com/denisname), [rulonder](https://github.com/rulonder), and [Nathan Bierema](https://github.com/Methuselah96). diff --git a/astra_scene_test/X_03/node_modules/@types/d3-scale/index.d.ts b/astra_scene_test/X_03/node_modules/@types/d3-scale/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f0bc6fe45e40ba7879374488bf335ed30a3d2b6b --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/d3-scale/index.d.ts @@ -0,0 +1,2669 @@ +// Last module patch version validated against: 4.0.2 + +import { CountableTimeInterval, TimeInterval } from "d3-time"; + +// ------------------------------------------------------------------------------- +// Shared Types and Interfaces +// ------------------------------------------------------------------------------- + +/** + * An Interpolator factory returns an interpolator function. + * + * The first generic corresponds to the data type of the interpolation boundaries. + * The second generic corresponds to the data type of the return type of the interpolator. + */ +export interface InterpolatorFactory { + /** + * Construct a new interpolator function, based on the provided interpolation boundaries. + * + * @param a Start boundary of the interpolation interval. + * @param b End boundary of the interpolation interval. + */ + (a: T, b: T): (t: number) => U; +} + +export type NumberValue = number | { valueOf(): number }; + +export type UnknownReturnType = [Unknown] extends [never] ? DefaultUnknown : Unknown; + +/** + * A helper interface for a continuous scale defined over a numeric domain. + */ +export interface ScaleContinuousNumeric { + /** + * Given a value from the domain, returns the corresponding value from the range, subject to interpolation, if any. + * + * If the given value is outside the domain, and clamping is not enabled, the mapping may be extrapolated such that the returned value is outside the range. + * + * Note: The interpolation function applied by the scale may change the output type from the range type as part of the interpolation. + * + * @param value A numeric value from the domain. + */ + (value: NumberValue): Output | Unknown; + + /** + * Given a value from the range, returns the corresponding value from the domain. Inversion is useful for interaction, + * say to determine the data value corresponding to the position of the mouse. + * + * If the given value is outside the range, and clamping is not enabled, the mapping may be extrapolated such that the returned value is outside the domain. + * + * IMPORTANT: This method is only supported if the range is numeric. If the range is not numeric, returns NaN. + * + * For a valid value y in the range, continuous(continuous.invert(y)) approximately equals y; + * similarly, for a valid value x in the domain, continuous.invert(continuous(x)) approximately equals x. + * The scale and its inverse may not be exact due to the limitations of floating point precision. + * + * @param value A numeric value from the range. + */ + invert(value: NumberValue): number; + + /** + * Returns a copy of the scale’s current domain. + */ + domain(): number[]; + /** + * Sets the scale’s domain to the specified array of numbers. The array must contain two or more elements. + * If the elements in the given array are not numbers, they will be coerced to numbers + * + * Although continuous scales typically have two values each in their domain and range, specifying more than two values produces a piecewise scale. + * + * Internally, a piecewise scale performs a binary search for the range interpolator corresponding to the given domain value. + * Thus, the domain must be in ascending or descending order. If the domain and range have different lengths N and M, only the first min(N,M) elements in each are observed. + * + * @param domain Array of numeric domain values. + */ + domain(domain: Iterable): this; + + /** + * Returns a copy of the scale’s current range. + */ + range(): Range[]; + /** + * Sets the scale’s range to the specified array of values. + * + * The array must contain two or more elements. Unlike the domain, elements in the given array need not be numbers; + * any value that is supported by the underlying interpolator will work, though note that numeric ranges are required for invert. + * + * @param range Array of range values. + */ + range(range: Iterable): this; + + /** + * Sets the scale’s range to the specified array of values while also setting the scale’s interpolator to interpolateRound. + * + * The rounding interpolator is sometimes useful for avoiding antialiasing artifacts, + * though also consider the shape-rendering “crispEdges” styles. Note that this interpolator can only be used with numeric ranges. + * + * The array must contain two or more elements. Unlike the domain, elements in the given array need not be numbers; + * any value that is supported by the underlying interpolator will work, though note that numeric ranges are required for invert. + * + * @param range Array of range values. + */ + rangeRound(range: Iterable): this; + + /** + * Returns whether or not the scale currently clamps values to within the range. + */ + clamp(): boolean; + /** + * Enables or disables clamping, respectively. If clamping is disabled and the scale is passed a value outside the domain, + * the scale may return a value outside the range through extrapolation. + * + * If clamping is enabled, the return value of the scale is always within the scale’s range. Clamping similarly applies to the "invert" method. + * + * @param clamp A flag to enable (true) or disable (false) clamping. + */ + clamp(clamp: boolean): this; + + /** + * Returns approximately count representative values from the scale’s domain. + * + * If count is not specified, it defaults to 10. + * + * The returned tick values are uniformly spaced, have human-readable values (such as multiples of powers of 10), + * and are guaranteed to be within the extent of the domain. Ticks are often used to display reference lines, or tick marks, in conjunction with the visualized data. + * The specified count is only a hint; the scale may return more or fewer values depending on the domain. See also d3-array’s ticks. + * + * @param count Optional approximate number of ticks to be returned. If count is not specified, it defaults to 10. + */ + ticks(count?: number): number[]; + + /** + * Returns a number format function suitable for displaying a tick value, automatically computing the appropriate precision based on the fixed interval between tick values. + * The specified count should have the same value as the count that is used to generate the tick values. + * + * @param count Approximate number of ticks to be used when calculating precision for the number format function. + * @param specifier An optional valid format specifier string which allows a custom format where the precision of the format is automatically set by the scale as appropriate for the tick interval. + * If specifier uses the format type "s", the scale will return a SI-prefix format based on the largest value in the domain. + * If the specifier already specifies a precision, this method is equivalent to locale.format. + */ + tickFormat(count?: number, specifier?: string): (d: NumberValue) => string; + + /** + * Extends the domain so that it starts and ends on nice round values. + * This method typically modifies the scale’s domain, and may only extend the bounds to the nearest round value. + * An optional tick count argument allows greater control over the step size used to extend the bounds, + * guaranteeing that the returned ticks will exactly cover the domain. + * Nicing is useful if the domain is computed from data, say using extent, and may be irregular. + * For example, for a domain of [0.201479…, 0.996679…], a nice domain might be [0.2, 1.0]. + * If the domain has more than two values, nicing the domain only affects the first and last value. + * + * Nicing a scale only modifies the current domain; it does not automatically nice domains that are subsequently set using continuous.domain. + * You must re-nice the scale after setting the new domain, if desired. + * + * @param count An optional number of ticks expected to be used. + */ + nice(count?: number): this; + + /** + * Returns an exact copy of this scale. Changes to this scale will not affect the returned scale, and vice versa. + */ + copy(): this; +} + +/** + * Returns a number format function suitable for displaying a tick value, + * automatically computing the appropriate precision based on the fixed interval between tick values, as determined by d3.tickStep. + * + * @param start Start + * @param stop Stop + * @param count Approximate number of ticks to be used when calculating precision for the number format function. + * @param specifier An optional specifier allows a custom format where the precision of the format is automatically set by the scale as appropriate for the tick interval. + * If specifier uses the format type s, the scale will return a SI-prefix format based on the larger absolute value of start and stop. + * If the specifier already specifies a precision, this method is equivalent to locale.format. + */ +export function tickFormat(start: number, stop: number, count: number, specifier?: string): (d: NumberValue) => string; + +// ------------------------------------------------------------------------------- +// Linear Scale Factory +// ------------------------------------------------------------------------------- + +/** + * A linear continuous scale defined over a numeric domain. + * + * Continuous scales map a continuous, quantitative input domain to a continuous output range. + * Each range value y can be expressed as a function of the domain value x: y = mx + b. + * + * If the range is also numeric, the mapping may be inverted. + * + * Note that the data types of the range and output of the scale must be compatible with the interpolator applied by the scale. + * + * The first generic corresponds to the data type of the range elements. + * + * The second generic corresponds to the data type of the output elements generated by the scale. + * + * The third generic corresponds to the data type of the unknown value. + * + * If range element and output element type differ, the interpolator factory used with the scale must match this behavior and + * convert the interpolated range element to a corresponding output element. + */ +export interface ScaleLinear extends ScaleContinuousNumeric { + /** + * Returns the scale’s current interpolator factory, which defaults to interpolate. + */ + interpolate(): InterpolatorFactory; + + /** + * Sets the scale’s range interpolator factory. This interpolator factory is used to create interpolators for each adjacent pair of values from the range; + * these interpolators then map a normalized domain parameter t in [0, 1] to the corresponding value in the range. + * + * Note: the default interpolator may reuse return values. For example, if the range values are objects, then the value interpolator always returns the same object, modifying it in-place. + * If the scale is used to set an attribute or style, this is typically acceptable (and desirable for performance); + * however, if you need to store the scale’s return value, you must specify your own interpolator or make a copy as appropriate. + * + * As part of the interpolation process the interpolated value from the range may be converted to a corresponding output value. + * + * @param interpolate An interpolation factory. The generics for Range and Output of the scale must correspond to the interpolation factory applied to the scale. + */ + interpolate(interpolate: InterpolatorFactory): this; + /** + * Sets the scale’s range interpolator factory. This interpolator factory is used to create interpolators for each adjacent pair of values from the range; + * these interpolators then map a normalized domain parameter t in [0, 1] to the corresponding value in the range. + * + * Note: the default interpolator may reuse return values. For example, if the range values are objects, then the value interpolator always returns the same object, modifying it in-place. + * If the scale is used to set an attribute or style, this is typically acceptable (and desirable for performance); + * however, if you need to store the scale’s return value, you must specify your own interpolator or make a copy as appropriate. + * + * As part of the interpolation process the interpolated value from the range may be converted to a corresponding output value. + * + * The generic "NewOutput" can be used to change the scale to have a different output element type corresponding to the new interpolation factory. + * + * @param interpolate An interpolation factory. The generics for Range and Output of the scale must correspond to the interpolation factory applied to the scale. + */ + interpolate(interpolate: InterpolatorFactory): ScaleLinear; + + /** + * Returns the current unknown value, which defaults to undefined. + */ + unknown(): UnknownReturnType; + /** + * Sets the output value of the scale for undefined (or NaN) input values and returns this scale. + * + * @param value The output value of the scale for undefined (or NaN) input values. + */ + unknown(value: NewUnknown): ScaleLinear; +} + +/** + * Constructs a new continuous scale with the specified range, the default interpolator and clamping disabled. + * The domain defaults to [0, 1]. + * If range is not specified, it defaults to [0, 1]. + * + * The first generic corresponds to the data type of the range elements. + * The second generic corresponds to the data type of the output elements generated by the scale. + * The third generic corresponds to the data type of the unknown value. + * + * If range element and output element type differ, the interpolator factory used with the scale must match this behavior and + * convert the interpolated range element to a corresponding output element. + * + * The range must be set in accordance with the range element type. + * + * The interpolator factory may be set using the interpolate(...) method of the scale. + * + * @param range Array of range values. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleLinear( + range?: Iterable, +): ScaleLinear; +/** + * Constructs a new continuous scale with the specified domain and range, the default interpolator and clamping disabled. + * + * The first generic corresponds to the data type of the range elements. + * The second generic corresponds to the data type of the output elements generated by the scale. + * The third generic corresponds to the data type of the unknown value. + * + * If range element and output element type differ, the interpolator factory used with the scale must match this behavior and + * convert the interpolated range element to a corresponding output element. + * + * The range must be set in accordance with the range element type. + * + * The interpolator factory may be set using the interpolate(...) method of the scale. + * + * @param domain Array of numeric domain values. + * @param range Array of range values. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleLinear( + domain: Iterable, + range: Iterable, +): ScaleLinear; + +// ------------------------------------------------------------------------------- +// Power Scale Factories +// ------------------------------------------------------------------------------- + +/** + * A continuous power scale defined over a numeric domain. + * + * Continuous scales map a continuous, quantitative input domain to a continuous output range. + * + * Each range value y can be expressed as a function of the domain value x: y = mx^k + b, where k is the exponent value. + * Power scales also support negative domain values, in which case the input value and the resulting output value are multiplied by -1. + * + * If the range is also numeric, the mapping may be inverted. + * + * Note that the data types of the range and output of the scale must be compatible with the interpolator applied by the scale. + * + * The first generic corresponds to the data type of the range elements. + * + * The second generic corresponds to the data type of the output elements generated by the scale. + * + * The third generic corresponds to the data type of the unknown value. + * + * If range element and output element type differ, the interpolator factory used with the scale must match this behavior and + * convert the interpolated range element to a corresponding output element. + */ +export interface ScalePower extends ScaleContinuousNumeric { + /** + * Returns the scale’s current interpolator factory, which defaults to interpolate. + */ + interpolate(): InterpolatorFactory; + + /** + * Sets the scale’s range interpolator factory. This interpolator factory is used to create interpolators for each adjacent pair of values from the range; + * these interpolators then map a normalized domain parameter t in [0, 1] to the corresponding value in the range. + * + * Note: the default interpolator may reuse return values. For example, if the range values are objects, then the value interpolator always returns the same object, modifying it in-place. + * If the scale is used to set an attribute or style, this is typically acceptable (and desirable for performance); + * however, if you need to store the scale’s return value, you must specify your own interpolator or make a copy as appropriate. + * + * As part of the interpolation process the interpolated value from the range may be converted to a corresponding output value. + * + * @param interpolate An interpolation factory. The generics for Range and Output of the scale must correspond to the interpolation factory applied to the scale. + */ + interpolate(interpolate: InterpolatorFactory): this; + /** + * Sets the scale’s range interpolator factory. This interpolator factory is used to create interpolators for each adjacent pair of values from the range; + * these interpolators then map a normalized domain parameter t in [0, 1] to the corresponding value in the range. + * + * Note: the default interpolator may reuse return values. For example, if the range values are objects, then the value interpolator always returns the same object, modifying it in-place. + * If the scale is used to set an attribute or style, this is typically acceptable (and desirable for performance); + * however, if you need to store the scale’s return value, you must specify your own interpolator or make a copy as appropriate. + * + * As part of the interpolation process the interpolated value from the range may be converted to a corresponding output value. + * + * The generic "NewOutput" can be used to change the scale to have a different output element type corresponding to the new interpolation factory. + * + * @param interpolate An interpolation factory. The generics for Range and Output of the scale must correspond to the interpolation factory applied to the scale. + */ + interpolate(interpolate: InterpolatorFactory): ScalePower; + + /** + * If exponent is not specified, returns the current exponent, which defaults to 1. + * (Note that this is effectively a linear scale until you set a different exponent.) + */ + exponent(): number; + /** + * Sets the current exponent to the given numeric value. + * (Note that this is effectively a linear scale until you set a different exponent.) + */ + exponent(exponent: number): this; + + /** + * Returns the current unknown value, which defaults to undefined. + */ + unknown(): UnknownReturnType; + /** + * Sets the output value of the scale for undefined (or NaN) input values and returns this scale. + * + * @param value The output value of the scale for undefined (or NaN) input values. + */ + unknown(value: NewUnknown): ScalePower; +} + +/** + * Constructs a new continuous scale with the specified range, the exponent 1, the default interpolator and clamping disabled. + * The domain defaults to [0, 1]. + * If range is not specified, it defaults to [0, 1]. + * (Note that this is effectively a linear scale until you set a different exponent.) + * + * The first generic corresponds to the data type of the range elements. + * The second generic corresponds to the data type of the output elements generated by the scale. + * The third generic corresponds to the data type of the unknown value. + * + * If range element and output element type differ, the interpolator factory used with the scale must match this behavior and + * convert the interpolated range element to a corresponding output element. + * + * The range must be set in accordance with the range element type. + * + * The interpolator factory may be set using the interpolate(...) method of the scale. + * + * @param range Array of range values. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scalePow( + range?: Iterable, +): ScalePower; +/** + * Constructs a new continuous scale with the specified domain and range, the exponent 1, the default interpolator and clamping disabled. + * (Note that this is effectively a linear scale until you set a different exponent.) + * + * The first generic corresponds to the data type of the range elements. + * The second generic corresponds to the data type of the output elements generated by the scale. + * The third generic corresponds to the data type of the unknown value. + * + * If range element and output element type differ, the interpolator factory used with the scale must match this behavior and + * convert the interpolated range element to a corresponding output element. + * + * The range must be set in accordance with the range element type. + * + * The interpolator factory may be set using the interpolate(...) method of the scale. + * + * @param domain Array of numeric domain values. + * @param range Array of range values. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scalePow( + domain: Iterable, + range: Iterable, +): ScalePower; + +/** + * Constructs a new continuous power scale with the specified range, the exponent 0.5, the default interpolator and clamping disabled. + * The domain defaults to [0, 1]. + * If range is not specified, it defaults to [0, 1]. + * This is a convenience method equivalent to d3.scalePow().exponent(0.5). + * + * The first generic corresponds to the data type of the range elements. + * The second generic corresponds to the data type of the output elements generated by the scale. + * The third generic corresponds to the data type of the unknown value. + * + * If range element and output element type differ, the interpolator factory used with the scale must match this behavior and + * convert the interpolated range element to a corresponding output element. + * + * The range must be set in accordance with the range element type. + * + * The interpolator factory may be set using the interpolate(...) method of the scale. + * + * @param range Array of range values. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleSqrt( + range?: Iterable, +): ScalePower; +/** + * Constructs a new continuous power scale with the specified domain and range, the exponent 0.5, the default interpolator and clamping disabled. + * This is a convenience method equivalent to d3.scalePow().exponent(0.5). + * + * The first generic corresponds to the data type of the range elements. + * The second generic corresponds to the data type of the output elements generated by the scale. + * The third generic corresponds to the data type of the unknown value. + * + * If range element and output element type differ, the interpolator factory used with the scale must match this behavior and + * convert the interpolated range element to a corresponding output element. + * + * The range must be set in accordance with the range element type. + * + * The interpolator factory may be set using the interpolate(...) method of the scale. + * + * @param domain Array of numeric domain values. + * @param range Array of range values. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleSqrt( + domain: Iterable, + range: Iterable, +): ScalePower; + +// ------------------------------------------------------------------------------- +// Logarithmic Scale Factory +// ------------------------------------------------------------------------------- + +/** + * A continuous logarithmic scale defined over a numeric domain. + * + * Continuous scales map a continuous, quantitative input domain to a continuous output range. + * + * The mapping to the range value y can be expressed as a function of the domain value x: y = m log(x) + b. + * + * As log(0) = -∞, a log scale domain must be strictly-positive or strictly-negative; the domain must not include or cross zero. + * A log scale with a positive domain has a well-defined behavior for positive values, and a log scale with a negative domain has a well-defined behavior for negative values. + * (For a negative domain, input and output values are implicitly multiplied by -1.) + * The behavior of the scale is undefined if you pass a negative value to a log scale with a positive domain or vice versa. + * + * If the range is also numeric, the mapping may be inverted. + * + * Note that the data types of the range and output of the scale must be compatible with the interpolator applied by the scale. + * + * The first generic corresponds to the data type of the range elements. + * + * The second generic corresponds to the data type of the output elements generated by the scale. + * + * The third generic corresponds to the data type of the unknown value. + * + * If range element and output element type differ, the interpolator factory used with the scale must match this behavior and + * convert the interpolated range element to a corresponding output element. + */ +export interface ScaleLogarithmic + extends ScaleContinuousNumeric +{ + /** + * Returns a copy of the scale’s current domain. + */ + domain(): number[]; + /** + * Sets the scale’s domain to the specified array of numbers. The array must contain two or more elements. + * If the elements in the given array are not numbers, they will be coerced to numbers + * + * As log(0) = -∞, a log scale domain must be strictly-positive or strictly-negative; the domain must not include or cross zero. + * A log scale with a positive domain has a well-defined behavior for positive values, and a log scale with a negative domain has a well-defined behavior for negative values. + * (For a negative domain, input and output values are implicitly multiplied by -1.) + * The behavior of the scale is undefined if you pass a negative value to a log scale with a positive domain or vice versa. + * + * Although continuous scales typically have two values each in their domain and range, specifying more than two values produces a piecewise scale. + * + * Internally, a piecewise scale performs a binary search for the range interpolator corresponding to the given domain value. + * Thus, the domain must be in ascending or descending order. If the domain and range have different lengths N and M, only the first min(N,M) elements in each are observed. + * + * @param domain Array of numeric domain values. + */ + domain(domain: Iterable): this; + + /** + * Returns the scale’s current interpolator factory, which defaults to interpolate. + */ + interpolate(): InterpolatorFactory; + + /** + * Sets the scale’s range interpolator factory. This interpolator factory is used to create interpolators for each adjacent pair of values from the range; + * these interpolators then map a normalized domain parameter t in [0, 1] to the corresponding value in the range. + * + * Note: the default interpolator may reuse return values. For example, if the range values are objects, then the value interpolator always returns the same object, modifying it in-place. + * If the scale is used to set an attribute or style, this is typically acceptable (and desirable for performance); + * however, if you need to store the scale’s return value, you must specify your own interpolator or make a copy as appropriate. + * + * As part of the interpolation process the interpolated value from the range may be converted to a corresponding output value. + * + * @param interpolate An interpolation factory. The generics for Range and Output of the scale must correspond to the interpolation factory applied to the scale. + */ + interpolate(interpolate: InterpolatorFactory): this; + /** + * Sets the scale’s range interpolator factory. This interpolator factory is used to create interpolators for each adjacent pair of values from the range; + * these interpolators then map a normalized domain parameter t in [0, 1] to the corresponding value in the range. + * + * Note: the default interpolator may reuse return values. For example, if the range values are objects, then the value interpolator always returns the same object, modifying it in-place. + * If the scale is used to set an attribute or style, this is typically acceptable (and desirable for performance); + * however, if you need to store the scale’s return value, you must specify your own interpolator or make a copy as appropriate. + * + * As part of the interpolation process the interpolated value from the range may be converted to a corresponding output value. + * + * The generic "NewOutput" can be used to change the scale to have a different output element type corresponding to the new interpolation factory. + * + * @param interpolate An interpolation factory. The generics for Range and Output of the scale must correspond to the interpolation factory applied to the scale. + */ + interpolate( + interpolate: InterpolatorFactory, + ): ScaleLogarithmic; + + /** + * Returns approximately count representative values from the scale’s domain. + * + * If count is not specified, it defaults to 10. + * + * If the base is an integer, the returned ticks are uniformly spaced within each integer power of base; otherwise, one tick per power of base is returned. + * The returned ticks are guaranteed to be within the extent of the domain. If the orders of magnitude in the domain is greater than count, then at most one tick per power is returned. + * Otherwise, the tick values are unfiltered, but note that you can use log.tickFormat to filter the display of tick labels. + * + * @param count Optional approximate number of ticks to be returned. If count is not specified, it defaults to 10. + */ + ticks(count?: number): number[]; + + /** + * Returns a number format function suitable for displaying a tick value, automatically computing the appropriate precision based on the fixed interval between tick values. + * + * The specified count typically has the same value as the count that is used to generate the tick values. + * If there are too many ticks, the formatter may return the empty string for some of the tick labels; + * however, note that the ticks are still shown. + * To disable filtering, specify a count of Infinity. When specifying a count, you may also provide a format specifier or format function. + * For example, to get a tick formatter that will display 20 ticks of a currency, say log.tickFormat(20, "$,f"). + * If the specifier does not have a defined precision, the precision will be set automatically by the scale, returning the appropriate format. + * This provides a convenient way of specifying a format whose precision will be automatically set by the scale. + * + * @param count Approximate number of ticks to be used when calculating precision for the number format function. + * @param specifier An optional valid format specifier string which allows a custom format where the precision of the format is automatically set by the scale as appropriate for the tick interval. + * For example, to get a tick formatter that will display 20 ticks of a currency, say log.tickFormat(20, "$,f"). + * If the specifier does not have a defined precision, the precision will be set automatically by the scale, returning the appropriate format. + * This provides a convenient way of specifying a format whose precision will be automatically set by the scale. + */ + tickFormat(count?: number, specifier?: string): (d: NumberValue) => string; + + /** + * Extends the domain to integer powers of base. For example, for a domain of [0.201479…, 0.996679…], and base 10, the nice domain is [0.1, 1]. + * If the domain has more than two values, nicing the domain only affects the first and last value. + * + * Nicing a scale only modifies the current domain; it does not automatically nice domains that are subsequently set using continuous.domain. + * You must re-nice the scale after setting the new domain, if desired. + */ + nice(): this; + + /** + * Returns the current base, which defaults to 10. + */ + base(): number; + /** + * Sets the base for this logarithmic scale to the specified value. + */ + base(base: number): this; + + /** + * Returns the current unknown value, which defaults to undefined. + */ + unknown(): UnknownReturnType; + /** + * Sets the output value of the scale for undefined (or NaN) input values and returns this scale. + * + * @param value The output value of the scale for undefined (or NaN) input values. + */ + unknown(value: NewUnknown): ScaleLogarithmic; +} + +/** + * Constructs a new continuous scale with the specified range, the base 10, the default interpolator and clamping disabled. + * The domain defaults to [1, 10]. + * If range is not specified, it defaults to [0, 1]. + * + * The first generic corresponds to the data type of the range elements. + * The second generic corresponds to the data type of the output elements generated by the scale. + * The third generic corresponds to the data type of the unknown value. + * + * If range element and output element type differ, the interpolator factory used with the scale must match this behavior and + * convert the interpolated range element to a corresponding output element. + * + * The range must be set in accordance with the range element type. + * + * The interpolator factory may be set using the interpolate(...) method of the scale. + * + * @param range Array of range values. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleLog( + range?: Iterable, +): ScaleLogarithmic; +/** + * Constructs a new continuous scale with the specified domain and range, the base 10, the default interpolator and clamping disabled. + * + * The first generic corresponds to the data type of the range elements. + * The second generic corresponds to the data type of the output elements generated by the scale. + * The third generic corresponds to the data type of the unknown value. + * + * If range element and output element type differ, the interpolator factory used with the scale must match this behavior and + * convert the interpolated range element to a corresponding output element. + * + * The range must be set in accordance with the range element type. + * + * The interpolator factory may be set using the interpolate(...) method of the scale. + * + * @param domain Array of numeric domain values. + * @param range Array of range values. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleLog( + domain: Iterable, + range: Iterable, +): ScaleLogarithmic; + +// ------------------------------------------------------------------------------- +// Symlog Scale Factory +// ------------------------------------------------------------------------------- + +/** + * A bi-symmetric log transformation for wide-range data by Webber scale defined over a numeric domain. + * + * Continuous scales map a continuous, quantitative input domain to a continuous output range. + * + * See “A bi-symmetric log transformation for wide-range data” by Webber for more + * + * If the range is also numeric, the mapping may be inverted. + * + * Note that the data types of the range and output of the scale must be compatible with the interpolator applied by the scale. + * + * The first generic corresponds to the data type of the range elements. + * + * The second generic corresponds to the data type of the output elements generated by the scale. + * + * The third generic corresponds to the data type of the unknown value. + * + * If range element and output element type differ, the interpolator factory used with the scale must match this behavior and + * convert the interpolated range element to a corresponding output element. + */ +export interface ScaleSymLog extends ScaleContinuousNumeric { + /** + * Returns a number format function suitable for displaying a tick value, automatically computing the appropriate precision based on the fixed interval between tick values. + * + * The specified count typically has the same value as the count that is used to generate the tick values. + * If there are too many ticks, the formatter may return the empty string for some of the tick labels; + * however, note that the ticks are still shown. + * To disable filtering, specify a count of Infinity. When specifying a count, you may also provide a format specifier or format function. + * For example, to get a tick formatter that will display 20 ticks of a currency, say log.tickFormat(20, "$,f"). + * If the specifier does not have a defined precision, the precision will be set automatically by the scale, returning the appropriate format. + * This provides a convenient way of specifying a format whose precision will be automatically set by the scale. + * + * @param count Approximate number of ticks to be used when calculating precision for the number format function. + * @param specifier An optional valid format specifier string which allows a custom format where the precision of the format is automatically set by the scale as appropriate for the tick interval. + * For example, to get a tick formatter that will display 20 ticks of a currency, say log.tickFormat(20, "$,f"). + * If the specifier does not have a defined precision, the precision will be set automatically by the scale, returning the appropriate format. + * This provides a convenient way of specifying a format whose precision will be automatically set by the scale. + */ + tickFormat(count?: number, specifier?: string): (d: NumberValue) => string; + /** + * Returns the current constant, which defaults to 1. + */ + constant(): number; + /** + * Sets the symlog constant to the specified number and returns this scale; + * otherwise returns the current value of the symlog constant, which defaults to 1. See “A bi-symmetric log transformation for wide-range data” by Webber for more. + */ + constant(constant: number): this; + + /** + * Returns the current unknown value, which defaults to undefined. + */ + unknown(): UnknownReturnType; + /** + * Sets the output value of the scale for undefined (or NaN) input values and returns this scale. + * + * @param value The output value of the scale for undefined (or NaN) input values. + */ + unknown(value: NewUnknown): ScaleSymLog; +} + +/** + * Constructs a new continuous scale with the specified range, the constant 1, the default interpolator and clamping disabled. + * The domain defaults to [0, 1]. + * If range is not specified, it defaults to [0, 1]. + * + * The first generic corresponds to the data type of the range elements. + * The second generic corresponds to the data type of the output elements generated by the scale. + * The third generic corresponds to the data type of the unknown value. + * + * If range element and output element type differ, the interpolator factory used with the scale must match this behavior and + * convert the interpolated range element to a corresponding output element. + * + * The range must be set in accordance with the range element type. + * + * The interpolator factory may be set using the interpolate(...) method of the scale. + * + * @param range Array of range values. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleSymlog( + range?: Iterable, +): ScaleSymLog; +/** + * Constructs a new continuous scale with the specified domain and range, the constant 1, the default interpolator and clamping disabled. + * + * The first generic corresponds to the data type of the range elements. + * The second generic corresponds to the data type of the output elements generated by the scale. + * The third generic corresponds to the data type of the unknown value. + * + * If range element and output element type differ, the interpolator factory used with the scale must match this behavior and + * convert the interpolated range element to a corresponding output element. + * + * The range must be set in accordance with the range element type. + * + * The interpolator factory may be set using the interpolate(...) method of the scale. + * + * @param domain Array of numeric domain values. + * @param range Array of range values. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleSymlog( + domain: Iterable, + range: Iterable, +): ScaleSymLog; + +// ------------------------------------------------------------------------------- +// Identity Scale Factory +// ------------------------------------------------------------------------------- + +/** + * Identity scales are a special case of linear scales where the domain and range are identical; the scale and its invert method are thus the identity function. + * These scales are occasionally useful when working with pixel coordinates, say in conjunction with an axis. + * + * The generic corresponds to the data type of the unknown value. + */ +export interface ScaleIdentity { + /** + * Given a value from the domain, returns the corresponding value from the range, subject to interpolation, if any. + * + * If the given value is outside the domain, and clamping is not enabled, the mapping may be extrapolated such that the returned value is outside the range. + * + * Note: The interpolation function applied by the scale may change the output type from the range type as part of the interpolation. + * + * @param value A numeric value from the domain. + */ + (value: NumberValue): number | Unknown; + + /** + * Given a value from the range, returns the corresponding value from the domain. Inversion is useful for interaction, + * say to determine the data value corresponding to the position of the mouse. + * + * If the given value is outside the range, and clamping is not enabled, the mapping may be extrapolated such that the returned value is outside the domain. + * + * IMPORTANT: This method is only supported if the range is numeric. If the range is not numeric, returns NaN. + * + * For a valid value y in the range, continuous(continuous.invert(y)) approximately equals y; + * similarly, for a valid value x in the domain, continuous.invert(continuous(x)) approximately equals x. + * The scale and its inverse may not be exact due to the limitations of floating point precision. + * + * @param value A numeric value from the range. + */ + invert(value: NumberValue): number; + + /** + * Returns a copy of the scale’s current domain. + */ + domain(): number[]; + /** + * Sets the scale’s domain to the specified array of numbers. The array must contain two or more elements. + * If the elements in the given array are not numbers, they will be coerced to numbers + * + * Although continuous scales typically have two values each in their domain and range, specifying more than two values produces a piecewise scale. + * + * Internally, a piecewise scale performs a binary search for the range interpolator corresponding to the given domain value. + * Thus, the domain must be in ascending or descending order. If the domain and range have different lengths N and M, only the first min(N,M) elements in each are observed. + * + * @param domain Array of numeric domain values. + */ + domain(domain: Iterable): this; + + /** + * Returns a copy of the scale’s current range. + */ + range(): number[]; + /** + * Sets the scale’s range to the specified array of values. + * + * The array must contain two or more elements. Unlike the domain, elements in the given array need not be numbers; + * any value that is supported by the underlying interpolator will work, though note that numeric ranges are required for invert. + * + * @param range Array of range values. + */ + range(range: Iterable): this; + + /** + * Returns approximately count representative values from the scale’s domain. + * + * If count is not specified, it defaults to 10. + * + * The returned tick values are uniformly spaced, have human-readable values (such as multiples of powers of 10), + * and are guaranteed to be within the extent of the domain. Ticks are often used to display reference lines, or tick marks, in conjunction with the visualized data. + * The specified count is only a hint; the scale may return more or fewer values depending on the domain. See also d3-array’s ticks. + * + * @param count Optional approximate number of ticks to be returned. If count is not specified, it defaults to 10. + */ + ticks(count?: number): number[]; + + /** + * Returns a number format function suitable for displaying a tick value, automatically computing the appropriate precision based on the fixed interval between tick values. + * The specified count should have the same value as the count that is used to generate the tick values. + * + * @param count Approximate number of ticks to be used when calculating precision for the number format function. + * @param specifier An optional valid format specifier string which allows a custom format where the precision of the format is automatically set by the scale as appropriate for the tick interval. + * If specifier uses the format type "s", the scale will return a SI-prefix format based on the largest value in the domain. + * If the specifier already specifies a precision, this method is equivalent to locale.format. + */ + tickFormat(count?: number, specifier?: string): (d: NumberValue) => string; + + /** + * Extends the domain so that it starts and ends on nice round values. + * This method typically modifies the scale’s domain, and may only extend the bounds to the nearest round value. + * An optional tick count argument allows greater control over the step size used to extend the bounds, + * guaranteeing that the returned ticks will exactly cover the domain. + * Nicing is useful if the domain is computed from data, say using extent, and may be irregular. + * For example, for a domain of [0.201479…, 0.996679…], a nice domain might be [0.2, 1.0]. + * If the domain has more than two values, nicing the domain only affects the first and last value. + * + * Nicing a scale only modifies the current domain; it does not automatically nice domains that are subsequently set using continuous.domain. + * You must re-nice the scale after setting the new domain, if desired. + * + * @param count An optional number of ticks expected to be used. + */ + nice(count?: number): this; + + /** + * Returns an exact copy of this scale. Changes to this scale will not affect the returned scale, and vice versa. + */ + copy(): this; + + /** + * Returns the current unknown value, which defaults to undefined. + */ + unknown(): UnknownReturnType; + /** + * Sets the output value of the scale for undefined (or NaN) input values and returns this scale. + * + * @param value The output value of the scale for undefined (or NaN) input values. + */ + unknown(value: NewUnknown): ScaleIdentity; +} + +/** + * Constructs a new identity scale with the specified domain and range. + * If range is not specified, it defaults to [0, 1]. + * + * The generic corresponds to the data type of the unknown value. + * + * @param range Array of range values. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleIdentity(range?: Iterable): ScaleIdentity; + +// ------------------------------------------------------------------------------- +// Radial Scale Factory +// ------------------------------------------------------------------------------- + +export interface ScaleRadial extends ScaleContinuousNumeric { + /** + * Returns the current unknown value, which defaults to undefined. + */ + unknown(): UnknownReturnType; + /** + * Sets the output value of the scale for undefined (or NaN) input values and returns this scale. + * + * @param value The output value of the scale for undefined (or NaN) input values. + */ + unknown(value: NewUnknown): ScaleRadial; +} + +/** + * Constructs a new radial scale with the specified range. + * The domain defaults to [0, 1]. + * + * The first generic corresponds to the data type of the range elements. + * The second generic corresponds to the data type of the unknown value. + * + * The range must be set in accordance with the range element type. + * + * @param range Iterable of range values. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleRadial( + range?: Iterable, +): ScaleRadial; +/** + * Constructs a new radial scale with the specified domain and range. + * + * The first generic corresponds to the data type of the range elements. + * The second generic corresponds to the data type of the unknown value. + * + * The range must be set in accordance with the range element type. + * + * @param domain Iterable of numeric domain values. + * @param range Iterable of range values. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleRadial( + domain: Iterable, + range: Iterable, +): ScaleRadial; + +// ------------------------------------------------------------------------------- +// Time Scale Factories +// ------------------------------------------------------------------------------- + +/** + * A linear scale defined over a temporal domain. + * + * Time scales implement ticks based on calendar intervals, taking the pain out of generating axes for temporal domains. + * + * If the range is numeric, the mapping may be inverted to return a date. + * + * Note that the data types of the range and output of the scale must be compatible with the interpolator applied by the scale. + * + * The first generic corresponds to the data type of the range elements. + * + * The second generic corresponds to the data type of the output elements generated by the scale. + * + * The third generic corresponds to the data type of the unknown value. + * + * If range element and output element type differ, the interpolator factory used with the scale must match this behavior and + * convert the interpolated range element to a corresponding output element. + */ +export interface ScaleTime { + /** + * Given a value from the domain, returns the corresponding value from the range, subject to interpolation, if any. + * + * If the given value is outside the domain, and clamping is not enabled, the mapping may be extrapolated such that the returned value is outside the range. + * + * Note: The interpolation function applied by the scale may change the output type from the range type as part of the interpolation. + * + * @param value A temporal value from the domain. If the value is not a Date, it will be coerced to Date. + */ + (value: Date | NumberValue): Output | Unknown; + + /** + * Given a value from the range, returns the corresponding value from the domain. Inversion is useful for interaction, + * say to determine the data value corresponding to the position of the mouse. + * + * If the given value is outside the range, and clamping is not enabled, the mapping may be extrapolated such that the returned value is outside the domain. + * + * IMPORTANT: This method is only supported if the range is numeric. If the range is not numeric, returns Invalid Date. + * + * For a valid value y in the range, time(time.invert(y)) equals y; similarly, for a valid value x in the domain, time.invert(time(x)) equals x. + * The invert method is useful for interaction, say to determine the value in the domain that corresponds to the pixel location under the mouse. + * + * @param value A numeric value from the range. + */ + invert(value: NumberValue): Date; + + /** + * Returns a copy of the scale’s current domain. + */ + domain(): Date[]; + + /** + * Sets the scale’s domain to the specified array of temporal domain values. The array must contain two or more elements. + * If the elements in the given array are not dates, they will be coerced to dates. + * + * Although continuous scales typically have two values each in their domain and range, specifying more than two values produces a piecewise scale. + * + * Internally, a piecewise scale performs a binary search for the range interpolator corresponding to the given domain value. + * Thus, the domain must be in ascending or descending order. If the domain and range have different lengths N and M, only the first min(N,M) elements in each are observed. + * + * @param domain Array of temporal domain values. Numeric values will be coerced to dates. + */ + domain(domain: Iterable): this; + + /** + * Returns a copy of the scale’s current range. + */ + range(): Range[]; + /** + * Sets the scale’s range to the specified array of values. + * + * The array must contain two or more elements. Unlike the domain, elements in the given array need not be temporal domain values; + * any value that is supported by the underlying interpolator will work, though note that numeric ranges are required for invert. + * + * @param range Array of range values. + */ + range(range: Iterable): this; + + /** + * Sets the scale’s range to the specified array of values while also setting the scale’s interpolator to interpolateRound. + * + * The rounding interpolator is sometimes useful for avoiding antialiasing artifacts, + * though also consider the shape-rendering “crispEdges” styles. Note that this interpolator can only be used with numeric ranges. + * + * The array must contain two or more elements. Unlike the domain, elements in the given array need not be temporal domain values; + * any value that is supported by the underlying interpolator will work, though note that numeric ranges are required for invert. + * + * @param range Array of range values. + */ + rangeRound(range: Iterable): this; + + /** + * Returns whether or not the scale currently clamps values to within the range. + */ + clamp(): boolean; + /** + * Enables or disables clamping, respectively. If clamping is disabled and the scale is passed a value outside the domain, + * the scale may return a value outside the range through extrapolation. + * + * If clamping is enabled, the return value of the scale is always within the scale’s range. Clamping similarly applies to the "invert" method. + * + * @param clamp A flag to enable (true) or disable (false) clamping. + */ + clamp(clamp: boolean): this; + + /** + * Returns the scale’s current interpolator factory, which defaults to interpolate. + */ + interpolate(): InterpolatorFactory; + + /** + * Sets the scale’s range interpolator factory. This interpolator factory is used to create interpolators for each adjacent pair of values from the range; + * these interpolators then map a normalized domain parameter t in [0, 1] to the corresponding value in the range. + * + * Note: the default interpolator may reuse return values. For example, if the range values are objects, then the value interpolator always returns the same object, modifying it in-place. + * If the scale is used to set an attribute or style, this is typically acceptable (and desirable for performance); + * however, if you need to store the scale’s return value, you must specify your own interpolator or make a copy as appropriate. + * + * As part of the interpolation process the interpolated value from the range may be converted to a corresponding output value. + * + * @param interpolate An interpolation factory. The generics for Range and Output of the scale must correspond to the interpolation factory applied to the scale. + */ + interpolate(interpolate: InterpolatorFactory): this; + /** + * Sets the scale’s range interpolator factory. This interpolator factory is used to create interpolators for each adjacent pair of values from the range; + * these interpolators then map a normalized domain parameter t in [0, 1] to the corresponding value in the range. + * + * Note: the default interpolator may reuse return values. For example, if the range values are objects, then the value interpolator always returns the same object, modifying it in-place. + * If the scale is used to set an attribute or style, this is typically acceptable (and desirable for performance); + * however, if you need to store the scale’s return value, you must specify your own interpolator or make a copy as appropriate. + * + * As part of the interpolation process the interpolated value from the range may be converted to a corresponding output value. + * + * The generic "NewOutput" can be used to change the scale to have a different output element type corresponding to the new interpolation factory. + * + * @param interpolate An interpolation factory. The generics for Range and Output of the scale must correspond to the interpolation factory applied to the scale. + */ + interpolate(interpolate: InterpolatorFactory): ScaleTime; + + /** + * Returns representative dates from the scale’s domain. The returned tick values are uniformly-spaced (mostly), + * have sensible values (such as every day at midnight), and are guaranteed to be within the extent of the domain. + * Ticks are often used to display reference lines, or tick marks, in conjunction with the visualized data. + * + * An optional count may be specified to affect how many ticks are generated. If count is not specified, it defaults to 10. + * The specified count is only a hint; the scale may return more or fewer values depending on the domain. + * + * @param count Expected number of ticks. + */ + ticks(count?: number): Date[]; + /** + * Returns representative dates from the scale’s domain. The returned tick values are uniformly-spaced (mostly), + * have sensible values (such as every day at midnight), and are guaranteed to be within the extent of the domain. + * Ticks are often used to display reference lines, or tick marks, in conjunction with the visualized data. + * + * The specified time interval controls the ticks generated and returned. To prune the generated ticks for a given time interval, + * use interval.every(...) or interval.filter(...). + * + * @param interval A time interval to specify the expected ticks. + */ + ticks(interval: TimeInterval): Date[]; + + /** + * Returns a time format function suitable for displaying tick values. + * + * The default multi-scale time format chooses a human-readable representation based on the specified date as follows: + * + * - %Y - for year boundaries, such as 2011. + * - %B - for month boundaries, such as February. + * - %b %d - for week boundaries, such as Feb 06. + * - %a %d - for day boundaries, such as Mon 07. + * - %I %p - for hour boundaries, such as 01 AM. + * - %I:%M - for minute boundaries, such as 01:23. + * - :%S - for second boundaries, such as :45. + * - .%L - milliseconds for all other times, such as .012. + * + * Although somewhat unusual, this default behavior has the benefit of providing both local and global context: + * for example, formatting a sequence of ticks as [11 PM, Mon 07, 01 AM] reveals information about hours, dates, and day simultaneously, + * rather than just the hours [11 PM, 12 AM, 01 AM]. + * + * The specified count is currently ignored, but is accepted for consistency with other scales such as continuous.tickFormat. + * + * @param count Expected number of ticks. (Currently ignored) + * @param specifier An optional valid date format specifier string (see d3-time-format). + */ + tickFormat(count?: number, specifier?: string): (d: Date) => string; + /** + * Returns a time format function suitable for displaying tick values. + * + * The specified time interval is currently ignored, but is accepted for consistency with other scales such as continuous.tickFormat. + * + * @param interval A time interval to specify the expected ticks. (Currently ignored) + * @param specifier An optional valid date format specifier string (see d3-time-format). + */ + tickFormat(interval: TimeInterval, specifier?: string): (d: Date) => string; + + /** + * Extends the domain so that it starts and ends on nice round values. + * This method typically modifies the scale’s domain, and may only extend the bounds to the nearest round value. + * + * An optional count argument allows greater control over the step size used to extend the bounds, guaranteeing that the returned ticks will exactly cover the domain. + * + * Nicing is useful if the domain is computed from data, say using extent, and may be irregular. + * For example, for a domain of [2009-07-13T00:02, 2009-07-13T23:48], the nice domain is [2009-07-13, 2009-07-14]. + * If the domain has more than two values, nicing the domain only affects the first and last value. + * + * @param count Expected number of ticks. + */ + nice(count?: number): this; + /** + * Extends the domain so that it starts and ends on nice round values. + * This method typically modifies the scale’s domain, and may only extend the bounds to the nearest round value. + * + * A time interval may be specified to explicitly set the ticks. + * If an interval is specified, an optional step may also be specified to skip some ticks. + * For example, time.nice(d3.timeSecond.every(10)) will extend the domain to an even ten seconds (0, 10, 20, etc.). + * See time.ticks and interval.every for further detail. + * + * Nicing is useful if the domain is computed from data, say using extent, and may be irregular. + * For example, for a domain of [2009-07-13T00:02, 2009-07-13T23:48], the nice domain is [2009-07-13, 2009-07-14]. + * If the domain has more than two values, nicing the domain only affects the first and last value. + * + * @param interval A time interval to specify the expected ticks. + */ + nice(interval: CountableTimeInterval): this; + + /** + * Returns an exact copy of this scale. Changes to this scale will not affect the returned scale, and vice versa. + */ + copy(): this; + + /** + * Returns the current unknown value, which defaults to undefined. + */ + unknown(): UnknownReturnType; + /** + * Sets the output value of the scale for undefined (or NaN) input values and returns this scale. + * + * @param value The output value of the scale for undefined (or NaN) input values. + */ + unknown(value: NewUnknown): ScaleTime; +} + +/** + * Constructs a new time scale with the specified range, the default interpolator and clamping disabled. + * The domain defaults to [2000-01-01, 2000-01-02]. + * If range is not specified, it defaults to [0, 1]. + * + * The first generic corresponds to the data type of the range elements. + * The second generic corresponds to the data type of the output elements generated by the scale. + * The third generic corresponds to the data type of the unknown value. + * + * If range element and output element type differ, the interpolator factory used with the scale must match this behavior and + * convert the interpolated range element to a corresponding output element. + * + * The range must be set in accordance with the range element type. + * + * The interpolator factory may be set using the interpolate(...) method of the scale. + * + * @param range Array of range values. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleTime( + range?: Iterable, +): ScaleTime; +/** + * Constructs a new time scale with the specified domain and range, the default interpolator and clamping disabled. + * + * The first generic corresponds to the data type of the range elements. + * The second generic corresponds to the data type of the output elements generated by the scale. + * The third generic corresponds to the data type of the unknown value. + * + * If range element and output element type differ, the interpolator factory used with the scale must match this behavior and + * convert the interpolated range element to a corresponding output element. + * + * The range must be set in accordance with the range element type. + * + * The interpolator factory may be set using the interpolate(...) method of the scale. + * + * @param domain Array of temporal domain values. Numeric values will be coerced to dates. + * @param range Array of range values. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleTime( + domain: Iterable, + range: Iterable, +): ScaleTime; + +/** + * Constructs a new time scale using Coordinated Universal Time (UTC) with the specified range, the default interpolator and clamping disabled. + * The domain defaults to [2000-01-01, 2000-01-02]. + * If range is not specified, it defaults to [0, 1]. + * + * The first generic corresponds to the data type of the range elements. + * The second generic corresponds to the data type of the output elements generated by the scale. + * The third generic corresponds to the data type of the unknown value. + * + * If range element and output element type differ, the interpolator factory used with the scale must match this behavior and + * convert the interpolated range element to a corresponding output element. + * + * The range must be set in accordance with the range element type. + * + * The interpolator factory may be set using the interpolate(...) method of the scale. + * + * @param range Array of range values. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleUtc( + range?: Iterable, +): ScaleTime; +/** + * Constructs a new time scale using Coordinated Universal Time (UTC) with the specified domain and range, the default interpolator and clamping disabled. + * + * The first generic corresponds to the data type of the range elements. + * The second generic corresponds to the data type of the output elements generated by the scale. + * The third generic corresponds to the data type of the unknown value. + * + * If range element and output element type differ, the interpolator factory used with the scale must match this behavior and + * convert the interpolated range element to a corresponding output element. + * + * The range must be set in accordance with the range element type. + * + * The interpolator factory may be set using the interpolate(...) method of the scale. + * + * @param domain Array of temporal domain values. Numeric values will be coerced to dates. + * @param range Array of range values. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleUtc( + domain: Iterable, + range: Iterable, +): ScaleTime; + +// ------------------------------------------------------------------------------- +// Sequential Scale Factory +// ------------------------------------------------------------------------------- + +/** + * Sequential scales are similar to continuous scales in that they map a continuous, numeric input domain to a continuous output range. + * However, unlike continuous scales, the input domain and output range of a sequential scale always has exactly two elements, + * and the output range is typically specified as an interpolator rather than an array of values. + * These scales do not expose invert and interpolate methods. + * + * The first generic corresponds to the data type of the output of the interpolator underlying the scale. + * + * The second generic corresponds to the data type of the unknown value. + */ +export interface ScaleSequentialBase { + /** + * Given a value from the domain, returns the corresponding value from the output range, subject to interpolation. + * + * If the given value is outside the domain, and clamping is not enabled, the mapping may be extrapolated such that the returned value is outside the range. + * + * @param value A numeric value from the domain. + */ + (value: NumberValue): Output | Unknown; + + /** + * Returns a copy of the scale’s current domain. + */ + domain(): [number, number]; + /** + * Sets the scale’s domain to the specified array of numbers. The array must contain exactly two elements. + * If the elements in the given array are not numbers, they will be coerced to numbers + * + * @param domain A two-element array of numeric domain values. + */ + domain(domain: Iterable): this; + + /** + * Returns whether or not the scale currently clamps values to within the range. + */ + clamp(): boolean; + /** + * Enables or disables clamping, respectively. If clamping is disabled and the scale is passed a value outside the domain, + * the scale may return a value outside the range through extrapolation. + * + * If clamping is enabled, the return value of the scale is always within the scale’s range. Clamping similarly applies to the "invert" method. + * + * @param clamp A flag to enable (true) or disable (false) clamping. + */ + clamp(clamp: boolean): this; + + /** + * See continuous.range. + */ + range(): [Output, Output]; + /** + * See continuous.range. + * The given two-element array is converted to an interpolator function using d3.interpolate. + * + * @param range Range values. + */ + range(range: Iterable): this; + + /** + * See continuous.rangeRound. + * If range is specified, implicitly uses d3.interpolateRound as the interpolator. + * + * @param range Range values. + */ + rangeRound(range: Iterable): this; + + /** + * Returns an exact copy of this scale. Changes to this scale will not affect the returned scale, and vice versa. + */ + copy(): this; +} + +export interface ScaleSequential extends ScaleSequentialBase { + /** + * Returns the current interpolator underlying the scale. + */ + interpolator(): (t: number) => Output; + /** + * Sets the scale’s interpolator to the specified function. + * + * @param interpolator An interpolator function mapping a value from the [0, 1] interval to an output value. + */ + interpolator(interpolator: (t: number) => Output): this; + /** + * Sets the scale’s interpolator to the specified function. + * + * The generic corresponds to a the new output type of the scale. The output type of the scale is determined by the output type of the interpolator function. + * + * @param interpolator An interpolator function mapping a value from the [0, 1] interval to an output value. + */ + interpolator(interpolator: (t: number) => NewOutput): ScaleSequential; + + /** + * Returns the current unknown value, which defaults to undefined. + */ + unknown(): UnknownReturnType; + /** + * Sets the output value of the scale for undefined (or NaN) input values and returns this scale. + * + * @param value The output value of the scale for undefined (or NaN) input values. + */ + unknown(value: NewUnknown): ScaleSequential; +} + +/** + * Constructs a new sequential scale with the specified interpolator function or array. + * The domain defaults to [0, 1]. + * If interpolator is not specified, it defaults to the identity function. + * When the scale is applied, the interpolator will be invoked with a value typically in the range [0, 1], where 0 represents the minimum value and 1 represents the maximum value. + * + * If interpolator is an array, it represents the scale’s two-element output range and is converted to an interpolator function using d3.interpolate. + * + * The first generic corresponds to the data type of the output of the interpolator underlying the scale. + * The second generic corresponds to the data type of the unknown value. + * + * @param interpolator The interpolator function or array to be used with the scale. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleSequential( + interpolator?: ((t: number) => Output) | Iterable, +): ScaleSequential; +/** + * Constructs a new sequential scale with the specified domain and interpolator function or array. + * When the scale is applied, the interpolator will be invoked with a value typically in the range [0, 1], where 0 represents the minimum value and 1 represents the maximum value. + * + * If interpolator is an array, it represents the scale’s two-element output range and is converted to an interpolator function using d3.interpolate. + * + * The first generic corresponds to the data type of the output of the interpolator underlying the scale. + * The second generic corresponds to the data type of the unknown value. + * + * @param domain A two-element array of numeric domain values. + * @param interpolator The interpolator function or array to be used with the scale. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleSequential( + domain: Iterable, + interpolator: ((t: number) => Output) | Iterable, +): ScaleSequential; + +/** + * A sequential scale with a logarithmic transform, analogous to a log scale. + * + * The first generic corresponds to the data type of the output of the interpolator underlying the scale. + * The second generic corresponds to the data type of the unknown value. + * + * @param interpolator The interpolator function to be used with the scale. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleSequentialLog( + interpolator?: (t: number) => Output, +): ScaleSequential; +/** + * A sequential scale with a logarithmic transform, analogous to a log scale. + * + * The first generic corresponds to the data type of the output of the interpolator underlying the scale. + * The second generic corresponds to the data type of the unknown value. + * + * @param domain A two-element array of numeric domain values. + * @param interpolator The interpolator function to be used with the scale. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleSequentialLog( + domain: Iterable, + interpolator: (t: number) => Output, +): ScaleSequential; + +/** + * A sequential scale with a exponential transform, analogous to a power scale. + * + * The first generic corresponds to the data type of the output of the interpolator underlying the scale. + * The second generic corresponds to the data type of the unknown value. + * + * @param interpolator The interpolator function to be used with the scale. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleSequentialPow( + interpolator?: (t: number) => Output, +): ScaleSequential; +/** + * A sequential scale with a exponential transform, analogous to a power scale. + * + * The first generic corresponds to the data type of the output of the interpolator underlying the scale. + * The second generic corresponds to the data type of the unknown value. + * + * @param domain A two-element array of numeric domain values. + * @param interpolator The interpolator function to be used with the scale. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleSequentialPow( + domain: Iterable, + interpolator: (t: number) => Output, +): ScaleSequential; + +/** + * A sequential scale with a square-root transform, analogous to a d3.scaleSqrt. + * + * The first generic corresponds to the data type of the output of the interpolator underlying the scale. + * The second third generic corresponds to the data type of the unknown value. + * + * @param interpolator The interpolator function to be used with the scale. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleSequentialSqrt( + interpolator?: (t: number) => Output, +): ScaleSequential; +/** + * A sequential scale with a square-root transform, analogous to a d3.scaleSqrt. + * + * The first generic corresponds to the data type of the output of the interpolator underlying the scale. + * The second generic corresponds to the data type of the unknown value. + * + * @param domain A two-element array of numeric domain values. + * @param interpolator The interpolator function to be used with the scale. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleSequentialSqrt( + domain: Iterable, + interpolator: (t: number) => Output, +): ScaleSequential; + +/** + * A sequential scale with a symmetric logarithmic transform, analogous to a symlog scale. + * + * The first generic corresponds to the data type of the output of the interpolator underlying the scale. + * The second generic corresponds to the data type of the unknown value. + * + * @param interpolator The interpolator function to be used with the scale. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleSequentialSymlog( + interpolator?: (t: number) => Output, +): ScaleSequential; +/** + * A sequential scale with a symmetric logarithmic transform, analogous to a symlog scale. + * + * The first generic corresponds to the data type of the output of the interpolator underlying the scale. + * The second generic corresponds to the data type of the unknown value. + * + * @param domain A two-element array of numeric domain values. + * @param interpolator The interpolator function to be used with the scale. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleSequentialSymlog( + domain: Iterable, + interpolator: (t: number) => Output, +): ScaleSequential; + +export interface ScaleSequentialQuantile extends ScaleSequentialBase { + /** + * Returns an array of n + 1 quantiles. + * For example, if n = 4, returns an array of five numbers: the minimum value, the first quartile, the median, the third quartile, and the maximum. + */ + quantiles(): number[]; + + /** + * Returns the current interpolator underlying the scale. + */ + interpolator(): (t: number) => Output; + /** + * Sets the scale’s interpolator to the specified function. + * + * @param interpolator An interpolator function mapping a value from the [0, 1] interval to an output value. + */ + interpolator(interpolator: (t: number) => Output): this; + /** + * Sets the scale’s interpolator to the specified function. + * + * The generic corresponds to a the new output type of the scale. The output type of the scale is determined by the output type of the interpolator function. + * + * @param interpolator An interpolator function mapping a value from the [0, 1] interval to an output value. + */ + interpolator(interpolator: (t: number) => NewOutput): ScaleSequentialQuantile; + + /** + * Returns the current unknown value, which defaults to undefined. + */ + unknown(): UnknownReturnType; + /** + * Sets the output value of the scale for undefined (or NaN) input values and returns this scale. + * + * @param value The output value of the scale for undefined (or NaN) input values. + */ + unknown(value: NewUnknown): ScaleSequentialQuantile; +} + +/** + * A sequential scale using a p-quantile transform, analogous to a quantile scale. + * + * The first generic corresponds to the data type of the output of the interpolator underlying the scale. + * The second generic corresponds to the data type of the unknown value. + * + * @param interpolator The interpolator function to be used with the scale. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleSequentialQuantile( + interpolator?: (t: number) => Output, +): ScaleSequentialQuantile; +/** + * A sequential scale using a p-quantile transform, analogous to a quantile scale. + * + * The first generic corresponds to the data type of the output of the interpolator underlying the scale. + * The second generic corresponds to the data type of the unknown value. + * + * @param domain A two-element array of numeric domain values. + * @param interpolator The interpolator function to be used with the scale. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleSequentialQuantile( + domain: Iterable, + interpolator: (t: number) => Output, +): ScaleSequentialQuantile; + +// ------------------------------------------------------------------------------- +// Diverging Scale Factory +// ------------------------------------------------------------------------------- + +/** + * Diverging scales, like sequential scales, are similar to continuous scales in that they map a continuous, numeric input domain to a continuous output range. + * However, unlike continuous scales, the input domain and output range of a diverging scale always has exactly three elements, + * and the output range is typically specified as an interpolator rather than an array of values. + * These scales do not expose invert and interpolate methods. + * + * The first generic corresponds to the data type of the interpolator return type. + * + * The second generic corresponds to the data type of the unknown value. + */ +export interface ScaleDiverging { + /** + * Given a value from the domain, returns the corresponding value subject to interpolation. + * + * If the given value is outside the domain, and clamping is not enabled, the mapping may be extrapolated such that the returned value is outside the range. + * + * @param value A numeric value from the domain. + */ + (value: NumberValue): Output | Unknown; + + /** + * Returns a copy of the scale’s current domain. + */ + domain(): [number, number, number]; + /** + * Sets the scale’s domain to the specified array of numbers. + * The domain must be numeric and must contain exactly three values. The default domain is [0, 0.5, 1]. + * If the elements in the given array are not numbers, they will be coerced to numbers + * + * @param domain Array of three numeric domain values. + */ + domain(domain: Iterable): this; + + /** + * Returns whether or not the scale currently clamps values to within the range. + */ + clamp(): boolean; + /** + * Enables or disables clamping, respectively. If clamping is disabled and the scale is passed a value outside the domain, + * the scale may return a value outside the range through extrapolation. + * + * If clamping is enabled, the return value of the scale is always within the interpolator scale’s range. + * + * @param clamp A flag to enable (true) or disable (false) clamping. + */ + clamp(clamp: boolean): this; + + /** + * Returns the scale’s current interpolator. + */ + interpolator(): (t: number) => Output; + /** + * Sets the scale’s interpolator to the specified function. + * + * @param interpolator The scale’s interpolator. + */ + interpolator(interpolator?: (t: number) => Output): this; + + /** + * See continuous.range. + */ + range(): [Output, Output, Output]; + /** + * See continuous.range. + * The given two-element array is converted to an interpolator function using d3.interpolate and d3.piecewise. + * + * @param range Range values. + */ + range(range: Iterable): this; + + /** + * See continuous.rangeRound. + * If range is specified, implicitly uses d3.interpolateRound as the interpolator. + * + * @param range Range values. + */ + rangeRound(range: Iterable): this; + + /** + * Returns an exact copy of this scale. Changes to this scale will not affect the returned scale, and vice versa. + */ + copy(): this; + + /** + * Returns the current unknown value, which defaults to undefined. + */ + unknown(): UnknownReturnType; + /** + * Sets the output value of the scale for undefined (or NaN) input values and returns this scale. + * + * @param value The output value of the scale for undefined (or NaN) input values. + */ + unknown(value: NewUnknown): ScaleDiverging; +} + +/** + * Constructs a new diverging scale with the specified interpolator function or array. + * The domain defaults to [0, 0.5, 1]. + * If interpolator is not specified, it defaults to the identity function. + * When the scale is applied, the interpolator will be invoked with a value typically in the range [0, 1], + * where 0 represents the extreme negative value, 0.5 represents the neutral value, and 1 represents the extreme positive value. + * + * If interpolator is an array, it represents the scale’s three-element output range and is converted to an interpolator function using d3.interpolate and d3.piecewise. + * + * The first generic corresponds to the data type of the interpolator return type. + * The second generic corresponds to the data type of the unknown value. + * + * @param interpolator The scale’s interpolator function or array. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleDiverging( + interpolator?: ((t: number) => Output) | Iterable, +): ScaleDiverging; +/** + * Constructs a new diverging scale with the specified domain and interpolator function or array. + * When the scale is applied, the interpolator will be invoked with a value typically in the range [0, 1], + * where 0 represents the extreme negative value, 0.5 represents the neutral value, and 1 represents the extreme positive value. + * + * If interpolator is an array, it represents the scale’s three-element output range and is converted to an interpolator function using d3.interpolate and d3.piecewise. + * + * The first generic corresponds to the data type of the interpolator return type. + * The second generic corresponds to the data type of the unknown value. + * + * @param domain Array of three numeric domain values. + * @param interpolator The scale’s interpolator function or array. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleDiverging( + domain: Iterable, + interpolator: ((t: number) => Output) | Iterable, +): ScaleDiverging; + +/** + * A diverging scale with a logarithmic transform, analogous to a log scale. + * + * The first generic corresponds to the data type of the interpolator return type. + * The second generic corresponds to the data type of the unknown value. + * + * @param interpolator The scale’s interpolator. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleDivergingLog( + interpolator?: (t: number) => Output, +): ScaleDiverging; +/** + * A diverging scale with a logarithmic transform, analogous to a log scale. + * + * The first generic corresponds to the data type of the interpolator return type. + * The second generic corresponds to the data type of the unknown value. + * + * @param domain Array of three numeric domain values. + * @param interpolator The scale’s interpolator. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleDivergingLog( + domain: Iterable, + interpolator: (t: number) => Output, +): ScaleDiverging; + +/** + * A diverging scale with a exponential transform, analogous to a power scale. + * + * The first generic corresponds to the data type of the interpolator return type. + * The second generic corresponds to the data type of the unknown value. + * + * @param interpolator The scale’s interpolator. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleDivergingPow( + interpolator?: (t: number) => Output, +): ScaleDiverging; +/** + * A diverging scale with a exponential transform, analogous to a power scale. + * + * The first generic corresponds to the data type of the interpolator return type. + * The second generic corresponds to the data type of the unknown value. + * + * @param domain Array of three numeric domain values. + * @param interpolator The scale’s interpolator. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleDivergingPow( + domain: Iterable, + interpolator: (t: number) => Output, +): ScaleDiverging; + +/** + * A diverging scale with a square-root transform, analogous to a d3.scaleSqrt. + * + * The first generic corresponds to the data type of the interpolator return type. + * The second generic corresponds to the data type of the unknown value. + * + * @param interpolator The scale’s interpolator. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleDivergingSqrt( + interpolator?: (t: number) => Output, +): ScaleDiverging; +/** + * A diverging scale with a square-root transform, analogous to a d3.scaleSqrt. + * + * The first generic corresponds to the data type of the interpolator return type. + * The second generic corresponds to the data type of the unknown value. + * + * @param domain Array of three numeric domain values. + * @param interpolator The scale’s interpolator. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleDivergingSqrt( + domain: Iterable, + interpolator: (t: number) => Output, +): ScaleDiverging; + +/** + * A diverging scale with a symmetric logarithmic transform, analogous to a symlog scale. + * + * The first generic corresponds to the data type of the interpolator return type. + * The second generic corresponds to the data type of the unknown value. + * + * @param interpolator The scale’s interpolator. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleDivergingSymlog( + interpolator?: (t: number) => Output, +): ScaleDiverging; +/** + * A diverging scale with a symmetric logarithmic transform, analogous to a symlog scale. + * + * The first generic corresponds to the data type of the interpolator return type. + * The second generic corresponds to the data type of the unknown value. + * + * @param domain Array of three numeric domain values. + * @param interpolator The scale’s interpolator. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleDivergingSymlog( + domain: Iterable, + interpolator: (t: number) => Output, +): ScaleDiverging; + +// ------------------------------------------------------------------------------- +// Quantize Scale Factory +// ------------------------------------------------------------------------------- + +/** + * Quantize scales are similar to linear scales, except they use a discrete rather than continuous range. + * The continuous input domain is divided into uniform segments based on the number of values in (i.e., the cardinality of) the output range. + * + * Each range value y can be expressed as a quantized linear function of the domain value x: y = m round(x) + b. + * + * The first generic corresponds to the data type of the range elements. + * + * The second generic corresponds to the data type of the unknown value. + */ +export interface ScaleQuantize { + /** + * Given a value in the input domain, returns the corresponding value in the output range. + */ + (value: NumberValue): Range | Unknown; + /** + * Returns the extent of values in the domain [x0, x1] for the corresponding value in the range: the inverse of quantize. + * This method is useful for interaction, say to determine the value in the domain that corresponds to the pixel location under the mouse. + * + * If an invalid range value is entered, returns [NaN, NaN]. + * + * @param value A value from the range. + */ + invertExtent(value: Range): [number, number]; + + /** + * Returns the scale’s current domain. + */ + domain(): [number, number]; + + /** + * Sets the scale’s domain to the specified two-element array of numbers. + * If the elements in the given array are not numbers, they will be coerced to numbers. + * + * @param domain A two-element array of numeric values defining the domain. + */ + domain(domain: Iterable): this; + + /** + * Returns the scale’s current range. + */ + range(): Range[]; + /** + * Sets the scale’s range to the specified array of values. The array may contain any number of discrete values. + * + * @param range Array of range values. + */ + range(range: Iterable): this; + + /** + * Returns approximately count representative values from the scale’s domain. + * + * If count is not specified, it defaults to 10. + * + * The returned tick values are uniformly spaced, have human-readable values (such as multiples of powers of 10), + * and are guaranteed to be within the extent of the domain. Ticks are often used to display reference lines, or tick marks, in conjunction with the visualized data. + * The specified count is only a hint; the scale may return more or fewer values depending on the domain. See also d3-array’s ticks. + * + * @param count Optional approximate number of ticks to be returned. If count is not specified, it defaults to 10. + */ + ticks(count?: number): number[]; + + /** + * Returns a number format function suitable for displaying a tick value, automatically computing the appropriate precision based on the fixed interval between tick values. + * The specified count should have the same value as the count that is used to generate the tick values. + * + * @param count Approximate number of ticks to be used when calculating precision for the number format function. + * @param specifier An optional valid format specifier string which allows a custom format where the precision of the format is automatically set by the scale as appropriate for the tick interval. + * If specifier uses the format type "s", the scale will return a SI-prefix format based on the largest value in the domain. + * If the specifier already specifies a precision, this method is equivalent to locale.format. + */ + tickFormat(count?: number, specifier?: string): (d: NumberValue) => string; + + /** + * Extends the domain so that it starts and ends on nice round values. + * This method typically modifies the scale’s domain, and may only extend the bounds to the nearest round value. + * + * Nicing is useful if the domain is computed from data, say using extent, and may be irregular. + * For example, for a domain of [0.201479…, 0.996679…], a nice domain might be [0.2, 1.0]. + * + * Nicing a scale only modifies the current domain; it does not automatically nice domains that are subsequently set using continuous.domain. + * You must re-nice the scale after setting the new domain, if desired. + * + * @param count An optional number of ticks expected to be used. + */ + nice(count?: number): this; + + /** + * Returns the current unknown value, which defaults to undefined. + */ + unknown(): UnknownReturnType; + /** + * Sets the output value of the scale for undefined (or NaN) input values and returns this scale. + * + * @param value The output value of the scale for undefined (or NaN) input values. + */ + unknown(value: NewUnknown): ScaleQuantize; + + /** + * Returns the array of computed thresholds within the domain. + */ + thresholds(): number[]; + + /** + * Returns an exact copy of this scale. Changes to this scale will not affect the returned scale, and vice versa. + */ + copy(): this; +} + +/** + * Constructs a new quantize scale with the specified range. + * The domain defaults to [0, 1]. + * If range is not specified, it defaults to [0, 1]. + * Thus, the default quantize scale is equivalent to the Math.round function. + * + * The range must be set corresponding to the type of the range elements. + * + * The first generic corresponds to the data type of the range elements. + * The second generic corresponds to the data type of the unknown value. + * + * @param range Array of range values. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleQuantize(range?: Iterable): ScaleQuantize; +/** + * Constructs a new quantize scale with the specified domain and range. + * Thus, the default quantize scale is equivalent to the Math.round function. + * + * The range must be set corresponding to the type of the range elements. + * + * The first generic corresponds to the data type of the range elements. + * The second generic corresponds to the data type of the unknown value. + * + * @param domain A two-element array of numeric values defining the domain. + * @param range Array of range values. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleQuantize( + domain: Iterable, + range: Iterable, +): ScaleQuantize; + +// ------------------------------------------------------------------------------- +// Quantile Scale Factory +// ------------------------------------------------------------------------------- + +/** + * Quantile scales map a sampled input domain to a discrete range. + * The domain is considered continuous and thus the scale will accept any reasonable input value; + * however, the domain is specified as a discrete set of sample values. + * The number of values in (the cardinality of) the output range determines the number of quantiles that will be computed from the domain. + * To compute the quantiles, the domain is sorted, and treated as a population of discrete values; see d3-array’s quantile. + * + * The first generic corresponds to the data type of range elements. + * + * The second generic corresponds to the data type of the unknown value. + */ +export interface ScaleQuantile { + /** + * Given a value in the input domain, returns the corresponding value in the output range. + * + * @param value A numeric value in the input domain. + */ + (value: NumberValue): Range | Unknown; + + /** + * Returns the extent of values in the domain [x0, x1] for the corresponding value in the range: the inverse of quantile. + * This method is useful for interaction, say to determine the value in the domain that corresponds to the pixel location under the mouse. + * + * @param value A value from the range. + */ + invertExtent(value: Range): [number, number]; + + /** + * Returns the scale’s current domain. + */ + domain(): number[]; + /** + * Sets the domain of the quantile scale to the specified set of discrete numeric values. + * The array must not be empty, and must contain at least one numeric value; NaN, null and undefined values are ignored and not considered part of the sample population. + * + * If the elements in the given array are not numbers, they will be coerced to numbers. A copy of the input array is sorted and stored internally. + * + * @param domain Array of domain values. + */ + domain(domain: Iterable): this; + + /** + * Returns the current range. + */ + range(): Range[]; + /** + * Sets the discrete values in the range. The array must not be empty. + * The number of values in (the cardinality, or length, of) the range array determines the number of quantiles that are computed. + * + * For example, to compute quartiles, range must be an array of four elements such as [0, 1, 2, 3]. + * + * @param range Array of range values. + */ + range(range: Iterable): this; + + /** + * Returns the quantile thresholds. If the range contains n discrete values, the returned array will contain n - 1 thresholds. + * Values less than the first threshold are considered in the first quantile; + * values greater than or equal to the first threshold but less than the second threshold are in the second quantile, and so on. + * Internally, the thresholds array is used with bisect to find the output quantile associated with the given input value. + */ + quantiles(): number[]; + + /** + * Returns an exact copy of this scale. Changes to this scale will not affect the returned scale, and vice versa. + */ + copy(): this; + + /** + * Returns the current unknown value, which defaults to undefined. + */ + unknown(): UnknownReturnType; + /** + * Sets the output value of the scale for undefined (or NaN) input values and returns this scale. + * + * @param value The output value of the scale for undefined (or NaN) input values. + */ + unknown(value: NewUnknown): ScaleQuantile; +} + +/** + * Constructs a new quantile scale with the specified range. + * The domain defaults to the empty array. + * If range is not specified, it defaults to the empty array. + * The quantile scale is invalid until both a domain and range are specified. + * + * The first generic corresponds to the data type of range elements. + * The second generic corresponds to the data type of the unknown value. + * + * @param range Array of range values. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleQuantile(range?: Iterable): ScaleQuantile; +/** + * Constructs a new quantile scale with the specified domain and range. + * The quantile scale is invalid until both a domain and range are specified. + * + * The first generic corresponds to the data type of range elements. + * The second generic corresponds to the data type of the unknown value. + * + * @param domain Array of domain values. + * @param range Array of range values. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleQuantile( + domain: Iterable, + range: Iterable, +): ScaleQuantile; + +// ------------------------------------------------------------------------------- +// Threshold Scale Factory +// ------------------------------------------------------------------------------- + +/** + * Threshold scales are similar to quantize scales, except they allow you to map arbitrary subsets of the domain to discrete values in the range. + * The input domain is still continuous, and divided into slices based on a set of threshold values. + * + * If the number of values in the scale’s range is N+1, the number of values in the scale’s domain must be N. + * If there are fewer than N elements in the domain, the additional values in the range are ignored. + * If there are more than N elements in the domain, the scale may return undefined for some inputs. + * + * The first generic corresponds to the data type of domain values. + * The second generic corresponds to the data type of range values. + * The third generic corresponds to the data type of the unknown value. + */ +export interface ScaleThreshold { + /** + * Given a value in the input domain, returns the corresponding value in the output range. + * + * @param value A domain value. + */ + (value: Domain): Range | Unknown; + + /** + * Returns the extent of values in the domain [x0, x1] for the corresponding value in the range, representing the inverse mapping from range to domain. + * This method is useful for interaction, say to determine the value in the domain that corresponds to the pixel location under the mouse. + * + * @param value A range value. + */ + invertExtent(value: Range): [Domain | undefined, Domain | undefined]; + + /** + * Returns the scale’s current domain. + */ + domain(): Domain[]; + /** + * Sets the scale’s domain to the specified array of values. The values must be in sorted ascending order, or the behavior of the scale is undefined. + * The values are typically numbers, but any naturally ordered values (such as strings) will work; a threshold scale can be used to encode any type that is ordered. + * If the number of values in the scale’s range is N+1, the number of values in the scale’s domain must be N. + * If there are fewer than N elements in the domain, the additional values in the range are ignored. + * If there are more than N elements in the domain, the scale may return undefined for some inputs. + * + * @param domain Array of domain values. + */ + domain(domain: Iterable): this; + + /** + * Returns the scale’s current range. + */ + range(): Range[]; + /** + * Sets the scale’s range to the specified array of values. If the number of values in the scale’s domain is N, the number of values in the scale’s range must be N+1. + * If there are fewer than N+1 elements in the range, the scale may return undefined for some inputs. + * If there are more than N+1 elements in the range, the additional values are ignored. + * + * @param range Array of range values. + */ + range(range: Iterable): this; + + /** + * Returns an exact copy of this scale. Changes to this scale will not affect the returned scale, and vice versa. + */ + copy(): this; + + /** + * Returns the current unknown value, which defaults to undefined. + */ + unknown(): UnknownReturnType; + /** + * Sets the output value of the scale for undefined (or NaN) input values and returns this scale. + * + * @param value The output value of the scale for undefined (or NaN) input values. + */ + unknown(value: NewUnknown): ScaleThreshold; +} + +/** + * Constructs a new threshold scale with the specified range. + * The domain defaults to [0.5]. + * If range is not specified, it defaults to [0, 1]. + * Thus, the default threshold scale is equivalent to the Math.round function for numbers; for example threshold(0.49) returns 0, and threshold(0.51) returns 1. + * + * The first generic corresponds to the data type of domain values. + * The second generic corresponds to the data type of range values. + * The third generic corresponds to the data type of the unknown value. + * + * @param range Array of range values. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleThreshold( + range?: Iterable, +): ScaleThreshold; +/** + * Constructs a new threshold scale with the specified domain and range. + * Thus, the default threshold scale is equivalent to the Math.round function for numbers; for example threshold(0.49) returns 0, and threshold(0.51) returns 1. + * + * The first generic corresponds to the data type of domain values. + * The second generic corresponds to the data type of range values. + * The third generic corresponds to the data type of the unknown value. + * + * @param domain Array of domain values. + * @param range Array of range values. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleThreshold( + domain: Iterable, + range: Iterable, +): ScaleThreshold; + +// ------------------------------------------------------------------------------- +// Ordinal Scale Factory +// ------------------------------------------------------------------------------- + +/** + * Unlike continuous scales, ordinal scales have a discrete domain and range. For example, an ordinal scale might map a set of named categories to a set of colors, + * or determine the horizontal positions of columns in a column chart. + * + * The first element in the domain will be mapped to the first element in range, the second domain value to the second range value, and so on. + * If there are fewer elements in the range than in the domain, the scale will reuse values from the start of the range. + * + * The first generic corresponds to the data type of domain values. + * The second generic corresponds to the data type of range values. + * The third generic corresponds to the data type of the unknown value. + */ +export interface ScaleOrdinal { + /** + * Given a value in the input domain, returns the corresponding value in the output range. + * If the given value is not in the scale’s domain, returns the unknown; or, if the unknown value is implicit (the default), + * then the value is implicitly added to the domain and the next-available value in the range is assigned to value, + * such that this and subsequent invocations of the scale given the same input value return the same output value. + * + * @param x A value from the domain. + */ + (x: Domain): Range | Unknown; + + /** + * Returns the scale's current domain. + */ + domain(): Domain[]; + /** + * Sets the domain to the specified array of values. + * + * The first element in domain will be mapped to the first element in the range, + * the second domain value to the second range value, and so on. + * + * Domain values are stored internally in an InternMap from primitive value to index; the resulting index is then used to retrieve a value from the range. + * Thus, an ordinal scale’s values must be coercible to a primitive value, and the primitive domain value uniquely identifies the corresponding range value. + * + * Setting the domain on an ordinal scale is optional if the unknown value is implicit (the default). + * In this case, the domain will be inferred implicitly from usage by assigning each unique value passed to the scale a new value from the range. + * Note that an explicit domain is recommended to ensure deterministic behavior, as inferring the domain from usage will be dependent on ordering. + * + * @param domain Array of domain values. + */ + domain(domain: Iterable): this; + + /** + * Returns the scale's current range. + */ + range(): Range[]; + /** + * Sets the range of the ordinal scale to the specified array of values. + * + * The first element in the domain will be mapped to the first element in range, the second domain value to the second range value, and so on. + * + * If there are fewer elements in the range than in the domain, the scale will reuse values from the start of the range. + * + * @param range Array of range values. + */ + range(range: Iterable): this; + + /** + * Returns the current unknown value, which defaults to "implicit". + */ + unknown(): UnknownReturnType; + /** + * Sets the output value of the scale for unknown input values and returns this scale. + * The implicit value enables implicit domain construction. scaleImplicit can be used as a convenience to set the implicit value. + * + * @param value Unknown value to be used or scaleImplicit to set implicit scale generation. + */ + unknown( + value: NewUnknown, + ): NewUnknown extends { name: "implicit" } ? ScaleOrdinal + : ScaleOrdinal; + + /** + * Returns an exact copy of this ordinal scale. Changes to this scale will not affect the returned scale, and vice versa. + */ + copy(): this; +} + +/** + * Constructs a new ordinal scale with the specified range. + * The domain defaults to the empty array. + * If range is not specified, it defaults to the empty array; an ordinal scale always returns undefined until a non-empty range is defined. + * + * The generic corresponds to the data type of range elements. + * + * @param range An optional array of range values to initialize the scale with. + */ +export function scaleOrdinal(range?: Iterable): ScaleOrdinal; +/** + * Constructs a new ordinal scale with the specified range. + * The domain defaults to the empty array. + * If range is not specified, it defaults to the empty array; an ordinal scale always returns undefined until a non-empty range is defined. + * + * The first generic corresponds to the data type of domain elements. + * The second generic corresponds to the data type of range elements. + * The third generic corresponds to the data type of the unknown value. + * + * @param range An optional array of range values to initialize the scale with. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleOrdinal( + range?: Iterable, +): ScaleOrdinal; +/** + * Constructs a new ordinal scale with the specified domain and range. + * + * The first generic corresponds to the data type of domain elements. + * The second generic corresponds to the data type of range elements. + * The third generic corresponds to the data type of the unknown value. + * + * @param domain Array of domain values. + * @param range An optional array of range values to initialize the scale with. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleOrdinal( + domain: Iterable, + range: Iterable, +): ScaleOrdinal; + +/** + * A special value for ordinal.unknown that enables implicit domain construction: unknown values are implicitly added to the domain. + */ +export const scaleImplicit: { name: "implicit" }; + +// ------------------------------------------------------------------------------- +// Band Scale Factory +// ------------------------------------------------------------------------------- + +/** + * Band scales are like ordinal scales except the output range is continuous and numeric. + * Discrete output values are automatically computed by the scale by dividing the continuous range into uniform bands. + * Band scales are typically used for bar charts with an ordinal or categorical dimension. + * The unknown value of a band scale is effectively undefined: they do not allow implicit domain construction. + * + * The generic corresponds to the data type of domain elements. + */ +export interface ScaleBand { + /** + * Given a value in the input domain, returns the start of the corresponding band derived from the output range. + * If the given value is not in the scale’s domain, returns undefined. + * + * @param x A value from the domain. + */ + (x: Domain): number | undefined; + + /** + * Returns to scale's current domain + */ + domain(): Domain[]; + /** + * Sets the domain to the specified array of values. The first element in domain will be mapped to the first band, the second domain value to the second band, and so on. + * Domain values are stored internally in an InternMap from primitive value to index; the resulting index is then used to determine the band. + * Thus, a band scale’s values must be coercible to a primitive value, and the primitive domain value uniquely identifies the corresponding band. + * + * @param domain Array of domain values. + */ + domain(domain: Iterable): this; + + /** + * Returns the scale’s current range, which defaults to [0, 1]. + */ + range(): [number, number]; + /** + * Sets the scale’s range to the specified two-element array of numbers. If the elements in the given array are not numbers, they will be coerced to numbers. + * The default range is [0, 1]. + * + * @param range A two-element array of numeric values. + */ + range(range: Iterable): this; + + /** + * Sets the scale’s range to the specified two-element array of numbers while also enabling rounding. + * If the elements in the given array are not numbers, they will be coerced to numbers. + * + * Rounding is sometimes useful for avoiding antialiasing artifacts, though also consider the shape-rendering “crispEdges” styles. + * + * @param range A two-element array of numeric values. + */ + rangeRound(range: Iterable): this; + + /** + * Returns the current rounding status for the scale: enabled (= true) or disabled (= false). + */ + round(): boolean; + /** + * Enables or disables rounding accordingly. If rounding is enabled, the start and stop of each band will be integers. + * Rounding is sometimes useful for avoiding antialiasing artifacts, though also consider the shape-rendering “crispEdges” styles. + * Note that if the width of the domain is not a multiple of the cardinality of the range, there may be leftover unused space, even without padding! + * Use band.align to specify how the leftover space is distributed. + * + * @param round Enable rounding (= true), disable rounding (= false). + */ + round(round: boolean): this; + + /** + * Returns the current inner padding which defaults to 0. + */ + paddingInner(): number; + /** + * Sets the inner padding to the specified value which must be in the range [0, 1]. + * The inner padding determines the ratio of the range that is reserved for blank space between bands. + * + * The default setting is 0. + * + * @param padding Value for inner padding in [0, 1] interval. + */ + paddingInner(padding: number): this; + + /** + * Returns the current outer padding which defaults to 0. + */ + paddingOuter(): number; + /** + * Sets the outer padding to the specified value which must be in the range [0, 1]. + * The outer padding determines the ratio of the range that is reserved for blank space before the first band and after the last band. + * + * The default setting is 0. + * + * @param padding Value for outer padding in [0, 1] interval. + */ + paddingOuter(padding: number): this; + + /** + * Returns the inner padding. + */ + padding(): number; + /** + * A convenience method for setting the inner and outer padding to the same padding value. + * + * @param padding Value for inner and outer padding in [0, 1] interval. + */ + padding(padding: number): this; + + /** + * Returns the current alignment which defaults to 0.5. + */ + align(): number; + /** + * Sets the alignment to the specified value which must be in the range [0, 1]. + * + * The default is 0.5. + * + * The alignment determines how any leftover unused space in the range is distributed. + * A value of 0.5 indicates that the outer patter should be equally distributed before the first band and after the last band; + * i.e., the bands should be centered within the range. A value of 0 or 1 may be used to shift the bands to one side, say to position them adjacent to an axis. + * + * @param align Value for alignment setting in [0, 1] interval. + */ + align(align: number): this; + + /** + * Returns the width of each band. + */ + bandwidth(): number; + + /** + * Returns the distance between the starts of adjacent bands. + */ + step(): number; + + /** + * Returns an exact copy of this scale. Changes to this scale will not affect the returned scale, and vice versa. + */ + copy(): this; +} + +/** + * Constructs a new band scale with the specified range, no padding, no rounding and center alignment. + * The domain defaults to the empty domain. + * If range is not specified, it defaults to the unit range [0, 1]. + * + * The generic corresponds to the data type of domain elements. + * + * @param range A two-element array of numeric values. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scaleBand( + range?: Iterable, +): ScaleBand; +/** + * Constructs a new band scale with the specified domain and range, no padding, no rounding and center alignment. + * + * The generic corresponds to the data type of domain elements. + * + * @param domain Array of domain values. + * @param range A two-element array of numeric values. + */ +export function scaleBand( + domain: Iterable, + range: Iterable, +): ScaleBand; + +// ------------------------------------------------------------------------------- +// Point Scale Factory +// ------------------------------------------------------------------------------- + +/** + * Point scales are a variant of band scales with the bandwidth fixed to zero. + * Point scales are typically used for scatterplots with an ordinal or categorical dimension. + * The unknown value of a point scale is always undefined: they do not allow implicit domain construction. + * + * The generic corresponds to the data type of domain elements. + */ +export interface ScalePoint { + /** + * Given a value in the input domain, returns the corresponding point derived from the output range. + * If the given value is not in the scale’s domain, returns undefined. + * + * @param x A value from the domain. + */ + (x: Domain): number | undefined; + + /** + * Returns the scale's current domain. + */ + domain(): Domain[]; + /** + * Sets the domain to the specified array of values. The first element in domain will be mapped to the first point, the second domain value to the second point, and so on. + * Domain values are stored internally in an InternMap from primitive value to index; the resulting index is then used to determine the point. + * Thus, a point scale’s values must be coercible to a primitive value, and the primitive domain value uniquely identifies the corresponding point. + * + * @param domain Array of domain values. + */ + domain(domain: Iterable): this; + + /** + * Returns the scale’s current range, which defaults to [0, 1]. + */ + range(): [number, number]; + /** + * Sets the scale’s range to the specified two-element array of numbers. + * If the elements in the given array are not numbers, they will be coerced to numbers. + * The default range is [0, 1]. + * + * @param range A two-element array of numeric values. + */ + range(range: Iterable): this; + + /** + * Sets the scale’s range to the specified two-element array of numbers while also enabling rounding. + * If the elements in the given array are not numbers, they will be coerced to numbers. + * + * Rounding is sometimes useful for avoiding antialiasing artifacts, though also consider the shape-rendering “crispEdges” styles. + * + * @param range A two-element array of numeric values. + */ + rangeRound(range: Iterable): this; + + /** + * Returns the current rounding status for the scale: enabled (= true) or disabled (= false). + */ + round(): boolean; + /** + * Enables or disables rounding accordingly. If rounding is enabled, the position of each point will be integers. + * Rounding is sometimes useful for avoiding antialiasing artifacts, though also consider the shape-rendering “crispEdges” styles. + * Note that if the width of the domain is not a multiple of the cardinality of the range, there may be leftover unused space, even without padding! + * Use point.align to specify how the leftover space is distributed. + * + * @param round Enable rounding (= true), disable rounding (= false). + */ + round(round: boolean): this; + + /** + * Returns the current outer padding which defaults to 0. + * The outer padding determines the ratio of the range that is reserved for blank space + * before the first point and after the last point. + */ + padding(): number; + /** + * Sets the outer padding to the specified value which must be in the range [0, 1]. + * The outer padding determines the ratio of the range that is reserved for blank space + * before the first point and after the last point. + * + * The default is 0. + * + * @param padding Value for outer padding in [0, 1] interval. + */ + padding(padding: number): this; + + /** + * Returns the current alignment which defaults to 0.5. + */ + align(): number; + /** + * Sets the alignment to the specified value which must be in the range [0, 1]. + * + * The alignment determines how any leftover unused space in the range is distributed. + * A value of 0.5 indicates that the leftover space should be equally distributed before the first point and after the last point; + * i.e., the points should be centered within the range. A value of 0 or 1 may be used to shift the points to one side, say to position them adjacent to an axis. + * + * The default value is 0.5. + * + * @param align Value for alignment setting in [0, 1] interval. + */ + align(align: number): this; + + /** + * Return 0. + */ + bandwidth(): number; + + /** + * Returns the distance between the starts of adjacent points. + */ + step(): number; + + /** + * Returns an exact copy of this scale. Changes to this scale will not affect the returned scale, and vice versa. + */ + copy(): this; +} + +/** + * Constructs a new point scale with the specified range, no padding, no rounding and center alignment. + * The domain defaults to the empty domain. + * If range is not specified, it defaults to the unit range [0, 1]. + * + * The generic corresponds to the data type of domain elements. + * + * @param range A two-element array of numeric values. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function scalePoint( + range?: Iterable, +): ScalePoint; +/** + * Constructs a new point scale with the specified domain and range, no padding, no rounding and center alignment. + * The domain defaults to the empty domain. + * + * The generic corresponds to the data type of domain elements. + * + * @param domain Array of domain values. + * @param range A two-element array of numeric values. + */ +export function scalePoint( + domain: Iterable, + range: Iterable, +): ScalePoint; diff --git a/astra_scene_test/X_03/node_modules/@types/d3-scale/package.json b/astra_scene_test/X_03/node_modules/@types/d3-scale/package.json new file mode 100644 index 0000000000000000000000000000000000000000..ce8f0d038be028fbf668f879008c4c5c351a427b --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/d3-scale/package.json @@ -0,0 +1,53 @@ +{ + "name": "@types/d3-scale", + "version": "4.0.9", + "description": "TypeScript definitions for d3-scale", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-scale", + "license": "MIT", + "contributors": [ + { + "name": "Tom Wanzek", + "githubUsername": "tomwanzek", + "url": "https://github.com/tomwanzek" + }, + { + "name": "Alex Ford", + "githubUsername": "gustavderdrache", + "url": "https://github.com/gustavderdrache" + }, + { + "name": "Boris Yankov", + "githubUsername": "borisyankov", + "url": "https://github.com/borisyankov" + }, + { + "name": "denisname", + "githubUsername": "denisname", + "url": "https://github.com/denisname" + }, + { + "name": "rulonder", + "githubUsername": "rulonder", + "url": "https://github.com/rulonder" + }, + { + "name": "Nathan Bierema", + "githubUsername": "Methuselah96", + "url": "https://github.com/Methuselah96" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/d3-scale" + }, + "scripts": {}, + "dependencies": { + "@types/d3-time": "*" + }, + "peerDependencies": {}, + "typesPublisherContentHash": "c7eb4d63d0dfb659f0f8e359a4de33ed1f690bdea8051641bffa941f06a92f4d", + "typeScriptVersion": "5.0" +} \ No newline at end of file diff --git a/astra_scene_test/X_03/node_modules/@types/d3-shape/LICENSE b/astra_scene_test/X_03/node_modules/@types/d3-shape/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9e841e7a26e4eb057b24511e7b92d42b257a80e5 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/d3-shape/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/astra_scene_test/X_03/node_modules/@types/d3-shape/README.md b/astra_scene_test/X_03/node_modules/@types/d3-shape/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e44ff0fff04c3ea2f81f908ffd0f0d2951126cc1 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/d3-shape/README.md @@ -0,0 +1,15 @@ +# Installation +> `npm install --save @types/d3-shape` + +# Summary +This package contains type definitions for d3-shape (https://github.com/d3/d3-shape/). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-shape. + +### Additional Details + * Last updated: Fri, 21 Aug 2026 21:38:06 GMT + * Dependencies: [@types/d3-path](https://npmjs.com/package/@types/d3-path) + +# Credits +These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [denisname](https://github.com/denisname), [Nathan Bierema](https://github.com/Methuselah96), and [Fil](https://github.com/Fil). diff --git a/astra_scene_test/X_03/node_modules/@types/d3-shape/index.d.ts b/astra_scene_test/X_03/node_modules/@types/d3-shape/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d2488c28ced2dae99a4f090997c7f84a7594a34e --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/d3-shape/index.d.ts @@ -0,0 +1,2792 @@ +// Last module patch version validated against: 3.1.0 + +import { Path } from "d3-path"; + +declare global { + interface CanvasRenderingContext2D {} // eslint-disable-line @typescript-eslint/no-empty-interface +} + +// ----------------------------------------------------------------------------------- +// Shared Types and Interfaces +// ----------------------------------------------------------------------------------- + +/** + * @deprecated + * This interface is used to bridge the gap between two incompatible versions of TypeScript (see [#25944](https://github.com/Microsoft/TypeScript/pull/25944)). + * Use `CanvasPathMethods` instead with TS <= 3.0 and `CanvasPath` with TS >= 3.1. + */ +export interface CanvasPath_D3Shape { + arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; + arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; + bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; + closePath(): void; + ellipse( + x: number, + y: number, + radiusX: number, + radiusY: number, + rotation: number, + startAngle: number, + endAngle: number, + anticlockwise?: boolean, + ): void; + lineTo(x: number, y: number): void; + moveTo(x: number, y: number): void; + quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; + rect(x: number, y: number, w: number, h: number): void; +} + +// ----------------------------------------------------------------------------------- +// Arc Generator +// ----------------------------------------------------------------------------------- + +/** + * Interface corresponding to the minimum data type assumed by the accessor functions of the Arc generator. + */ +export interface DefaultArcObject { + /** + * Inner radius of arc. + */ + innerRadius: number; + /** + * Outer radius of arc. + */ + outerRadius: number; + /** + * Start angle of arc. The angle is specified in radians, with 0 at -y (12 o’clock) and positive angles proceeding clockwise. + */ + startAngle: number; + /** + * End angle of arc. The angle is specified in radians, with 0 at -y (12 o’clock) and positive angles proceeding clockwise. + */ + endAngle: number; + /** + * Optional. Pad angle of arc in radians. + */ + padAngle?: number | undefined; +} + +/** + * The arc generator produces a circular or annular sector, as in a pie or donut chart. + * + * If the difference between the start and end angles (the angular span) is greater than τ, the arc generator will produce a complete circle or annulus. + * If it is less than τ, arcs may have rounded corners and angular padding. Arcs are always centered at ⟨0,0⟩; use a transform (see: SVG, Canvas) to move the arc to a different position. + * + * See also the pie generator, which computes the necessary angles to represent an array of data as a pie or donut chart; these angles can then be passed to an arc generator. + * + * The first generic corresponds to the type of the "this" context within which the arc generator and its accessor functions will be invoked. + * + * The second generic corresponds to the datum type for which the arc is to be generated. + */ +export interface Arc { + /** + * Generates an arc for the given arguments. + * + * IMPORTANT: If the rendering context of the arc generator is null, + * then the arc is returned as a path data string. + * + * The "this" context within which this function is invoked, will be the context within which the accessor methods of the generator are invoked. + * All arguments passed into this function, will be passed to the accessor functions of the generator. + * + * @param d The datum for which the arc is to be generated. + */ + (this: This, d: Datum, ...args: any[]): string | null; + /** + * Generates an arc for the given arguments. + * + * IMPORTANT: If the arc generator has been configured with a rendering context, + * then the arc is rendered to this context as a sequence of path method calls and this function returns void. + * + * The "this" context within which this function is invoked, will be the context within which the accessor methods of the generator are invoked. + * All arguments passed into this function, will be passed to the accessor functions of the generator. + * + * @param d The datum for which the arc is to be generated. + */ + (this: This, d: Datum, ...args: any[]): void; + + /** + * Computes the midpoint [x, y] of the center line of the arc that would be generated by the given arguments. + * + * To be consistent with the generated arc, the accessors must be deterministic, i.e., return the same value given the same arguments. + * The midpoint is defined as (startAngle + endAngle) / 2 and (innerRadius + outerRadius) / 2. + * + * Note that this is not the geometric center of the arc, which may be outside the arc; + * this method is merely a convenience for positioning labels. + * + * The method is invoked in the same "this" context as the generator was invoked in and + * receives the same arguments that are passed into the arc generator. + * + * @param d The datum for which the arc is to be generated. + */ + centroid(d: Datum, ...args: any[]): [number, number]; + + /** + * Returns the current inner radius accessor, which defaults to a function returning the innerRadius property + * of the first argument passed into it. + */ + innerRadius(): (this: This, d: Datum, ...args: any[]) => number; + /** + * Sets the inner radius to the specified number and returns this arc generator. + * + * Specifying the inner radius as a function is useful for constructing a stacked polar bar chart, often in conjunction with a sqrt scale. + * More commonly, a constant inner radius is used for a donut or pie chart. If the outer radius is smaller than the inner radius, the inner and outer radii are swapped. + * A negative value is treated as zero. + * + * @param radius Constant radius. + */ + innerRadius(radius: number): this; + /** + * Sets the inner radius to the specified function and returns this arc generator. + * + * Specifying the inner radius as a function is useful for constructing a stacked polar bar chart, often in conjunction with a sqrt scale. + * More commonly, a constant inner radius is used for a donut or pie chart. If the outer radius is smaller than the inner radius, the inner and outer radii are swapped. + * A negative value is treated as zero. + * + * @param radius An accessor function returning a number to be used as a radius. The accessor function is invoked in the same "this" context as the generator was invoked in and + * receives the same arguments that were passed into the arc generator. + */ + innerRadius(radius: (this: This, d: Datum, ...args: any[]) => number): this; + + /** + * Returns the current outer radius accessor, which defaults to a function returning the outerRadius property + * of the first argument passed into it. + */ + outerRadius(): (this: This, d: Datum, ...args: any[]) => number; + /** + * Sets the outer radius to the specified number and returns this arc generator. + * + * Specifying the outer radius as a function is useful for constructing a coxcomb or polar bar chart, + * often in conjunction with a sqrt scale. More commonly, a constant outer radius is used for a pie or donut chart. + * If the outer radius is smaller than the inner radius, the inner and outer radii are swapped. + * A negative value is treated as zero. + * + * @param radius Constant radius. + */ + outerRadius(radius: number): this; + /** + * Sets the outer radius to the specified function and returns this arc generator. + * + * Specifying the outer radius as a function is useful for constructing a coxcomb or polar bar chart, + * often in conjunction with a sqrt scale. More commonly, a constant outer radius is used for a pie or donut chart. + * If the outer radius is smaller than the inner radius, the inner and outer radii are swapped. + * A negative value is treated as zero. + * + * @param radius An accessor function returning a number to be used as a radius. The accessor function is invoked in the same "this" context as the generator was invoked in and + * receives the same arguments that were passed into the arc generator. + */ + outerRadius(radius: (this: This, d: Datum, ...args: any[]) => number): this; + + /** + * Returns the current corner radius accessor, which defaults to a function returning a constant value of zero. + */ + cornerRadius(): (this: This, d: Datum, ...args: any[]) => number; + /** + * Sets the corner radius to the specified number and returns this arc generator. + * + * If the corner radius is greater than zero, the corners of the arc are rounded using circles of the given radius. + * For a circular sector, the two outer corners are rounded; for an annular sector, all four corners are rounded. + * + * The corner radius may not be larger than (outerRadius - innerRadius) / 2. + * In addition, for arcs whose angular span is less than π, the corner radius may be reduced as two adjacent rounded corners intersect. + * This is occurs more often with the inner corners. + * + * @param radius Constant radius. + */ + cornerRadius(radius: number): this; + /** + * Sets the corner radius to the specified function and returns this arc generator. + * + * The corner radius may not be larger than (outerRadius - innerRadius) / 2. + * In addition, for arcs whose angular span is less than π, the corner radius may be reduced as two adjacent rounded corners intersect. + * This is occurs more often with the inner corners. + * + * @param radius An accessor function returning a number to be used as a radius. The accessor function is invoked in the same "this" context as the generator was invoked in and + * receives the same arguments that were passed into the arc generator. + */ + cornerRadius(radius: (this: This, d: Datum, ...args: any[]) => number): this; + + /** + * Returns the current start angle accessor, which defaults to a function returning the startAngle property + * of the first argument passed into it. + */ + startAngle(): (this: This, d: Datum, ...args: any[]) => number; + /** + * Sets the start angle to the specified number and returns this arc generator. + * + * The angle is specified in radians, with 0 at -y (12 o’clock) and positive angles proceeding clockwise. + * If |endAngle - startAngle| ≥ τ, a complete circle or annulus is generated rather than a sector. + * + * @param angle Constant angle in radians. + */ + startAngle(angle: number): this; + /** + * Sets the start angle to the specified function and returns this arc generator. + * + * The angle is specified in radians, with 0 at -y (12 o’clock) and positive angles proceeding clockwise. + * If |endAngle - startAngle| ≥ τ, a complete circle or annulus is generated rather than a sector. + * + * @param angle An accessor function returning a number in radians to be used as an angle. The accessor function is invoked in the same "this" context as the generator was invoked in and + * receives the same arguments that were passed into the arc generator. + */ + startAngle(angle: (this: This, d: Datum, ...args: any[]) => number): this; + + /** + * Returns the current end angle accessor, which defaults to a function returning the endAngle property + * of the first argument passed into it. + */ + endAngle(): (this: This, d: Datum, ...args: any[]) => number; + /** + * Sets the end angle to the specified number and returns this arc generator. + * + * The angle is specified in radians, with 0 at -y (12 o’clock) and positive angles proceeding clockwise. + * If |endAngle - startAngle| ≥ τ, a complete circle or annulus is generated rather than a sector. + * + * @param angle Constant angle in radians. + */ + endAngle(angle: number): this; + /** + * Sets the end angle to the specified function and returns this arc generator. + * + * The angle is specified in radians, with 0 at -y (12 o’clock) and positive angles proceeding clockwise. + * If |endAngle - startAngle| ≥ τ, a complete circle or annulus is generated rather than a sector. + * + * @param angle An accessor function returning a number in radians to be used as an angle. The accessor function is invoked in the same "this" context as the generator was invoked in and + * receives the same arguments that were passed into the arc generator. + */ + endAngle(angle: (this: This, d: Datum, ...args: any[]) => number): this; + + /** + * Returns the current pad angle accessor, which defaults to a function returning the padAngle property + * of the first argument passed into it, or false if no data are passed in or the property is not defined. + */ + padAngle(): (this: This, d: Datum, ...args: any[]) => number | undefined; + /** + * Sets the pad angle to the specified number and returns this arc generator. + * + * The pad angle is converted to a fixed linear distance separating adjacent arcs, defined as padRadius * padAngle. This distance is subtracted equally from the start and end of the arc. + * If the arc forms a complete circle or annulus, as when |endAngle - startAngle| ≥ τ, the pad angle is ignored. If the inner radius or angular span is small relative to the pad angle, + * it may not be possible to maintain parallel edges between adjacent arcs. In this case, the inner edge of the arc may collapse to a point, similar to a circular sector. + * For this reason, padding is typically only applied to annular sectors (i.e., when innerRadius is positive). + * + * The recommended minimum inner radius when using padding is outerRadius * padAngle / sin(θ), where θ is the angular span of the smallest arc before padding. + * For example, if the outer radius is 200 pixels and the pad angle is 0.02 radians, a reasonable θ is 0.04 radians, and a reasonable inner radius is 100 pixels. + * + * Often, the pad angle is not set directly on the arc generator, but is instead computed by the pie generator so as to ensure that the area of padded arcs is proportional to their value; + * see pie.padAngle. See the pie padding animation for illustration. + * If you apply a constant pad angle to the arc generator directly, it tends to subtract disproportionately from smaller arcs, introducing distortion. + * + * @param angle Constant angle in radians. + */ + padAngle(angle: number | undefined): this; + /** + * Sets the pad angle to the specified function and returns this arc generator. + * + * The pad angle is converted to a fixed linear distance separating adjacent arcs, defined as padRadius * padAngle. This distance is subtracted equally from the start and end of the arc. + * If the arc forms a complete circle or annulus, as when |endAngle - startAngle| ≥ τ, the pad angle is ignored. If the inner radius or angular span is small relative to the pad angle, + * it may not be possible to maintain parallel edges between adjacent arcs. In this case, the inner edge of the arc may collapse to a point, similar to a circular sector. + * For this reason, padding is typically only applied to annular sectors (i.e., when innerRadius is positive). + * + * The recommended minimum inner radius when using padding is outerRadius * padAngle / sin(θ), where θ is the angular span of the smallest arc before padding. + * For example, if the outer radius is 200 pixels and the pad angle is 0.02 radians, a reasonable θ is 0.04 radians, and a reasonable inner radius is 100 pixels. + * + * Often, the pad angle is not set directly on the arc generator, but is instead computed by the pie generator so as to ensure that the area of padded arcs is proportional to their value; + * see pie.padAngle. See the pie padding animation for illustration. + * If you apply a constant pad angle to the arc generator directly, it tends to subtract disproportionately from smaller arcs, introducing distortion. + * + * @param angle An accessor function returning a number in radians to be used as an angle. The accessor function is invoked in the same "this" context as the generator was invoked in and + * receives the same arguments that were passed into the arc generator. + */ + padAngle(angle: (this: This, d: Datum, ...args: any[]) => number | undefined): this; + + /** + * Returns the current pad radius accessor, which defaults to null, indicating that the pad radius should be automatically computed as sqrt(innerRadius * innerRadius + outerRadius * outerRadius). + */ + padRadius(): ((this: This, d: Datum, ...args: any[]) => number) | null; + /** + * Sets the pad radius to the specified function or number and returns this arc generator. + * The pad radius determines the fixed linear distance separating adjacent arcs, defined as padRadius * padAngle. + */ + padRadius(radius: null | number | ((this: This, d: Datum, ...args: any[]) => number)): this; + + /** + * Returns the current rendering context, which defaults to null. + */ + context(): CanvasRenderingContext2D | null; + /** + * Sets the context and returns this arc generator. + * If context is not specified, returns the current context, which defaults to null. + */ + context(context: CanvasRenderingContext2D | null): this; + + /** + * Returns the maximum number of digits after the decimal separator, which defaults to 3. + */ + digits(): number | null; + /** + * Sets the maximum number of digits after the decimal separator and returns this arc generator. + * + * This option only applies when the associated context is null, as when this arc generator is used + * to produce path data. + * + * @param digits The maximum number of digits after the decimal separator, or null for full precision. + */ + digits(digits: number | null): this; +} + +/** + * Constructs a new arc generator with the default settings. + * + * Ensure that the accessors used with the arc generator correspond to the arguments passed into them, + * or set them to constants as appropriate. + */ +export function arc(): Arc; +/** + * Constructs a new arc generator with the default settings. + * + * Ensure that the accessors used with the arc generator correspond to the arguments passed into them, + * or set them to constants as appropriate. + * + * The generic corresponds to the datum type representing a arc. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function arc(): Arc; +/** + * Constructs a new arc generator with the default settings. + * + * Ensure that the accessors used with the arc generator correspond to the arguments passed into them, + * or set them to constants as appropriate. + * + * The first generic corresponds to the type of the "this" context within which the arc generator and its accessor functions will be invoked. + * + * The second generic corresponds to the datum type representing a arc. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function arc(): Arc; + +// ----------------------------------------------------------------------------------- +// Pie Generator +// ----------------------------------------------------------------------------------- + +/** + * Element of the Arc Datums Array created by invoking the Pie generator. + * + * The generic refers to the data type of an element in the input array passed into the Pie generator. + */ +export interface PieArcDatum { + /** + * The input datum; the corresponding element in the input data array of the Pie generator. + */ + data: T; + /** + * The numeric value of the arc. + */ + value: number; + /** + * The zero-based sorted index of the arc. + */ + index: number; + /** + * The start angle of the arc. + * If the pie generator was configured to be used for the arc generator, + * then the units are in radians with 0 at -y (12 o’clock) and positive angles proceeding clockwise. + */ + startAngle: number; + /** + * The end angle of the arc. + * If the pie generator was configured to be used for the arc generator, + * then the units are in radians with 0 at -y (12 o’clock) and positive angles proceeding clockwise. + */ + endAngle: number; + /** + * The pad angle of the arc. If the pie generator was configured to be used for the arc generator, than the units are in radians. + */ + padAngle: number; +} + +/** + * The pie generator does not produce a shape directly, but instead computes the necessary angles to represent a tabular dataset as a pie or donut chart; + * these angles can then be passed to an arc generator. + * + * The first generic corresponds to the type of the "this" context within which the pie generator and its accessor functions will be invoked. + * + * The second generic refers to the data type of an element in the input array passed into the Pie generator. + */ +export interface Pie { + /** + * Generates a pie for the given array of data, returning an array of objects representing each datum’s arc angles. + * Any additional arguments are arbitrary; they are simply propagated to the pie generator’s accessor functions along with the this object. + * The length of the returned array is the same as data, and each element i in the returned array corresponds to the element i in the input data. + * + * This representation is designed to work with the arc generator’s default startAngle, endAngle and padAngle accessors. + * The angular units are arbitrary, but if you plan to use the pie generator in conjunction with an arc generator, + * you should specify angles in radians, with 0 at -y (12 o’clock) and positive angles proceeding clockwise. + * + * @param data Array of data elements. + */ + (this: This, data: Datum[], ...args: any[]): Array>; + + /** + * Returns the current value accessor, which defaults to a function returning the first argument passed into it. + * The default value accessor assumes that the input data are numbers, or that they are coercible to numbers using valueOf. + */ + value(): (d: Datum, i: number, data: Datum[]) => number; + /** + * Sets the value accessor to use the specified constant number and returns this pie generator. + * + * @param value Constant value to be used. + */ + value(value: number): this; + /** + * Sets the value accessor to use the specified function and returns this pie generator. + * + * When a pie is generated, the value accessor will be invoked for each element in the input data array. + * The default value accessor assumes that the input data are numbers, or that they are coercible to numbers using valueOf. + * If your data are not simply numbers, then you should specify an accessor that returns the corresponding numeric value for a given datum. + * + * @param value A value accessor function, which is invoked for each element in the input data array, being passed the element d, the index i, and the array data as three arguments. + * It returns a numeric value. + */ + value(value: (d: Datum, i: number, data: Datum[]) => number): this; + + /** + * Returns the current data comparator, which defaults to null. + */ + sort(): ((a: Datum, b: Datum) => number) | null; + /** + * Sets the data comparator to the specified function and returns this pie generator. + * + * If both the data comparator and the value comparator are null, then arcs are positioned in the original input order. + * Otherwise, the data is sorted according to the data comparator, and the resulting order is used. Setting the data comparator implicitly sets the value comparator to null. + * + * Sorting does not affect the order of the generated arc array which is always in the same order as the input data array; it merely affects the computed angles of each arc. + * The first arc starts at the start angle and the last arc ends at the end angle. + * + * @param comparator A compare function takes two arguments a and b, each elements from the input data array. + * If the arc for a should be before the arc for b, then the comparator must return a number less than zero; + * if the arc for a should be after the arc for b, then the comparator must return a number greater than zero; + * returning zero means that the relative order of a and b is unspecified. + */ + sort(comparator: (a: Datum, b: Datum) => number): this; + /** + * Sets the data comparator to null and returns this pie generator. + * + * If both the data comparator and the value comparator are null, then arcs are positioned in the original input order. + * + * @param comparator null, to set the pie generator to use the original input order or use the sortValues comparator, if any. + */ + sort(comparator: null): this; + + /** + * Returns the current value comparator, which defaults to descending value. + */ + sortValues(): ((a: number, b: number) => number) | null; + /** + * Sets the value comparator to the specified function and returns this pie generator. + * + * If both the data comparator and the value comparator are null, then arcs are positioned in the original input order. + * Otherwise, the data is sorted according to the data comparator, and the resulting order is used. + * Setting the value comparator implicitly sets the data comparator to null. + * + * The value comparator is similar to the data comparator, except the two arguments a and b are values derived from the input data array using the value accessor, not the data elements. + * If the arc for a should be before the arc for b, then the comparator must return a number less than zero; + * if the arc for a should be after the arc for b, then the comparator must return a number greater than zero; + * returning zero means that the relative order of a and b is unspecified. + */ + sortValues(comparator: ((a: number, b: number) => number) | null): this; + + /** + * Returns the current start angle accessor, which defaults to a function returning a constant zero. + */ + startAngle(): (this: This, data: Datum[], ...args: any[]) => number; + /** + * Sets the overall start angle of the pie to the specified number and returns this pie generator. + * + * The default start angle is zero. + * + * The start angle here means the overall start angle of the pie, i.e., the start angle of the first arc. + * The start angle accessor is invoked once, being passed the same arguments and this context as the pie generator. + * The units of angle are arbitrary, but if you plan to use the pie generator in conjunction with an arc generator, + * you should specify an angle in radians, with 0 at -y (12 o’clock) and positive angles proceeding clockwise. + * + * @param angle A constant angle. + */ + startAngle(angle: number): this; + /** + * Sets the overall start angle of the pie to the specified function and returns this pie generator. + * + * The default start angle is zero. + * + * The start angle here means the overall start angle of the pie, i.e., the start angle of the first arc. + * The start angle accessor is invoked once, being passed the same arguments and this context as the pie generator. + * The units of angle are arbitrary, but if you plan to use the pie generator in conjunction with an arc generator, + * you should specify an angle in radians, with 0 at -y (12 o’clock) and positive angles proceeding clockwise. + * + * @param angle An angle accessor function, which is invoked once, being passed the same arguments and this context as the pie generator. + */ + startAngle(angle: (this: This, data: Datum[], ...args: any[]) => number): this; + + /** + * Returns the current end angle accessor, which defaults to a function returning a constant 2*pi. + */ + endAngle(): (this: This, data: Datum[], ...args: any[]) => number; + /** + * Sets the overall end angle of the pie to the specified number and returns this pie generator. + * + * The default end angle is 2*pi. + * + * The end angle here means the overall end angle of the pie, i.e., the end angle of the last arc. + * The units of angle are arbitrary, but if you plan to use the pie generator in conjunction with an arc generator, + * you should specify an angle in radians, with 0 at -y (12 o’clock) and positive angles proceeding clockwise. + * + * The value of the end angle is constrained to startAngle ± τ, such that |endAngle - startAngle| ≤ τ. + * + * @param angle A constant angle. + */ + endAngle(angle: number): this; + /** + * Sets the overall end angle of the pie to the specified function and returns this pie generator. + * + * The default end angle is 2*pi. + * + * The end angle here means the overall end angle of the pie, i.e., the end angle of the last arc. + * The end angle accessor is invoked once, being passed the same arguments and this context as the pie generator. + * The units of angle are arbitrary, but if you plan to use the pie generator in conjunction with an arc generator, + * you should specify an angle in radians, with 0 at -y (12 o’clock) and positive angles proceeding clockwise. + * + * The value of the end angle is constrained to startAngle ± τ, such that |endAngle - startAngle| ≤ τ. + * + * @param angle An angle accessor function, which is invoked once, being passed the same arguments and this context as the pie generator. + */ + endAngle(angle: (this: This, data: Datum[], ...args: any[]) => number): this; + + /** + * Returns the current pad angle accessor, which defaults to a function returning a constant zero. + */ + padAngle(): (this: This, data: Datum[], ...args: any[]) => number; + /** + * Sets the pad angle to the specified number and returns this pie generator. + * + * The pad angle here means the angular separation between each adjacent arc. + * The total amount of padding reserved is the specified angle times the number of elements in the input data array, and at most |endAngle - startAngle|; + * the remaining space is then divided proportionally by value such that the relative area of each arc is preserved. + * The units of angle are arbitrary, but if you plan to use the pie generator in conjunction with an arc generator, you should specify an angle in radians. + * + * @param angle A constant angle. + */ + padAngle(angle: number): this; + /** + * Sets the pad angle to the specified function and returns this pie generator. + * + * The pad angle here means the angular separation between each adjacent arc. + * The total amount of padding reserved is the specified angle times the number of elements in the input data array, and at most |endAngle - startAngle|; + * the remaining space is then divided proportionally by value such that the relative area of each arc is preserved. + * The pad angle accessor is invoked once, being passed the same arguments and this context as the pie generator. + * The units of angle are arbitrary, but if you plan to use the pie generator in conjunction with an arc generator, you should specify an angle in radians. + * + * @param angle An angle accessor function, which is invoked once, being passed the same arguments and this context as the pie generator. + */ + padAngle(angle: (this: This, data: Datum[], ...args: any[]) => number): this; +} + +/** + * Constructs a new pie generator with the default settings. + * + * Ensure that the accessors used with the pie generator correspond to the arguments passed into them, + * or set them to constants as appropriate. + */ +export function pie(): Pie; +/** + * Constructs a new pie generator with the default settings. + * + * Ensure that the accessors used with the pie generator correspond to the arguments passed into them, + * or set them to constants as appropriate. + * + * The generic refers to the data type of an element in the input array passed into the Pie generator. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function pie(): Pie; +/** + * Constructs a new pie generator with the default settings. + * + * Ensure that the accessors used with the pie generator correspond to the arguments passed into them, + * or set them to constants as appropriate. + * + * The first generic corresponds to the type of the "this" context within which the pie generator and its accessor functions will be invoked. + * + * The second generic refers to the data type of an element in the input array passed into the Pie generator. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function pie(): Pie; + +// ----------------------------------------------------------------------------------- +// Line Generators +// ----------------------------------------------------------------------------------- + +/** + * The line generator produces a spline or polyline, as in a line chart. + * Lines also appear in many other visualization types, such as the links in hierarchical edge bundling. + * + * The generic refers to the data type of an element in the input array passed into the line generator. + */ +export interface Line { + /** + * Generates a line for the given array of data. Depending on this line generator’s associated curve, + * the given input data may need to be sorted by x-value before being passed to the line generator. + * + * IMPORTANT: If the rendering context of the line generator is null, + * then the line is returned as a path data string. + * + * @param data Array of data elements. + */ + (data: Iterable | Datum[]): string | null; + /** + * Generates a line for the given array of data. Depending on this line generator’s associated curve, + * the given input data may need to be sorted by x-value before being passed to the line generator. + * + * IMPORTANT: If the line generator has been configured with a rendering context, + * then the line is rendered to this context as a sequence of path method calls and this function returns void. + * + * @param data Array of data elements. + */ + (data: Iterable | Datum[]): void; + + /** + * Returns the current x-coordinate accessor function, which defaults to a function returning first element of a two-element array of numbers. + */ + x(): (d: Datum, index: number, data: Datum[]) => number; + /** + * Sets the x accessor to the specified number and returns this line generator. + * + * @param x A constant x-coordinate value. + */ + x(x: number): this; + /** + * Sets the x accessor to the specified function and returns this line generator. + * + * When a line is generated, the x accessor will be invoked for each defined element in the input data array. + * + * The default x accessor assumes that the input data are two-element arrays of numbers. If your data are in a different format, or if you wish to transform the data before rendering, + * then you should specify a custom accessor. + * + * @param x A coordinate accessor function which returns the x-coordinate value. The x accessor will be invoked for each defined element in the input data array, + * being passed the element d, the index i, and the array data as three arguments. + */ + x(x: (d: Datum, index: number, data: Datum[]) => number): this; + + /** + * Returns the current y-coordinate accessor function, which defaults to a function returning second element of a two-element array of numbers. + */ + y(): (d: Datum, index: number, data: Datum[]) => number; + /** + * Sets the y accessor to the specified number and returns this line generator. + * + * @param y A constant y-coordinate value. + */ + y(y: number): this; + /** + * Sets the y accessor to the specified function and returns this line generator. + * + * When a line is generated, the y accessor will be invoked for each defined element in the input data array. + * + * The default y accessor assumes that the input data are two-element arrays of numbers. If your data are in a different format, or if you wish to transform the data before rendering, + * then you should specify a custom accessor. + * + * @param y A coordinate accessor function which returns the y-coordinate value. The y accessor will be invoked for each defined element in the input data array, + * being passed the element d, the index i, and the array data as three arguments. + */ + y(y: (d: Datum, index: number, data: Datum[]) => number): this; + + /** + * Returns the current defined accessor, which defaults to a function returning a constant boolean value of true. + */ + defined(): (d: Datum, index: number, data: Datum[]) => boolean; + /** + * Sets the defined accessor to the specified boolean and returns this line generator. + * + * The default accessor for defined returns a constant boolean value of true, thus assumes that the input data is always defined. + * + * When a line is generated, the defined accessor will be invoked for each element in the input data array, + * being passed the element d, the index i, and the array data as three arguments. + * If the given element is defined (i.e., if the defined accessor returns a truthy value for this element), + * the x and y accessors will subsequently be evaluated and the point will be added to the current line segment. + * Otherwise, the element will be skipped, the current line segment will be ended, and a new line segment will be generated for the next defined point. + * As a result, the generated line may have several discrete segments. + * + * Note that if a line segment consists of only a single point, it may appear invisible unless rendered with rounded or square line caps. + * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points. + * + * @param defined A boolean constant. + */ + defined(defined: boolean): this; + /** + * Sets the defined accessor to the specified function and returns this line generator. + * + * The default accessor for defined returns a constant boolean value of true, thus assumes that the input data is always defined. + * + * When a line is generated, the defined accessor will be invoked for each element in the input data array, + * being passed the element d, the index i, and the array data as three arguments. + * If the given element is defined (i.e., if the defined accessor returns a truthy value for this element), + * the x and y accessors will subsequently be evaluated and the point will be added to the current line segment. + * Otherwise, the element will be skipped, the current line segment will be ended, and a new line segment will be generated for the next defined point. + * As a result, the generated line may have several discrete segments. + * + * Note that if a line segment consists of only a single point, it may appear invisible unless rendered with rounded or square line caps. + * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points. + * + * @param defined An accessor function which returns a boolean value. The accessor will be invoked for each defined element in the input data array, + * being passed the element d, the index i, and the array data as three arguments. + */ + defined(defined: (d: Datum, index: number, data: Datum[]) => boolean): this; + + /** + * Returns the current curve factory, which defaults to curveLinear. + */ + curve(): CurveFactory | CurveFactoryLineOnly; + /** + * Returns the current curve factory, which defaults to curveLinear. + * + * The generic allows to cast the curve factory to a specific type, if known. + */ + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + curve(): C; + /** + * Sets the curve factory and returns this line generator. + * + * @param curve A valid curve factory. + */ + curve(curve: CurveFactory | CurveFactoryLineOnly): this; + + /** + * Returns the current rendering context, which defaults to null. + */ + context(): CanvasRenderingContext2D | null; + /** + * Sets the context and returns this line generator. + */ + context(context: CanvasRenderingContext2D | null): this; + + /** + * Returns the maximum number of digits after the decimal separator, which defaults to 3. + */ + digits(): number | null; + /** + * Sets the maximum number of digits after the decimal separator and returns this line generator. + * + * This option only applies when the associated context is null, as when this line generator is used + * to produce path data. + * + * @param digits The maximum number of digits after the decimal separator, or null for full precision. + */ + digits(digits: number | null): this; +} + +/** + * Constructs a new line generator with the default settings. + * + * If x or y are specified, sets the corresponding accessors to the specified function or number and returns this line generator. + * + * The generic refers to the data type of an element in the input array passed into the line generator. + * + * @param x Sets the x accessor + * @param y Sets the y accessor + */ +export function line( + x?: number | ((d: Datum, index: number, data: Datum[]) => number), + y?: number | ((d: Datum, index: number, data: Datum[]) => number), +): Line; + +/** + * The radial line generator produces a spline or polyline, as in a line chart. + * + * A radial line generator is equivalent to the standard Cartesian line generator, + * except the x and y accessors are replaced with angle and radius accessors. + * Radial lines are always positioned relative to ⟨0,0⟩; use a transform (see: SVG, Canvas) to change the origin. + * + * The generic refers to the data type of an element in the input array passed into the line generator. + */ +export interface LineRadial { + /** + * Generates a radial line for the given array of data. Depending on this radial line generator’s associated curve, + * the given input data may need to be sorted by x-value before being passed to the line generator. + * + * IMPORTANT: If the rendering context of the radial line generator is null, + * then the radial line is returned as a path data string. + * + * @param data Array of data elements. + */ + (data: Iterable | Datum[]): string | null; + /** + * Generates a radial line for the given array of data. Depending on this radial line generator’s associated curve, + * the given input data may need to be sorted by x-value before being passed to the radial line generator. + * + * IMPORTANT: If the radial line generator has been configured with a rendering context, + * then the radial line is rendered to this context as a sequence of path method calls and this function returns void. + * + * @param data Array of data elements. + */ + (data: Iterable | Datum[]): void; + + /** + * Returns the current angle accessor function, which defaults to a function returning first element of a two-element array of numbers. + */ + angle(): (d: Datum, index: number, data: Datum[]) => number; + /** + * Sets the angle accessor to the specified number and returns this radial line generator. + * + * @param angle A constant angle value in radians, with 0 at -y (12 o’clock). + */ + angle(angle: number): this; + /** + * Sets the angle accessor to the specified function and returns this radial line generator. + * + * When a radial line is generated, the angle accessor will be invoked for each defined element in the input data array. + * + * The default angle accessor assumes that the input data are two-element arrays of numbers. If your data are in a different format, or if you wish to transform the data before rendering, + * then you should specify a custom accessor. + * + * @param angle An angle accessor function which returns the angle value in radians, with 0 at -y (12 o’clock). The angle accessor will be invoked for each defined element in the input data array, + * being passed the element d, the index i, and the array data as three arguments. + */ + angle(angle: (d: Datum, index: number, data: Datum[]) => number): this; + + /** + * Returns the current radius accessor function, which defaults to a function returning second element of a two-element array of numbers. + */ + radius(): (d: Datum, index: number, data: Datum[]) => number; + /** + * Sets the radius accessor to the specified number and returns this radial line generator. + * + * @param radius A constant radius value. + */ + radius(radius: number): this; + /** + * Sets the radius accessor to the specified function and returns this radial line generator. + * + * When a radial line is generated, the radius accessor will be invoked for each defined element in the input data array. + * + * The default radius accessor assumes that the input data are two-element arrays of numbers. If your data are in a different format, or if you wish to transform the data before rendering, + * then you should specify a custom accessor. + * + * @param radius A radius accessor function which returns the radius value. The radius accessor will be invoked for each defined element in the input data array, + * being passed the element d, the index i, and the array data as three arguments. + */ + radius(radius: (d: Datum, index: number, data: Datum[]) => number): this; + + /** + * Returns the current defined accessor, which defaults to a function returning a constant boolean value of true. + */ + defined(): (d: Datum, index: number, data: Datum[]) => boolean; + /** + * Sets the defined accessor to the specified boolean and returns this radial line generator. + * + * The default accessor for defined returns a constant boolean value of true, thus assumes that the input data is always defined. + * + * When a radial line is generated, the defined accessor will be invoked for each element in the input data array, + * being passed the element d, the index i, and the array data as three arguments. + * If the given element is defined (i.e., if the defined accessor returns a truthy value for this element), + * the angle and radius accessors will subsequently be evaluated and the point will be added to the current radial line segment. + * Otherwise, the element will be skipped, the current radial line segment will be ended, and a new radial line segment will be generated for the next defined point. + * As a result, the generated radial line may have several discrete segments. + * + * Note that if a radial line segment consists of only a single point, it may appear invisible unless rendered with rounded or square line caps. + * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points. + * + * @param defined A boolean constant. + */ + defined(defined: boolean): this; + /** + * Sets the defined accessor to the specified function and returns this radial line generator. + * + * The default accessor for defined returns a constant boolean value of true, thus assumes that the input data is always defined. + * + * When a radial line is generated, the defined accessor will be invoked for each element in the input data array, + * being passed the element d, the index i, and the array data as three arguments. + * If the given element is defined (i.e., if the defined accessor returns a truthy value for this element), + * the angle and radius accessors will subsequently be evaluated and the point will be added to the current radial line segment. + * Otherwise, the element will be skipped, the current radial line segment will be ended, and a new radial line segment will be generated for the next defined point. + * As a result, the generated radial line may have several discrete segments. + * + * Note that if a radial line segment consists of only a single point, it may appear invisible unless rendered with rounded or square line caps. + * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points. + * + * @param defined An accessor function which returns a boolean value. The accessor will be invoked for each defined element in the input data array, + * being passed the element d, the index i, and the array data as three arguments. + */ + defined(defined: (d: Datum, index: number, data: Datum[]) => boolean): this; + + /** + * Returns the current curve factory, which defaults to curveLinear. + */ + curve(): CurveFactory | CurveFactoryLineOnly; + /** + * Returns the current curve factory, which defaults to curveLinear. + * + * The generic allows to cast the curve factory to a specific type, if known. + */ + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + curve(): C; + /** + * Sets the curve factory and returns this radial line generator. + * + * Note that curveMonotoneX or curveMonotoneY are not recommended for radial lines because they assume that the data is monotonic in x or y, + * which is typically untrue of radial lines. + * + * @param curve A valid curve factory. + */ + curve(curve: CurveFactory | CurveFactoryLineOnly): this; + + /** + * Returns the current rendering context, which defaults to null. + */ + context(): CanvasRenderingContext2D | null; + /** + * Equivalent to line.context. + */ + context(context: CanvasRenderingContext2D | null): this; + + /** + * Returns the maximum number of digits after the decimal separator, which defaults to 3. + */ + digits(): number | null; + /** + * Sets the maximum number of digits after the decimal separator and returns this radial line generator. + * + * This option only applies when the associated context is null, as when this radial line generator is used + * to produce path data. + * + * @param digits The maximum number of digits after the decimal separator, or null for full precision. + */ + digits(digits: number | null): this; +} + +/** + * Constructs a new radial line generator with the default settings. + * + * Ensure that the accessors used with the radial line generator correspond to the arguments passed into them, + * or set them to constants as appropriate. + */ +export function lineRadial(): LineRadial<[number, number]>; +/** + * Constructs a new radial line generator with the default settings. + * + * Ensure that the accessors used with the radial line generator correspond to the arguments passed into them, + * or set them to constants as appropriate. + * + * The generic refers to the data type of an element in the input array passed into the radial line generator. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function lineRadial(): LineRadial; + +/** + * @deprecated Use LineRadial + */ +export type RadialLine = LineRadial; + +/** + * @deprecated Use lineRadial() + */ +export function radialLine(): RadialLine<[number, number]>; +/** + * @deprecated Use lineRadial() + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function radialLine(): RadialLine; + +// ----------------------------------------------------------------------------------- +// Area Generators +// ----------------------------------------------------------------------------------- + +/** + * The area generator produces an area, as in an area chart. An area is defined by two bounding lines, either splines or polylines. + * Typically, the two lines share the same x-values (x0 = x1), differing only in y-value (y0 and y1); most commonly, y0 is defined as a constant representing zero. + * The first line (the topline) is defined by x1 and y1 and is rendered first; the second line (the baseline) is defined by x0 and y0 and is rendered second, with the points in reverse order. + * With a curveLinear curve, this produces a clockwise polygon. + * + * The generic refers to the data type of an element in the input array passed into the area generator. + */ +export interface Area { + /** + * Generates an area for the given array of data. Depending on this area generator’s associated curve, + * the given input data may need to be sorted by x-value before being passed to the area generator. + * + * IMPORTANT: If the rendering context of the area generator is null, + * then the area is returned as a path data string. + * + * @param data Array of data elements. + */ + (data: Iterable | Datum[]): string | null; + /** + * Generates an area for the given array of data. Depending on this area generator’s associated curve, + * the given input data may need to be sorted by x-value before being passed to the area generator. + * + * IMPORTANT: If the area generator has been configured with a rendering context, + * then the area is rendered to this context as a sequence of path method calls and this function returns void. + * + * @param data Array of data elements. + */ + (data: Iterable | Datum[]): void; + + /** + * Returns the current x0 accessor. The default x0 accessor is a function returning the first element of a + * two-element array of numbers. + */ + x(): (d: Datum, index: number, data: Datum[]) => number; + /** + * Sets x0 to a constant number x and x1 to null and returns this area generator. + * + * Setting x1 to null indicates that the previously-computed x0 value should be reused for the x1 value. + * + * @param x A constant value to be used for x0. + */ + x(x: number): this; + /** + * Sets x0 to the specified function x and x1 to null and returns this area generator. + * + * The default x0 accessor assumes that the input data are two-element arrays of numbers and returns the first element. + * If your data are in a different format, or if you wish to transform the data before rendering, then you should specify a custom accessor. + * + * @param x An accessor function returning a value to be used for x0. The accessor will be invoked for each defined element in the input data array, + * being passed the element d, the index i, and the array data as three arguments. + */ + x(x: (d: Datum, index: number, data: Datum[]) => number): this; + + /** + * Returns the current x0 accessor. The default x0 accessor is a function returning the first element of a + * two-element array of numbers. + */ + x0(): (d: Datum, index: number, data: Datum[]) => number; + /** + * Sets x0 to a constant number and returns this area generator. + * + * @param x A constant value. + */ + x0(x: number): this; + /** + * Sets x0 to the specified function and returns this area generator. + * + * The default x0 accessor assumes that the input data are two-element arrays of numbers and returns the first element. + * If your data are in a different format, or if you wish to transform the data before rendering, then you should specify a custom accessor. + * + * @param x An accessor function returning a value to be used for x0. The accessor will be invoked for each defined element in the input data array, + * being passed the element d, the index i, and the array data as three arguments. + */ + x0(x: (d: Datum, index: number, data: Datum[]) => number): this; + + /** + * Returns the current x1 accessor, which defaults to null, indicating that the previously-computed x0 value should be reused for the x1 value. + */ + x1(): ((d: Datum, index: number, data: Datum[]) => number) | null; + /** + * Sets the x1 accessor to the specified number and returns this area generator. + */ + x1(x: null | number): this; + /** + * Sets x1 to the specified function and returns this area generator. + * + * The default x1 accessor is null, indicating that the previously-computed x0 value should be reused for the x1 value. + * If your data are in a different format, or if you wish to transform the data before rendering, then you should specify a custom accessor. + * + * @param x An accessor function returning a value to be used for x1. The accessor will be invoked for each defined element in the input data array, + * being passed the element d, the index i, and the array data as three arguments. + */ + x1(x: (d: Datum, index: number, data: Datum[]) => number): this; + + /** + * Returns the current y0 accessor. The default y0 accessor is a function returning a constant value of zero. + */ + y(): (d: Datum, index: number, data: Datum[]) => number; + /** + * Sets y0 to a constant number y and y1 to null and returns this area generator. + * + * Setting y1 to null indicates that the previously-computed y0 value should be reused for the y1 value. + * + * @param y A constant value to be used for y0. + */ + y(y: number): this; + /** + * Sets y0 to the accessor function y and y1 to null and returns this area generator. + * + * The default y0 accessor returns a constant value of zero. + * If your data are in a different format, or if you wish to transform the data before rendering, then you should specify a custom accessor. + * + * @param y An accessor function returning a value to be used for y0. The accessor will be invoked for each defined element in the input data array, + * being passed the element d, the index i, and the array data as three arguments. + */ + y(y: (d: Datum, index: number, data: Datum[]) => number): this; + + /** + * Returns the current y0 accessor. The default y0 accessor is a function a constant value of zero. + */ + y0(): (d: Datum, index: number, data: Datum[]) => number; + /** + * Sets y0 to a constant number and returns this area generator. + * + * @param y A constant value. + */ + y0(y: number): this; + /** + * Sets y0 to the specified function and returns this area generator. + * + * The default y0 accessor is a function which returns a constant value of zero. + * If your data are in a different format, or if you wish to transform the data before rendering, then you should specify a custom accessor. + * + * @param y An accessor function returning a value to be used for y0. The accessor will be invoked for each defined element in the input data array, + * being passed the element d, the index i, and the array data as three arguments. + */ + y0(y: (d: Datum, index: number, data: Datum[]) => number): this; + + /** + * Returns the current y1 accessor or null. The default y1 accessor is a function returning the second element of a + * two-element array of numbers. + * + * If the y1 accessor is null, the previously-computed y0 value is reused for the y1 value. + */ + y1(): ((d: Datum, index: number, data: Datum[]) => number) | null; + /** + * sets the y1 accessor to the specified number and returns this area generator. + */ + y1(y: null | number): this; + /** + * Sets y1 to the specified function and returns this area generator. + * + * The default y1 accessor assumes that the input data are two-element arrays of numbers and returns the second element. + * If your data are in a different format, or if you wish to transform the data before rendering, then you should specify a custom accessor. + * + * @param y An accessor function returning a value to be used for y1. The accessor will be invoked for each defined element in the input data array, + * being passed the element d, the index i, and the array data as three arguments. + */ + y1(y: (d: Datum, index: number, data: Datum[]) => number): this; + + /** + * Returns the current defined accessor, which defaults to a function returning a constant boolean value of true. + */ + defined(): (d: Datum, index: number, data: Datum[]) => boolean; + /** + * Sets the defined accessor to the specified boolean and returns this area generator. + * + * The default accessor for defined returns a constant boolean value of true, thus assumes that the input data is always defined. + * When an area is generated, the defined accessor will be invoked for each element in the input data array, being passed the element d, the index i, and the array data as three arguments. + * If the given element is defined (i.e., if the defined accessor returns a truthy value for this element), + * the x0, x1, y0 and y1 accessors will subsequently be evaluated and the point will be added to the current area segment. + * Otherwise, the element will be skipped, the current area segment will be ended, and a new area segment will be generated for the next defined point. + * As a result, the generated area may have several discrete segments. + * + * Note that if an area segment consists of only a single point, it may appear invisible unless rendered with rounded or square line caps. + * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points. + * + * @param defined A boolean constant. + */ + defined(defined: boolean): this; + /** + * Sets the defined accessor to the specified function and returns this area generator. + * + * The default accessor for defined returns a constant boolean value of true, thus assumes that the input data is always defined. + * + * The default accessor for defined returns a constant boolean value of true, thus assumes that the input data is always defined. + * When an area is generated, the defined accessor will be invoked for each element in the input data array, + * being passed the element d, the index i, and the array data as three arguments. + * If the given element is defined (i.e., if the defined accessor returns a truthy value for this element), + * the x0, x1, y0 and y1 accessors will subsequently be evaluated and the point will be added to the current area segment. + * Otherwise, the element will be skipped, the current area segment will be ended, and a new area segment will be generated for the next defined point. + * As a result, the generated area may have several discrete segments. + * + * Note that if an area segment consists of only a single point, it may appear invisible unless rendered with rounded or square line caps. + * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points. + * + * @param defined An accessor function which returns a boolean value. The accessor will be invoked for each defined element in the input data array, + * being passed the element d, the index i, and the array data as three arguments. + */ + defined(defined: (d: Datum, index: number, data: Datum[]) => boolean): this; + + /** + * Returns the current curve factory, which defaults to curveLinear. + */ + curve(): CurveFactory; + /** + * Returns the current curve factory, which defaults to curveLinear. + * + * The generic allows to cast the curve factory to a specific type, if known. + */ + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + curve(): C; + /** + * Sets the curve factory and returns this area generator. + * + * @param curve A valid curve factory. + */ + curve(curve: CurveFactory): this; + + /** + * Returns the current rendering context, which defaults to null. + */ + context(): CanvasRenderingContext2D | null; + /** + * Sets the context and returns this area generator. + */ + context(context: CanvasRenderingContext2D | null): this; + + /** + * Returns the maximum number of digits after the decimal separator, which defaults to 3. + */ + digits(): number | null; + /** + * Sets the maximum number of digits after the decimal separator and returns this area generator. + * + * This option only applies when the associated context is null, as when this area generator is used + * to produce path data. + * + * @param digits The maximum number of digits after the decimal separator, or null for full precision. + */ + digits(digits: number | null): this; + + /** + * Returns a new line generator that has this area generator’s current defined accessor, curve and context. + * The line’s x-accessor is this area’s x0-accessor, and the line’s y-accessor is this area’s y0-accessor. + */ + lineX0(): Line; + /** + * Returns a new line generator that has this area generator’s current defined accessor, curve and context. + * The line’s x-accessor is this area’s x0-accessor, and the line’s y-accessor is this area’s y0-accessor. + */ + lineY0(): Line; + + /** + * Returns a new line generator that has this area generator’s current defined accessor, curve and context. + * The line’s x-accessor is this area’s x1-accessor, and the line’s y-accessor is this area’s y0-accessor. + */ + lineX1(): Line; + /** + * Returns a new line generator that has this area generator’s current defined accessor, curve and context. + * The line’s x-accessor is this area’s x0-accessor, and the line’s y-accessor is this area’s y1-accessor. + */ + lineY1(): Line; +} + +/** + * Constructs a new area generator with the default settings. + * + * If x, y0 or y1 are specified, sets the corresponding accessors to the specified function or number and returns this area generator. + * + * The generic refers to the data type of an element in the input array passed into the area generator. + * + * @param x Sets the x accessor. + * @param y0 Sets the y0 accessor. + * @param y1 Sets the y1 accessor. + */ +export function area( + x?: number | ((d: Datum, index: number, data: Datum[]) => number), + y0?: number | ((d: Datum, index: number, data: Datum[]) => number), + y1?: number | ((d: Datum, index: number, data: Datum[]) => number), +): Area; + +/** + * A radial area generator. + * + * A radial area generator is equivalent to the standard Cartesian area generator, + * except the x and y accessors are replaced with angle and radius accessors. + * Radial areas are always positioned relative to ⟨0,0⟩; use a transform (see: SVG, Canvas) to change the origin. + * + * The generic refers to the data type of an element in the input array passed into the area generator. + */ +export interface AreaRadial { + /** + * Generates a radial area for the given array of data. + * + * IMPORTANT: If the rendering context of the radial area generator is null, + * then the radial area is returned as a path data string. + * + * @param data Array of data elements. + */ + (data: Iterable | Datum[]): string | null; + /** + * Generates a radial area for the given array of data. + * + * IMPORTANT: If the radial area generator has been configured with a rendering context, + * then the radial area is rendered to this context as a sequence of path method calls and this function returns void. + * + * @param data Array of data elements. + */ + (data: Iterable | Datum[]): void; + + /** + * Returns the current startAngle accessor. The default startAngle accessor is a function returning the first element of a + * two-element array of numbers. + */ + angle(): (d: Datum, index: number, data: Datum[]) => number; + /** + * Sets startAngle to a constant number angle and endAngle to null and returns this radial area generator. + * + * Setting endAngle to null indicates that the previously-computed startAngle value should be reused for the endAngle value. + * + * @param angle A constant value in radians with 0 at -y (12 o’clock). + */ + angle(angle: number): this; + /** + * Sets startAngle to the specified function angle and endAngle to null and returns this radial area generator. + * + * The default startAngle accessor assumes that the input data are two-element arrays of numbers and returns the first element. + * If your data are in a different format, or if you wish to transform the data before rendering, then you should specify a custom accessor. + * + * @param angle An accessor function returning a value to be used for startAngle in radians with 0 at -y (12 o’clock). + * The accessor will be invoked for each defined element in the input data array, + * being passed the element d, the index i, and the array data as three arguments. + */ + angle(angle: (d: Datum, index: number, data: Datum[]) => number): this; + + /** + * Returns the current startAngle accessor. The default startAngle accessor is a function returning the first element of a + * two-element array of numbers. + */ + startAngle(): (d: Datum, index: number, data: Datum[]) => number; + /** + * Sets startAngle to a constant number and returns this radial area generator. + * + * @param angle A constant value in radians with 0 at -y (12 o’clock). + */ + startAngle(angle: number): this; + /** + * Sets startAngle to the specified function and returns this radial area generator. + * + * The default startAngle accessor assumes that the input data are two-element arrays of numbers and returns the first element. + * If your data are in a different format, or if you wish to transform the data before rendering, then you should specify a custom accessor. + * + * @param angle An accessor function returning a value to be used for startAngle in radians with 0 at -y (12 o’clock). + * The accessor will be invoked for each defined element in the input data array, + * being passed the element d, the index i, and the array data as three arguments. + */ + startAngle(angle: (d: Datum, index: number, data: Datum[]) => number): this; + + /** + * Returns the current endAngle accessor, which defaults to null, indicating that the previously-computed startAngle value should be reused for the endAngle value. + */ + endAngle(): ((d: Datum, index: number, data: Datum[]) => number) | null; + /** + * Equivalent to area.x1, except the accessor returns the angle in radians, with 0 at -y (12 o’clock). + * Note: typically angle is used instead of setting separate start and end angles. + */ + endAngle(angle: null | number): this; + /** + * Sets endAngle to the specified function and returns this radial area generator. + * + * The default endAngle accessor is null, indicating that the previously-computed startAngle value should be reused for the endAngle value. + * If your data are in a different format, or if you wish to transform the data before rendering, then you should specify a custom accessor. + * + * @param angle An accessor function returning a value to be used for endAngle in radians with 0 at -y (12 o’clock). + * The accessor will be invoked for each defined element in the input data array, + * being passed the element d, the index i, and the array data as three arguments. + */ + endAngle(angle: (d: Datum, index: number, data: Datum[]) => number): this; + + /** + * Returns the current innerRadius accessor. The default innerRadius accessor is a function returning a constant value of zero. + */ + radius(): (d: Datum, index: number, data: Datum[]) => number; + /** + * Sets innerRadius to a constant number radius and outerRadius to null and returns this radial area generator. + * + * Setting outerRadius to null indicates that the previously-computed innerRadius value should be reused for the outerRadius value. + * + * @param radius A constant value to be used for innerRadius. + */ + radius(radius: number): this; + /** + * Sets innerRadius to the accessor function radius and outerRadius to null and returns this radial area generator. + * + * The default innerRadius accessor returns a constant value of zero. + * If your data are in a different format, or if you wish to transform the data before rendering, then you should specify a custom accessor. + * + * @param radius An accessor function returning a value to be used for innerRadius. The accessor will be invoked for each defined element in the input data array, + * being passed the element d, the index i, and the array data as three arguments. + */ + radius(radius: (d: Datum, index: number, data: Datum[]) => number): this; + + /** + * Returns the current innerRadius accessor. The default innerRadius accessor is a function a constant value of zero. + */ + innerRadius(): (d: Datum, index: number, data: Datum[]) => number; + /** + * Sets innerRadius to a constant number and returns this radial area generator. + * + * @param radius A constant value. + */ + innerRadius(radius: number): this; + /** + * Sets innerRadius to the specified function and returns this radial area generator. + * + * The default innerRadius accessor is a function which returns a constant value of zero. + * If your data are in a different format, or if you wish to transform the data before rendering, then you should specify a custom accessor. + * + * @param radius An accessor function returning a value to be used for innerRadius. The accessor will be invoked for each defined element in the input data array, + * being passed the element d, the index i, and the array data as three arguments. + */ + innerRadius(radius: (d: Datum, index: number, data: Datum[]) => number): this; + + /** + * Returns the current outerRadius accessor or null. The default outerRadius accessor is a function returning the second element of a + * two-element array of numbers. + * + * If the outerRadius accessor is null, the previously-computed innerRadius value is reused for the outerRadius value. + */ + outerRadius(): ((d: Datum, index: number, data: Datum[]) => number) | null; + /** + * Equivalent to area.y1, except the accessor returns the radius: the distance from the origin ⟨0,0⟩. + */ + outerRadius(radius: null | number): this; + /** + * Sets outerRadius to the specified function and returns this radial area generator. + * + * The default outerRadius accessor assumes that the input data are two-element arrays of numbers and returns the second element. + * If your data are in a different format, or if you wish to transform the data before rendering, then you should specify a custom accessor. + * + * @param radius An accessor function returning a value to be used for outerRadius. The accessor will be invoked for each defined element in the input data array, + * being passed the element d, the index i, and the array data as three arguments. + */ + outerRadius(radius: (d: Datum, index: number, data: Datum[]) => number): this; + + /** + * Returns the current defined accessor, which defaults to a function returning a constant boolean value of true. + */ + defined(): (d: Datum, index: number, data: Datum[]) => boolean; + /** + * Sets the defined accessor to the specified boolean and returns this radial area generator. + * + * The default accessor for defined returns a constant boolean value of true, thus assumes that the input data is always defined. + * + * When a radial area is generated, the defined accessor will be invoked for each element in the input data array, being passed the element d, the index i, and the array data as three arguments. + * If the given element is defined (i.e., if the defined accessor returns a truthy value for this element), + * the startAngle, endAngle, innerRadius and outerRadius accessors will subsequently be evaluated and the point will be added to the current area segment. + * + * Otherwise, the element will be skipped, the current area segment will be ended, and a new area segment will be generated for the next defined point. + * As a result, the generated area may have several discrete segments. + * + * Note that if an area segment consists of only a single point, it may appear invisible unless rendered with rounded or square line caps. + * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points. + * + * @param defined A boolean constant. + */ + defined(defined: boolean): this; + /** + * Sets the defined accessor to the specified function and returns this radial area generator. + * + * The default accessor for defined returns a constant boolean value of true, thus assumes that the input data is always defined. + * + * When a radial area is generated, the defined accessor will be invoked for each element in the input data array, being passed the element d, the index i, and the array data as three arguments. + * If the given element is defined (i.e., if the defined accessor returns a truthy value for this element), + * the startAngle, endAngle, innerRadius and outerRadius accessors will subsequently be evaluated and the point will be added to the current area segment. + * + * Otherwise, the element will be skipped, the current area segment will be ended, and a new area segment will be generated for the next defined point. + * As a result, the generated area may have several discrete segments. + * + * Note that if an area segment consists of only a single point, it may appear invisible unless rendered with rounded or square line caps. + * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points. + * + * @param defined An accessor function which returns a boolean value. The accessor will be invoked for each defined element in the input data array, + * being passed the element d, the index i, and the array data as three arguments. + */ + defined(defined: (d: Datum, index: number, data: Datum[]) => boolean): this; + + /** + * Returns the current curve factory, which defaults to curveLinear. + */ + curve(): CurveFactory; + /** + * Returns the current curve factory, which defaults to curveLinear. + * + * The generic allows to cast the curve factory to a specific type, if known. + */ + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + curve(): C; + /** + * Sets the curve factory and returns this radial area generator. + * + * Note that curveMonotoneX or curveMonotoneY are not recommended for radial areas because they assume that the data is monotonic in x or y, which is typically untrue of radial areas. + * + * @param curve A valid curve factory. + */ + curve(curve: CurveFactory): this; + + /** + * Returns the current rendering context, which defaults to null. + */ + context(): CanvasRenderingContext2D | null; + /** + * Equivalent to line.context. + */ + context(context: CanvasRenderingContext2D | null): this; + + /** + * Returns the maximum number of digits after the decimal separator, which defaults to 3. + */ + digits(): number | null; + /** + * Sets the maximum number of digits after the decimal separator and returns this radial area generator. + * + * This option only applies when the associated context is null, as when this radial area generator is used + * to produce path data. + * + * @param digits The maximum number of digits after the decimal separator, or null for full precision. + */ + digits(digits: number | null): this; + + /** + * Returns a new radial line generator that has this radial area generator’s current defined accessor, curve and context. + * The line’s angle accessor is this area’s start angle accessor, and the line’s radius accessor is this area’s inner radius accessor. + */ + lineStartAngle(): LineRadial; + + /** + * Returns a new radial line generator that has this radial area generator’s current defined accessor, curve and context. + * The line’s angle accessor is this area’s start angle accessor, and the line’s radius accessor is this area’s inner radius accessor. + */ + lineInnerRadius(): LineRadial; + + /** + * Returns a new radial line generator that has this radial area generator’s current defined accessor, curve and context. + * The line’s angle accessor is this area’s end angle accessor, and the line’s radius accessor is this area’s inner radius accessor. + */ + lineEndAngle(): LineRadial; + + /** + * Returns a new radial line generator that has this radial area generator’s current defined accessor, curve and context. + * The line’s angle accessor is this area’s start angle accessor, and the line’s radius accessor is this area’s outer radius accessor. + */ + lineOuterRadius(): LineRadial; +} + +/** + * Constructs a new radial area generator with the default settings. + * + * Ensure that the accessors used with the area generator correspond to the arguments passed into them, + * or set them to constants as appropriate. + */ +export function areaRadial(): AreaRadial<[number, number]>; +/** + * Constructs a new radial area generator with the default settings. + * + * Ensure that the accessors used with the area generator correspond to the arguments passed into them, + * or set them to constants as appropriate. + * + * The generic refers to the data type of an element in the input array passed into the radial area generator. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function areaRadial(): AreaRadial; + +/** + * @deprecated Use AreaRadial interface + */ +export type RadialArea = AreaRadial; + +/** + * @deprecated Use areaRadial() + */ +export function radialArea(): RadialArea<[number, number]>; +/** + * @deprecated Use areaRadial() + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function radialArea(): RadialArea; + +// ----------------------------------------------------------------------------------- +// Curve Factories +// ----------------------------------------------------------------------------------- + +/** + * A minimal interface for a curve generator which supports only the rendering of lines. + * Methods for related to the rendering of areas are not implemented in this minimal interface. + * + * While lines are defined as a sequence of two-dimensional [x, y] points, + * there remains the task of transforming this discrete representation into a continuous shape: i.e., how to interpolate between the points. + * A curve generator serves this purpose. + * + * Curves are typically not constructed or used directly, instead being passed to line.curve. + */ +export interface CurveGeneratorLineOnly { + /** + * Indicates the start of a new line segment. Zero or more points will follow. + */ + lineStart(): void; + /** + * Indicates the end of the current line segment. + */ + lineEnd(): void; + /** + * Indicates a new point in the current line segment with the given x- and y-values. + */ + point(x: number, y: number): void; +} + +/** + * A factory for curve generators addressing only lines, but not areas. + */ +export type CurveFactoryLineOnly = + /** + * Returns a "lines only" curve generator which renders to the specified context. + * + * @param context A rendering context. + */ + (context: CanvasRenderingContext2D | Path) => CurveGeneratorLineOnly; + +/** + * A minimal interface for a curve generator which supports the rendering of lines and areas. + * + * While lines are defined as a sequence of two-dimensional [x, y] points, + * and areas are similarly defined by a topline and a baseline, + * there remains the task of transforming this discrete representation into a continuous shape: i.e., how to interpolate between the points. + * A curve generator serves this purpose. + * + * Curves are typically not constructed or used directly, instead being passed to line.curve and area.curve. + */ +export interface CurveGenerator extends CurveGeneratorLineOnly { + /** + * Indicates the start of a new area segment. + * Each area segment consists of exactly two line segments: the topline, followed by the baseline, with the baseline points in reverse order. + */ + areaStart(): void; + /** + * Indicates the end of the current area segment. + */ + areaEnd(): void; +} + +/** + * A factory for curve generators addressing both lines and areas. + */ +export type CurveFactory = + /** + * Returns a curve generator which renders to the specified context. + * + * @param context A rendering context. + */ + (context: CanvasRenderingContext2D | Path) => CurveGenerator; + +/** + * A curve factory for cubic basis spline generators. + * + * The curve generators produce a cubic basis spline using the specified control points. + * The first and last points are triplicated such that the spline starts at the first point and ends at the last point, + * and is tangent to the line between the first and second points, and to the line between the penultimate and last points. + */ +export const curveBasis: CurveFactory; + +/** + * A curve factory for closed cubic basis spline generators. + * + * The curve generators produce a closed cubic basis spline using the specified control points. + * When a line segment ends, the first three control points are repeated, producing a closed loop with C2 continuity. + */ +export const curveBasisClosed: CurveFactory; + +/** + * A curve factory for open cubic basis spline generators. + * + * The curve generators produce a cubic basis spline using the specified control points. + * Unlike basis, the first and last points are not repeated, and thus the curve typically does not intersect these points. + */ +export const curveBasisOpen: CurveFactory; + +/** + * Produces a Bézier curve between each pair of points, with horizontal tangents at each point. + */ +export const curveBumpX: CurveFactory; + +/** + * Produces a Bézier curve between each pair of points, with vertical tangents at each point. + */ +export const curveBumpY: CurveFactory; + +/** + * A curve factory for straightened cubic basis spline generators. + * + * The curve generators produce a straightened cubic basis spline using the specified control points, + * with the spline straightened according to the curve’s beta, which defaults to 0.85. + * This curve is typically used in hierarchical edge bundling to disambiguate connections, + * as proposed by Danny Holten in Hierarchical Edge Bundles: Visualization of Adjacency Relations in Hierarchical Data. + * + * This curve does not implement curve.areaStart and curve.areaEnd; it is intended to work with d3.line, not d3.area. + */ +export interface CurveBundleFactory extends CurveFactoryLineOnly { + /** + * Returns a bundle curve factory with the specified beta in the range [0, 1], representing the bundle strength. + * If beta equals zero, a straight line between the first and last point is produced; if beta equals one, + * a standard basis spline is produced. + * + * @param beta A constant value in the [0, 1] interval. + */ + beta(beta: number): this; +} + +/** + * A curve factory for straightened cubic basis spline generators. + * + * The curve generators produce a straightened cubic basis spline using the specified control points, + * with the spline straightened according to the curve’s beta, which defaults to 0.85. + * This curve is typically used in hierarchical edge bundling to disambiguate connections, + * as proposed by Danny Holten in Hierarchical Edge Bundles: Visualization of Adjacency Relations in Hierarchical Data. + * + * This curve does not implement curve.areaStart and curve.areaEnd; it is intended to work with d3.line, not d3.area. + */ +export const curveBundle: CurveBundleFactory; + +/** + * A curve factory for cubic cardinal spline generators. + */ +export interface CurveCardinalFactory extends CurveFactory { + /** + * Returns a cardinal curve factory with the specified tension in the range [0, 1]. + * The tension determines the length of the tangents: a tension of one yields all zero tangents, equivalent to curveLinear; a tension of zero produces a uniform Catmull–Rom spline. + * + * @param tension A constant in the [0, 1] interval. + */ + tension(tension: number): this; +} + +/** + * A curve factory for cubic cardinal spline generators. + * + * The curve generators produce a cubic cardinal spline using the specified control points, with one-sided differences used for the first and last piece. + * The default tension is 0. + */ +export const curveCardinal: CurveCardinalFactory; + +/** + * A curve factory for closed cubic cardinal spline generators. + * + * The curve generators produce closed cubic cardinal spline using the specified control points. + * When a line segment ends, the first three control points are repeated, producing a closed loop. + * The default tension is 0. + */ +export const curveCardinalClosed: CurveCardinalFactory; + +/** + * A curve factory for open cubic cardinal spline generators. + * + * The curve generators produce a cubic cardinal spline using the specified control points. + * Unlike curveCardinal, one-sided differences are not used for the first and last piece, + * and thus the curve starts at the second point and ends at the penultimate point. + * The default tension is 0. + */ +export const curveCardinalOpen: CurveCardinalFactory; + +/** + * A curve factory for cubic Catmull–Rom spline generators. + */ +export interface CurveCatmullRomFactory extends CurveFactory { + /** + * Returns a cubic Catmull–Rom curve factory with the specified alpha in the range [0, 1]. + * If alpha is zero, produces a uniform spline, equivalent to curveCardinal with a tension of zero; + * if alpha is one, produces a chordal spline; if alpha is 0.5, produces a centripetal spline. + * Centripetal splines are recommended to avoid self-intersections and overshoot. + * + * @param alpha A constant in the [0, 1] interval. + */ + alpha(alpha: number): this; +} + +/** + * A curve factory for cubic Catmull–Rom spline generators. + * + * The curve generators produce a cubic Catmull–Rom spline using the specified control points and the parameter alpha, + * which defaults to 0.5, as proposed by Yuksel et al. in On the Parameterization of Catmull–Rom Curves, + * with one-sided differences used for the first and last piece. + */ +export const curveCatmullRom: CurveCatmullRomFactory; + +/** + * A curve factory for cubic Catmull–Rom spline generators. + * + * The curve generators produce a closed cubic Catmull–Rom spline using the specified control points and the parameter alpha, + * which defaults to 0.5, as proposed by Yuksel et al. When a line segment ends, + * the first three control points are repeated, producing a closed loop. + */ +export const curveCatmullRomClosed: CurveCatmullRomFactory; + +/** + * A curve factory for cubic Catmull–Rom spline generators. + * + * The curve generators produce a cubic Catmull–Rom spline using the specified control points and the parameter alpha, + * which defaults to 0.5, as proposed by Yuksel et al. Unlike curveCatmullRom, one-sided differences are not used for the first and last piece, + * and thus the curve starts at the second point and ends at the penultimate point. + */ +export const curveCatmullRomOpen: CurveCatmullRomFactory; + +/** + * A curve factory for polyline generators. + * + * The curve generators produce a polyline through the specified points. + */ +export const curveLinear: CurveFactory; + +/** + * A curve factory for closed polyline generators. + * + * The curve generators produce a closed polyline through the specified points by repeating the first point when the line segment ends. + */ +export const curveLinearClosed: CurveFactory; + +/** + * A curve factory for cubic spline generators preserving monotonicity in y. + * + * The curve generators produce a cubic spline that preserves monotonicity in y, assuming monotonicity in x, as proposed by Steffen in A simple method for monotonic interpolation in one dimension: + * “a smooth curve with continuous first-order derivatives that passes through any given set of data points without spurious oscillations. + * Local extrema can occur only at grid points where they are given by the data, but not in between two adjacent grid points.” + */ +export const curveMonotoneX: CurveFactory; + +/** + * A curve factory for cubic spline generators preserving monotonicity in x. + * + * The curve generators produce a cubic spline that preserves monotonicity in x, assuming monotonicity in y, as proposed by Steffen in A simple method for monotonic interpolation in one dimension: + * “a smooth curve with continuous first-order derivatives that passes through any given set of data points without spurious oscillations. + * Local extrema can occur only at grid points where they are given by the data, but not in between two adjacent grid points.” + */ +export const curveMonotoneY: CurveFactory; + +/** + * A curve factory for natural cubic spline generators. + * + * The curve generators produce a natural cubic spline with the second derivative of the spline set to zero at the endpoints. + */ +export const curveNatural: CurveFactory; + +/** + * A curve factory for step function (midpoint) generators. + * + * The curve generators produce a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. + * The y-value changes at the midpoint of each pair of adjacent x-values. + */ +export const curveStep: CurveFactory; + +/** + * A curve factory for step function (after) generators. + * + * The curve generators produce a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. + * The y-value changes after the x-value. + */ +export const curveStepAfter: CurveFactory; + +/** + * A curve factory for step function (before) generators. + * + * The curve generators produce a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. + * The y-value changes before the x-value. + */ +export const curveStepBefore: CurveFactory; + +// ----------------------------------------------------------------------------------- +// LINKS +// ----------------------------------------------------------------------------------- + +/** + * An interface describing the default Link Data structure expected + * by the Link and LinkRadial generators. + */ +export interface DefaultLinkObject { + /** + * Source node of the link. + * + * For a link in a Cartesian coordinate system, the two element array contains + * the coordinates [x, y]. + * + * For a radial link, the two element array contains + * the coordinates [angle, radius]. The angle is stated in radians, with 0 at -y (12 o’clock). + * The radius measures the distance from the origin ⟨0,0⟩. + */ + source: [number, number]; + /** + * Target node of the link. + * + * For a link in a Cartesian coordinate system, the two element array contains + * the coordinates [x, y]. + * + * For a radial link, the two element array contains + * the coordinates [angle, radius]. The angle is stated in radians, with 0 at -y (12 o’clock). + * The radius measures the distance from the origin ⟨0,0⟩. + */ + target: [number, number]; +} + +/** + * A link generator for a Cartesian coordinate system. The link shape generates a smooth cubic Bézier curve from a + * source point to a target point. The tangents of the curve at the start and end are either vertical, horizontal. + * + * The first generic corresponds to the type of the "this" context within which the link generator and its accessor functions will be invoked. + * + * The second generic corresponds to the datum type of the link object for which the link is to be generated. + * + * The third generic corresponds to the datum type of the source/target node contained in the link object. + */ +export interface Link { + /** + * Generates a link for the given arguments. + * + * IMPORTANT: If the rendering context of the link generator is null, + * then the link is returned as a path data string. + * + * The "this" context within which this function is invoked, will be the context within which the accessor methods of the generator are invoked. + * All arguments passed into this function, will be passed to the accessor functions of the generator. + * + * @param d The datum for which the link is to be generated. + */ + (this: This, d: LinkDatum, ...args: any[]): string | null; + /** + * Generates an link for the given arguments. + * + * IMPORTANT: If the link generator has been configured with a rendering context, + * then the link is rendered to this context as a sequence of path method calls and this function returns void. + * + * The "this" context within which this function is invoked, will be the context within which the accessor methods of the generator are invoked. + * All arguments passed into this function, will be passed to the accessor functions of the generator. + * + * @param d The datum for which the link is to be generated. + */ + (this: This, d: LinkDatum, ...args: any[]): void; + + /** + * Returns the current source node accessor function. + * The default source accessor function returns a two element array [x, y]. + */ + source(): (this: This, d: LinkDatum, ...args: any[]) => NodeDatum; + /** + * Sets the source accessor to the specified function and returns this link generator. + * + * @param source Source node accessor function. The accessor function is invoked in the same "this" context as the generator was invoked in and + * receives the same arguments that were passed into the link generator. The default target accessor function returns a two element array [x, y]. + */ + source(source: (this: This, d: LinkDatum, ...args: any[]) => NodeDatum): this; + + /** + * Returns the current target node accessor function. + * The default target accessor function returns a two element array [x, y]. + */ + target(): (this: This, d: LinkDatum, ...args: any[]) => NodeDatum; + /** + * Sets the target accessor to the specified function and returns this link generator. + * + * @param target Target node accessor function. The accessor function is invoked in the same "this" context as the generator was invoked in and + * receives the same arguments that were passed into the link generator. The default target accessor function returns a two element array [x, y]. + */ + target(target: (this: This, d: LinkDatum, ...args: any[]) => NodeDatum): this; + + /** + * Returns the current x-accessor, which defaults to a function accepting an number array + * as its argument an returning the first element of the array. + */ + x(): (this: This, node: NodeDatum, ...args: any[]) => number; + /** + * Sets the x-accessor to the specified function and returns this link generator. + * + * @param x x-coordinate accessor function. The accessor function is invoked in the same "this" context as the generator was invoked in and + * receives as its first argument a node object followed by all additional arguments that were passed into the link generator. + */ + x(x: (this: This, node: NodeDatum, ...args: any[]) => number): this; + + /** + * Returns the current y-accessor, which defaults to a function accepting an number array + * as its argument an returning the second element of the array. + */ + y(): (this: This, node: NodeDatum, ...args: any[]) => number; + /** + * Sets the y-accessor to the specified function and returns this link generator. + * + * @param y y-coordinate accessor function. The accessor function is invoked in the same "this" context as the generator was invoked in and + * receives as its first argument a node object followed by all additional arguments that were passed into the link generator. + */ + y(y: (this: This, node: NodeDatum, ...args: any[]) => number): this; + + /** + * Returns the current rendering context, which defaults to null. + */ + context(): CanvasRenderingContext2D | null; + /** + * Sets the context and returns this link generator. + */ + context(context: CanvasRenderingContext2D | null): this; + + /** + * Returns the maximum number of digits after the decimal separator, which defaults to 3. + */ + digits(): number | null; + /** + * Sets the maximum number of digits after the decimal separator and returns this link generator. + * + * This option only applies when the associated context is null, as when this link generator is used + * to produce path data. + * + * @param digits The maximum number of digits after the decimal separator, or null for full precision. + */ + digits(digits: number | null): this; +} + +/** + * Returns a new link generator using the specified curve. For example, to visualize links in a tree diagram rooted on the top edge of the display + * + * With the default settings the link generator accepts a link object conforming to the DefaultLinkObject interface. + */ +export function link(curve: CurveFactory): Link; +/** + * Returns a new link generator using the specified curve. For example, to visualize links in a tree diagram rooted on the top edge of the display + * + * Important: Ensure that the accessor functions are configured to work with the link and node datum types + * specified in the generics. + * + * The first generic corresponds to the datum type of the link object for which the link is to be generated. + * + * The second generic corresponds to the datum type of the source/target node contained in the link object. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function link(curve: CurveFactory): Link; +/** + * Returns a new link generator using the specified curve. For example, to visualize links in a tree diagram rooted on the top edge of the display + * + * Important: Ensure that the accessor functions are configured to work with the link and node datum types + * specified in the generics. + * + * The first generic corresponds to the type of the "this" context within which the link generator and its accessor functions will be invoked. + * + * The second generic corresponds to the datum type of the link object for which the link is to be generated. + * + * The third generic corresponds to the datum type of the source/target node contained in the link object. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function link(curve: CurveFactory): Link; + +/** + * Shorthand for d3.link with d3.curveBumpX; suitable for visualizing links in a tree diagram rooted on the left edge of the display. + * + * With the default settings the link generator accepts a link object conforming to the DefaultLinkObject interface. + */ +export function linkHorizontal(): Link; +/** + * Shorthand for d3.link with d3.curveBumpX; suitable for visualizing links in a tree diagram rooted on the left edge of the display. + * + * Important: Ensure that the accessor functions are configured to work with the link and node datum types + * specified in the generics. + * + * The first generic corresponds to the datum type of the link object for which the link is to be generated. + * + * The second generic corresponds to the datum type of the source/target node contained in the link object. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function linkHorizontal(): Link; +/** + * Shorthand for d3.link with d3.curveBumpX; suitable for visualizing links in a tree diagram rooted on the left edge of the display. + * + * Important: Ensure that the accessor functions are configured to work with the link and node datum types + * specified in the generics. + * + * The first generic corresponds to the type of the "this" context within which the link generator and its accessor functions will be invoked. + * + * The second generic corresponds to the datum type of the link object for which the link is to be generated. + * + * The third generic corresponds to the datum type of the source/target node contained in the link object. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function linkHorizontal(): Link; + +/** + * Shorthand for d3.link with d3.curveBumpX; suitable for visualizing links in a tree diagram rooted on the left edge of the display. + * + * With the default settings the link generator accepts a link object conforming to the DefaultLinkObject interface. + */ +export function linkVertical(): Link; +/** + * Shorthand for d3.link with d3.curveBumpY; suitable for visualizing links in a tree diagram rooted on the top edge of the display. + * + * Important: Ensure that the accessor functions are configured to work with the link and node datum types + * specified in the generics. + * + * The first generic corresponds to the datum type of the link object for which the link is to be generated. + * + * The second generic corresponds to the datum type of the source/target node contained in the link object. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function linkVertical(): Link; +/** + * Shorthand for d3.link with d3.curveBumpY; suitable for visualizing links in a tree diagram rooted on the top edge of the display. + * + * Important: Ensure that the accessor functions are configured to work with the link and node datum types + * specified in the generics. + * + * The first generic corresponds to the type of the "this" context within which the link generator and its accessor functions will be invoked. + * + * The second generic corresponds to the datum type of the link object for which the link is to be generated. + * + * The third generic corresponds to the datum type of the source/target node contained in the link object. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function linkVertical(): Link; + +/** + * Shorthand for d3.link with d3.curveBumpY; suitable for visualizing links in a tree diagram rooted on the top edge of the display. + * + * The first generic corresponds to the type of the "this" context within which the radial link generator and its accessor functions will be invoked. + * + * The second generic corresponds to the datum type of the link object for which the link is to be generated. + * + * The third generic corresponds to the datum type of the source/target node contained in the link object. + */ +export interface LinkRadial { + /** + * Generates a radial link for the given arguments. + * + * IMPORTANT: If the rendering context of the radial link generator is null, + * then the link is returned as a path data string. + * + * The "this" context within which this function is invoked, will be the context within which the accessor methods of the generator are invoked. + * All arguments passed into this function, will be passed to the accessor functions of the generator. + * + * @param d The datum for which the link is to be generated. + */ + (this: This, d: LinkDatum, ...args: any[]): string | null; + /** + * Generates an link for the given arguments. + * + * IMPORTANT: If the radial link generator has been configured with a rendering context, + * then the link is rendered to this context as a sequence of path method calls and this function returns void. + * + * The "this" context within which this function is invoked, will be the context within which the accessor methods of the generator are invoked. + * All arguments passed into this function, will be passed to the accessor functions of the generator. + * + * @param d The datum for which the link is to be generated. + */ + (this: This, d: LinkDatum, ...args: any[]): void; + + /** + * Returns the current source node accessor function. + * The default source accessor function returns a two element array [x, y]. + */ + source(): (this: This, d: LinkDatum, ...args: any[]) => NodeDatum; + /** + * Sets the source accessor to the specified function and returns this radial link generator. + * + * @param source Source node accessor function. The accessor function is invoked in the same "this" context as the generator was invoked in and + * receives the same arguments that were passed into the radial link generator. The default target accessor function returns a two element array [x, y]. + */ + source(source: (this: This, d: LinkDatum, ...args: any[]) => NodeDatum): this; + + /** + * Returns the current target node accessor function. + * The default target accessor function returns a two element array [x, y]. + */ + target(): (this: This, d: LinkDatum, ...args: any[]) => NodeDatum; + /** + * Sets the target accessor to the specified function and returns this radial link generator. + * + * @param target Target node accessor function. The accessor function is invoked in the same "this" context as the generator was invoked in and + * receives the same arguments that were passed into the radial link generator. The default target accessor function returns a two element array [x, y]. + */ + target(target: (this: This, d: LinkDatum, ...args: any[]) => NodeDatum): this; + + /** + * Returns the current angle accessor, which defaults to a function accepting an number array + * as its argument an returning the first element of the array. + */ + angle(): (this: This, node: NodeDatum, ...args: any[]) => number; + /** + * Sets the angle accessor to the specified function and returns this radial link generator. + * The angle is stated in radians, with 0 at -y (12 o’clock). + * + * @param angle Angle accessor function. The accessor function is invoked in the same "this" context as the generator was invoked in and + * receives as its first argument a node object followed by all additional arguments that were passed into the radial link generator. + */ + angle(angle: (this: This, node: NodeDatum, ...args: any[]) => number): this; + + /** + * Returns the current radius accessor, which defaults to a function accepting an number array + * as its argument an returning the second element of the array. + */ + radius(): (this: This, node: NodeDatum, ...args: any[]) => number; + /** + * Sets the radius accessor to the specified function and returns this radial link generator. + * The radius is measured as the distance from the origin ⟨0,0⟩. + * + * @param radius Radius accessor function. The accessor function is invoked in the same "this" context as the generator was invoked in and + * receives as its first argument a node object followed by all additional arguments that were passed into the radial link generator. + */ + radius(radius: (this: This, node: NodeDatum, ...args: any[]) => number): this; + + /** + * Returns the current rendering context, which defaults to null. + */ + context(): CanvasRenderingContext2D | null; + /** + * Sets the context and returns this link generator. + */ + context(context: CanvasRenderingContext2D | null): this; + + /** + * Returns the maximum number of digits after the decimal separator, which defaults to 3. + */ + digits(): number | null; + /** + * Sets the maximum number of digits after the decimal separator and returns this radial link generator. + * + * This option only applies when the associated context is null, as when this radial link generator is used + * to produce path data. + * + * @param digits The maximum number of digits after the decimal separator, or null for full precision. + */ + digits(digits: number | null): this; +} + +/** + * @deprecated Use LinkRadial interface + */ +export type RadialLink = LinkRadial; + +/** + * Constructs a new default link generator with radial tangents, for example, to visualize links in a tree diagram + * rooted in the center of the display. + * + * With the default settings the link generator accepts a link object conforming to the DefaultLinkObject interface. + */ +export function linkRadial(): LinkRadial; +/** + * Constructs a new link generator with radial tangents, for example, to visualize links in a tree diagram + * rooted in the center of the display. + * + * Important: Ensure that the accessor functions are configured to work with the link and node datum types + * specified in the generics. + * + * The first generic corresponds to the datum type of the link object for which the link is to be generated. + * + * The second generic corresponds to the datum type of the source/target node contained in the link object. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function linkRadial(): LinkRadial; +/** + * Constructs a new link generator with radial tangents, for example, to visualize links in a tree diagram + * rooted in the center of the display. + * + * Important: Ensure that the accessor functions are configured to work with the link and node datum types + * specified in the generics. + * + * The first generic corresponds to the type of the "this" context within which the link generator and its accessor functions will be invoked. + * + * The second generic corresponds to the datum type of the link object for which the link is to be generated. + * + * The third generic corresponds to the datum type of the source/target node contained in the link object. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function linkRadial(): LinkRadial; + +// ----------------------------------------------------------------------------------- +// SYMBOLS +// ----------------------------------------------------------------------------------- + +/** + * A Symbol Type. + * + * Symbol types are typically not used directly, instead being passed to symbol.type. + * However, you can define your own symbol type implementation should none of the built-in types satisfy your needs using the following interface. + * You can also use this low-level interface with a built-in symbol type as an alternative to the symbol generator. + */ +export interface SymbolType { + /** + * Renders this symbol type to the specified context with the specified size in square pixels. The context implements the CanvasPath interface. + * (Note that this is a subset of the CanvasRenderingContext2D interface!) + * + * @param context A rendering context implementing CanvasPath. + * @param size Size of the symbol to draw. + */ + draw(context: CanvasPath_D3Shape, size: number): void; +} + +/** + * A symbol generator. + * + * Symbols provide a categorical shape encoding as is commonly used in scatterplots. Symbols are always centered at ⟨0,0⟩; + * use a transform (see: SVG, Canvas) to move the arc to a different position. + * + * The first generic corresponds to the "this" context within which the symbol generator is invoked. + * The second generic corresponds to the data type of the datum underlying the symbol. + */ +export interface Symbol { + /** + * Generates a symbol for the given arguments. + * + * IMPORTANT: If the rendering context of the symbol generator is null, + * then the symbol is returned as a path data string. + * + * The "this" context within which this function is invoked, will be the context within which the accessor methods of the generator are invoked. + * All arguments passed into this function, will be passed to the accessor functions of the generator. + * + * For example, with the default settings, no arguments are needed to produce a circle with area 64 square pixels. + * + * @param d The datum for which the symbol is to be generated. + */ + (this: This, d?: Datum, ...args: any[]): string | null; + /** + * Generates an symbol for the given arguments. + * + * IMPORTANT: If the symbol generator has been configured with a rendering context, + * then the symbol is rendered to this context as a sequence of path method calls and this function returns void. + * + * The "this" context within which this function is invoked, will be the context within which the accessor methods of the generator are invoked. + * All arguments passed into this function, will be passed to the accessor functions of the generator. + * + * For example, with the default settings, no arguments are needed to produce a circle with area 64 square pixels. + * + * @param d The datum for which the symbol is to be generated. + */ + (this: This, d?: Datum, ...args: any[]): void; + /** + * Returns the current size accessor, which defaults to a function returning a constant value of 64. + */ + size(): (this: This, d: Datum, ...args: any[]) => number; + /** + * Sets the size to the specified number and returns this symbol generator. + * + * @param size A fixed size (area in square pixels). + */ + size(size: number): this; + /** + * Sets the size to the specified function and returns this symbol generator. + * + * Specifying the size as a function is useful for constructing a scatterplot with a size encoding. + * If you wish to scale the symbol to fit a given bounding box, rather than by area, try SVG’s getBBox. + * + * @param size An accessor function returning a number to be used as a symbol size. The accessor function is invoked in the same "this" context as the generator was invoked in and + * receives the same arguments that were passed into the symbol generator. + */ + size(size: (this: This, d: Datum, ...args: any[]) => number): this; + + /** + * Returns the current symbol type accessor, which defaults to a function returning the circle symbol type. + */ + type(): (this: This, d: Datum, ...args: any[]) => SymbolType; + /** + * Sets the symbol type to the specified symbol type and returns this symbol generator. + * + * @param type A constant symbol type. + */ + type(type: SymbolType): this; + /** + * Sets the symbol type to the specified function and returns this symbol generator. + * + * @param type An accessor function returning a symbol type. The accessor function is invoked in the same "this" context as the generator was invoked in and + * receives the same arguments that were passed into the symbol generator. See symbols for the set of built-in symbol types. + * To implement a custom symbol type, return an object that implements symbolType.draw. + */ + type(type: (this: This, d: Datum, ...args: any[]) => SymbolType): this; + + /** + * Returns the current rendering context, which defaults to null. + */ + context(): CanvasRenderingContext2D | null; + /** + * Sets the context and returns this symbol generator. + */ + context(context: CanvasRenderingContext2D | null): this; + + /** + * Returns the maximum number of digits after the decimal separator, which defaults to 3. + */ + digits(): number | null; + /** + * Sets the maximum number of digits after the decimal separator and returns this symbol generator. + * + * This option only applies when the associated context is null, as when this symbol generator is used + * to produce path data. + * + * @param digits The maximum number of digits after the decimal separator, or null for full precision. + */ + digits(digits: number | null): this; +} + +/** + * Constructs a new symbol generator of the specified type and size. + * If not specified, type defaults to a circle, and size defaults to 64. + * + * The first generic corresponds to the "this" context within which the symbol generator is invoked. + * The second generic corresponds to the data type of the datum underlying the symbol. + * + * @param type The specified type. + * @param size The specified size. + */ +export function symbol( + type?: SymbolType | ((this: any, d: Datum, ...args: any[]) => SymbolType), + size?: number | ((this: any, d: Datum, ...args: any[]) => number), +): Symbol; + +/** + * Constructs a new symbol generator of the specified type and size. + * If not specified, type defaults to a circle, and size defaults to 64. + * + * The first generic corresponds to the "this" context within which the symbol generator is invoked. + * The second generic corresponds to the data type of the datum underlying the symbol. + * + * @param type The specified type. + * @param size The specified size. + */ +export function symbol( + type?: SymbolType | ((this: This, d: Datum, ...args: any[]) => SymbolType), + size?: number | ((this: This, d: Datum, ...args: any[]) => number), +): Symbol; + +/** + * An array containing a set of symbol types designed for filling: circle, cross, diamond, square, star, triangle, and wye. + * Useful for constructing the range of an ordinal scale should you wish to use a shape encoding for categorical data. + */ +export const symbolsFill: SymbolType[]; + +/** + * An array containing a set of symbol types designed for stroking: circle, plus, x, triangle2, asterisk, square2, and diamond2. + * Useful for constructing the range of an ordinal scale should you wish to use a shape encoding for categorical data. + */ +export const symbolsStroke: SymbolType[]; + +/** + * @deprecated Use symbolsFill + */ +export const symbols: SymbolType[]; + +/** + * The asterisk symbol type; intended for stroking. + */ +export const symbolAsterisk: SymbolType; + +/** + * The circle symbol type; intended for either filling or stroking. + */ +export const symbolCircle: SymbolType; + +/** + * The Greek cross symbol type, with arms of equal length; intended for filling. + */ +export const symbolCross: SymbolType; + +/** + * The rhombus symbol type; intended for filling. + */ +export const symbolDiamond: SymbolType; + +/** + * The rotated square symbol type; intended for stroking. + */ +export const symbolDiamond2: SymbolType; + +/** + * The plus symbol type; intended for stroking. + */ +export const symbolPlus: SymbolType; + +/** + * The square symbol type; intended for filling. + */ +export const symbolSquare: SymbolType; + +/** + * The square2 symbol type; intended for stroking. + */ +export const symbolSquare2: SymbolType; + +/** + * The pentagonal star (pentagram) symbol type; intended for filling. + */ +export const symbolStar: SymbolType; + +/** + * The up-pointing triangle symbol type; intended for filling. + */ +export const symbolTriangle: SymbolType; + +/** + * The up-pointing triangle symbol type; intended for stroking. + */ +export const symbolTriangle2: SymbolType; + +/** + * The Y-shape symbol type; intended for filling. + */ +export const symbolWye: SymbolType; + +/** + * The X-shape symbol type; intended for stroking. + */ +export const symbolX: SymbolType; + +/** + * The X-shape symbol type; intended for stroking. + */ +export const symbolTimes: SymbolType; + +// ----------------------------------------------------------------------------------- +// pointRadial +// ----------------------------------------------------------------------------------- + +/** + * Returns the point [x, y] for the given angle and the given radius. + * @param angle Angle in radians, with 0 at -y (12 o’clock) and positive angles proceeding clockwise. + * @param radius Radius. + */ +export function pointRadial(angle: number, radius: number): [number, number]; + +// ----------------------------------------------------------------------------------- +// STACKS +// ----------------------------------------------------------------------------------- + +/** + * Each series point j in a stack chart corresponds to the jth element in the input data. + * Each point is represented as an array [y0, y1] where y0 is the lower value (baseline) and y1 is the upper value (topline); + * the difference between y0 and y1 corresponds to the computed value for this point. + * + * SeriesPoint is a [number, number] two-element Array with added data and index properties + * related to the data element which formed the basis for theSeriesPoint. + */ +export interface SeriesPoint extends Array { + /** + * Corresponds to y0, the lower value (baseline). + */ + 0: number; + /** + * Corresponds to y1, the upper value (topline). + */ + 1: number; + /** + * The data element underlying the series point. + */ + data: Datum; +} + +/** + * The series are determined by the keys accessor; each series i in the returned array corresponds to the ith key. + * Each series is an array of points, where each point j corresponds to the jth element in the input data. + * + * The key for each series is available as series.key, and the index as series.index. + */ +export interface Series extends Array> { + /** + * Key of the series. + */ + key: Key; + /** + * Index of the series in the series array returned by stack generator. + */ + index: number; +} + +/** + * A stack generator. + * + * Some shape types can be stacked, placing one shape adjacent to another. + * For example, a bar chart of monthly sales might be broken down into a multi-series bar chart by product category, stacking bars vertically. + * This is equivalent to subdividing a bar chart by an ordinal dimension (such as product category) and applying a color encoding. + * + * Stacked charts can show overall value and per-category value simultaneously; however, it is typically harder to compare across categories, as only the bottom layer of the stack is aligned. + * So, chose the stack order carefully, and consider a streamgraph. (See also grouped charts.) + * + * Like the pie generator, the stack generator does not produce a shape directly. Instead it computes positions which you can then pass to an area generator or use directly, say to position bars. + * + * The first generic corresponds to the "this" context in which the stack generator and its accessor functions are invoked. + * + * The second generic corresponds to the data type of an element in the data array passed into the stack generator. + * + * The third generic corresponds to the data type of key used to identify a series. + */ +export interface Stack { + /** + * Generates a stack for the given array of data, returning an array representing each series. + * The resulting array has one element per series. Each series in then typically passed to an area generator to render an area chart, + * or used to construct rectangles for a bar chart. + * + * Any additional arguments are arbitrary; they are simply propagated to the generator’s accessor functions along with the this object. + * + * @param data Array of data elements. + */ + (data: Iterable, ...args: any[]): Array>; + + /** + * Returns the current keys accessor, which defaults to the empty array. + */ + keys(): (this: This, data: Datum[], ...args: any[]) => Key[]; + /** + * Sets the keys accessor to the specified function or array and returns this stack generator. + * A series (layer) is generated for each key. + * Keys are typically strings, but they may be arbitrary values. + * The series’ key is passed to the value accessor, along with each data point, to compute the point’s value. + */ + keys(keys: Iterable | ((this: This, data: Datum[], ...args: any[]) => Key[])): this; + + /** + * Returns the current value accessor, which defaults to a function return the property corresponding to the relevant key from the data element. + * + * Thus, by default the stack generator assumes that the input data is an array of objects, with each object exposing named properties with numeric values; see stack for an example. + */ + value(): (d: Datum, key: Key, i: number, data: Datum[]) => number; + /** + * Sets the value accessor to the specified number and returns this stack generator. + * + * @param value A constant value. + */ + value(value: number): this; + /** + * Sets the value accessor to the specified function and returns this stack generator. + * + * @param value A value accessor function which returns the numeric value for a given data element and key combination. The accessor function is invoked for each data element and key being passed + * the datum, the key, index of the data element in the input data array, and the complete data array. + */ + value(value: (d: Datum, key: Key, i: number, data: Datum[]) => number): this; + + /** + * Returns the current order accessor, which defaults to stackOrderNone; this uses the order given by the key accessor. + */ + order(): (series: Series) => Iterable; + /** + * Sets the order accessor to the specified array and returns this stack generator. + */ + order(order: null | Iterable): this; + /** + * Sets the order accessor to the specified function and returns this stack generator. + * + * The stack order is computed prior to the offset; thus, the lower value for all points is zero at the time the order is computed. + * The index attribute for each series is also not set until after the order is computed. + * + * See stack orders for the built-in orders. + * + * @param order A function returning a sort order array. It is passed the generated series array and must return an array of numeric indexes representing the stack order. + */ + order(order: (series: Series) => Iterable): this; + + /** + * Returns the current offset accessor, which defaults to stackOffsetNone; this uses a zero baseline. + */ + offset(): (series: Series[], order: number[]) => void; + /** + * Reset the offset to use stackOffsetNone; this uses a zero baseline. + * + * @param offset null to set to the default stackOffsetNone. + */ + offset(offset: null): this; + /** + * Sets the offset accessor to the specified function and returns this stack generator. + * + * @param offset A function which is passed the generated series array and the order index array; + * it is then responsible for updating the lower and upper values in the series array. + */ + offset(offset: (series: Series[], order: number[]) => void): this; +} + +/** + * Constructs a new stack generator with the default settings. + * + * Ensure that the accessors used with the stack generator correspond to the arguments passed into them. + */ +export function stack(): Stack; +/** + * Constructs a new stack generator with the default settings. + * + * Ensure that the accessors used with the stack generator correspond to the arguments passed into them. + * + * The generic corresponds to the data type of an element in the data array passed into the stack generator. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function stack(): Stack; +/** + * Constructs a new stack generator with the default settings. + * + * Ensure that the accessors used with the stack generator correspond to the arguments passed into them. + * + * The first generic corresponds to the data type of an element in the data array passed into the stack generator. + * + * The second generic corresponds to the data type of key used to identify a series. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function stack(): Stack; +/** + * Constructs a new stack generator with the default settings. + * + * Ensure that the accessors used with the stack generator correspond to the arguments passed into them. + * + * The first generic corresponds to the "this" context in which the stack generator and its accessor functions are invoked. + * + * The second generic corresponds to the data type of an element in the data array passed into the stack generator. + * + * The third generic corresponds to the data type of key used to identify a series. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function stack(): Stack; + +/** + * Returns a series order such that the earliest series (according to the maximum value) is at the bottom. + * + * @param series A series generated by a stack generator. + */ +export function stackOrderAppearance(series: Series): number[]; + +/** + * Returns a series order such that the smallest series (according to the sum of values) is at the bottom. + * + * @param series A series generated by a stack generator. + */ +export function stackOrderAscending(series: Series): number[]; + +/** + * Returns a series order such that the largest series (according to the sum of values) is at the bottom. + * + * @param series A series generated by a stack generator. + */ +export function stackOrderDescending(series: Series): number[]; + +/** + * Returns a series order such that the larger series (according to the sum of values) are on the inside and the smaller series are on the outside. + * This order is recommended for streamgraphs in conjunction with the wiggle offset. See Stacked Graphs—Geometry & Aesthetics by Byron & Wattenberg for more information. + * + * @param series A series generated by a stack generator. + */ +export function stackOrderInsideOut(series: Series): number[]; + +/** + * Returns the given series order [0, 1, … n - 1] where n is the number of elements in series. Thus, the stack order is given by the key accessor. + * + * @param series A series generated by a stack generator. + */ +export function stackOrderNone(series: Series): number[]; + +/** + * Returns the reverse of the given series order [n - 1, n - 2, … 0] where n is the number of elements in series. Thus, the stack order is given by the reverse of the key accessor. + * + * @param series A series generated by a stack generator. + */ +export function stackOrderReverse(series: Series): number[]; + +/** + * Applies a zero baseline and normalizes the values for each point such that the topline is always one. + * + * @param series A series array generated by a stack generator. + * @param order An array of numeric indexes representing the stack order. + */ +export function stackOffsetExpand(series: Series[], order: Iterable): void; + +/** + * Positive values are stacked above zero, while negative values are stacked below zero. + * + * @param series A series array generated by a stack generator. + * @param order An array of numeric indexes representing the stack order. + */ +export function stackOffsetDiverging(series: Series[], order: Iterable): void; + +/** + * Applies a zero baseline. + * + * @param series A series array generated by a stack generator. + * @param order An array of numeric indexes representing the stack order. + */ +export function stackOffsetNone(series: Series[], order: Iterable): void; + +/** + * Shifts the baseline down such that the center of the streamgraph is always at zero. + * + * @param series A series array generated by a stack generator. + * @param order An array of numeric indexes representing the stack order. + */ +export function stackOffsetSilhouette(series: Series[], order: Iterable): void; + +/** + * Shifts the baseline so as to minimize the weighted wiggle of layers. This offset is recommended for streamgraphs in conjunction with the inside-out order. + * See Stacked Graphs—Geometry & Aesthetics by Bryon & Wattenberg for more information. + * + * @param series A series array generated by a stack generator. + * @param order An array of numeric indexes representing the stack order. + */ +export function stackOffsetWiggle(series: Series[], order: Iterable): void; diff --git a/astra_scene_test/X_03/node_modules/@types/d3-shape/package.json b/astra_scene_test/X_03/node_modules/@types/d3-shape/package.json new file mode 100644 index 0000000000000000000000000000000000000000..7abe44e6312c0f56cc7e21e837ad53a8f9ad09d1 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/d3-shape/package.json @@ -0,0 +1,53 @@ +{ + "name": "@types/d3-shape", + "version": "3.2.0", + "description": "TypeScript definitions for d3-shape", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-shape", + "license": "MIT", + "contributors": [ + { + "name": "Tom Wanzek", + "githubUsername": "tomwanzek", + "url": "https://github.com/tomwanzek" + }, + { + "name": "Alex Ford", + "githubUsername": "gustavderdrache", + "url": "https://github.com/gustavderdrache" + }, + { + "name": "Boris Yankov", + "githubUsername": "borisyankov", + "url": "https://github.com/borisyankov" + }, + { + "name": "denisname", + "githubUsername": "denisname", + "url": "https://github.com/denisname" + }, + { + "name": "Nathan Bierema", + "githubUsername": "Methuselah96", + "url": "https://github.com/Methuselah96" + }, + { + "name": "Fil", + "githubUsername": "Fil", + "url": "https://github.com/Fil" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/d3-shape" + }, + "scripts": {}, + "dependencies": { + "@types/d3-path": "*" + }, + "peerDependencies": {}, + "typesPublisherContentHash": "4d33e16c0579135ebe257c1dfb53b603cbf36eb29b15a4748ff9b6cbf1f979b2", + "typeScriptVersion": "5.6" +} \ No newline at end of file diff --git a/astra_scene_test/X_03/node_modules/@types/d3-time/LICENSE b/astra_scene_test/X_03/node_modules/@types/d3-time/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9e841e7a26e4eb057b24511e7b92d42b257a80e5 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/d3-time/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/astra_scene_test/X_03/node_modules/@types/d3-time/README.md b/astra_scene_test/X_03/node_modules/@types/d3-time/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4e79c08df8c91f86b4969c4b59f9c0f62a8db0bf --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/d3-time/README.md @@ -0,0 +1,15 @@ +# Installation +> `npm install --save @types/d3-time` + +# Summary +This package contains type definitions for d3-time (https://github.com/d3/d3-time/). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-time. + +### Additional Details + * Last updated: Mon, 25 Nov 2024 10:02:27 GMT + * Dependencies: none + +# Credits +These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [denisname](https://github.com/denisname), and [Nathan Bierema](https://github.com/Methuselah96). diff --git a/astra_scene_test/X_03/node_modules/@types/d3-time/index.d.ts b/astra_scene_test/X_03/node_modules/@types/d3-time/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8b24264c58f2893d1c8dee098d5be9743223c13e --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/d3-time/index.d.ts @@ -0,0 +1,697 @@ +// Last module patch version validated against: 3.0.0 + +// --------------------------------------------------------------- +// Interfaces +// --------------------------------------------------------------- + +/** + * A D3 Time Interval + */ +export interface TimeInterval { + /** + * Returns a new date representing the latest interval boundary date before or equal to date. + * Equivalent to interval.floor, except it date is not specified, it defaults to the current time. + * For example, d3.timeYear(date) and d3.timeYear.floor(date) are equivalent. + * + * For example, timeDay(date) typically returns 12:00 AM local time on the given date. + * + * This function is idempotent: if the specified date is already floored to the current interval, + * a new date with an identical time is returned. + * Furthermore, the returned date is the minimum expressible value of the associated interval, + * such that interval.floor(interval.floor(date) - 1) returns the preceding interval boundary date. + * + * Note that the == and === operators do not compare by value with Date objects, + * and thus you cannot use them to tell whether the specified date has already been floored. + * Instead, coerce to a number and then compare. + * + * This is more reliable than testing whether the time is 12:00 AM, as in some time zones midnight may not exist due to daylight saving. + * + * @param date A date object. + */ + (date?: Date): Date; + + /** + * Returns a new date representing the latest interval boundary date before or equal to date. + * + * For example, timeDay.floor(date) typically returns 12:00 AM local time on the given date. + * + * This method is idempotent: if the specified date is already floored to the current interval, + * a new date with an identical time is returned. + * Furthermore, the returned date is the minimum expressible value of the associated interval, + * such that interval.floor(interval.floor(date) - 1) returns the preceding interval boundary date. + * + * Note that the == and === operators do not compare by value with Date objects, + * and thus you cannot use them to tell whether the specified date has already been floored. + * Instead, coerce to a number and then compare. + * + * This is more reliable than testing whether the time is 12:00 AM, as in some time zones midnight may not exist due to daylight saving. + * + * @param date A date object. + */ + floor(date: Date): Date; + + /** + * Returns a new date representing the closest interval boundary date to date. + * + * For example, timeDay.round(date) typically returns 12:00 AM local time on the given date if it is on or before noon, + * and 12:00 AM of the following day if it is after noon. + * + * This method is idempotent: if the specified date is already rounded to the current interval, a new date with an identical time is returned. + * + * @param date A date object. + */ + round(date: Date): Date; + + /** + * Returns a new date representing the earliest interval boundary date after or equal to date. + * + * For example, timeDay.ceil(date) typically returns 12:00 AM local time on the date following the given date. + * + * This method is idempotent: if the specified date is already ceilinged to the current interval, + * a new date with an identical time is returned. Furthermore, + * the returned date is the maximum expressible value of the associated interval, + * such that interval.ceil(interval.ceil(date) + 1) returns the following interval boundary date. + * + * @param date A date object. + */ + ceil(date: Date): Date; + + /** + * Returns a new date equal to date plus step intervals. + * + * If step is not specified it defaults to 1. + * + * This method does not round the specified date to the interval. For example, if date is today at 5:34 PM, + * then timeDay.offset(date, 1) returns 5:34 PM tomorrow (even if daylight saving changes!). + * + * @param date A date object. + * @param step An optional number of steps to apply when calculating the offset date. + * If step is negative, then the returned date will be before the specified date; + * if step is zero, then a copy of the specified date is returned; if step is not an integer, it is floored. + */ + offset(date: Date, step?: number): Date; + + /** + * Returns an array of dates representing every interval boundary after or equal to start (inclusive) and before stop (exclusive). + * + * If step is specified, then every step-th boundary will be returned; for example, + * for the timeDay interval a step of 2 will return every other day. + * If step is not an integer, it is floored. + * + * The first date in the returned array is the earliest boundary after or equal to start; + * subsequent dates are offset by step intervals and floored. + * Thus, two overlapping ranges may be inconsistent. + * + * To make ranges consistent when a step is specified, use CountableInterval.every instead. + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ + range(start: Date, stop: Date, step?: number): Date[]; + + /** + * Returns a new interval that is a filtered subset of this interval using the specified test function. + * + * @param test A test function which is passed a date and should return true if and only if + * the specified date should be considered part of the interval. + */ + filter(test: (date: Date) => boolean): TimeInterval; +} + +/** + * A D3 Countable Time Interval + */ +export interface CountableTimeInterval extends TimeInterval { + /** + * Returns the number of interval boundaries after start (exclusive) and before or equal to end (inclusive). + * + * Note that this behavior is slightly different than interval.range, + * because its purpose is to return the zero-based number of the specified end date relative to the specified start date. + * + * @param start A start date object. + * @param end An end date object. + */ + count(start: Date, end: Date): number; + /** + * Returns a filtered view of this interval representing every stepth date. + * + * The meaning of step is dependent on this interval’s parent interval as defined by the field function. + * + * For example, timeMinute.every(15) returns an interval representing every fifteen minutes, + * starting on the hour: :00, :15, :30, :45, etc. Note that for some intervals, + * the resulting dates may not be uniformly-spaced; + * timeDay’s parent interval is timeMonth, and thus the interval number resets at the start of each month. + * + * If step is not valid, returns null. If step is one, returns this interval. + * + * This method can be used in conjunction with interval.range to ensure that two overlapping ranges are consistent. + * + * The returned filtered interval does not support interval.count. See also interval.filter. + * + * @param step Number of steps. + */ + every(step: number): TimeInterval | null; +} + +// --------------------------------------------------------------- +// Custom (Countable)Interval Factories +// --------------------------------------------------------------- + +/** + * Constructs a new custom interval given the specified floor and offset functions. + * + * The returned custom interval is not countable, i.e. does not expose the methods "count(..)" and "every(...)". + * + * @param floor A floor function which takes a single date as an argument and rounds it down to the nearest interval boundary. + * @param offset An offset function which takes a date and an integer step as arguments and advances + * the specified date by the specified number of boundaries; the step may be positive, negative or zero. + */ +export function timeInterval( + floor: (date: Date) => void, + offset: (date: Date, step: number) => void, +): TimeInterval; +/** + * Constructs a new custom interval given the specified floor, offset and count functions. + * + * The returned custom interval is countable and exposes the methods "count(..)" and "every(...)". + * + * Note: due to an internal optimization, the specified count function must not invoke interval.count on other time intervals. + * + * @param floor A floor function which takes a single date as an argument and rounds it down to the nearest interval boundary. + * @param offset An offset function which takes a date and an integer step as arguments and advances + * the specified date by the specified number of boundaries; the step may be positive, negative or zero. + * @param count A count function which takes a start date and an end date, already floored to the current interval, + * and returns the number of boundaries between the start (exclusive) and end (inclusive). + * Note: due to an internal optimization, the specified count function must not invoke interval.count on other time intervals. + * @param field An optional field function which takes a date, already floored to the current interval, + * and returns the field value of the specified date, + * corresponding to the number of boundaries between this date (exclusive) and the latest previous parent boundary. + * For example, for the timeDay interval, this returns the number of days since the start of the month. + * If a field function is not specified, it defaults to counting the number of interval boundaries since + * the UNIX epoch of January 1, 1970 UTC. The field function defines the behavior of interval.every. + */ +export function timeInterval( + floor: (date: Date) => void, + offset: (date: Date, step: number) => void, + count: (start: Date, end: Date) => number, + field?: (date: Date) => number, +): CountableTimeInterval; + +// --------------------------------------------------------------- +// Built-In Factories and Date Array Creators +// --------------------------------------------------------------- + +// local time ---------------------------------------------------------- + +/** + * Milliseconds Interval in Local Time; the shortest available time unit. + */ +export const timeMillisecond: CountableTimeInterval; + +/** + * This is a convenience alias for timeMillisecond.range(...). + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ +export function timeMilliseconds(start: Date, stop: Date, step?: number): Date[]; + +/** + * Seconds Interval in Local Time; seconds (e.g., 01:23:45.0000 AM); 1,000 milliseconds. + */ +export const timeSecond: CountableTimeInterval; + +/** + * This is a convenience alias for timeSecond.range(...). + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ +export function timeSeconds(start: Date, stop: Date, step?: number): Date[]; + +/** + * Minutes Interval in Local Time; minutes (e.g., 01:02:00 AM); 60 seconds. Note that ECMAScript ignores leap seconds. + */ +export const timeMinute: CountableTimeInterval; + +/** + * This is a convenience alias for timeMinute.range(...). + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ +export function timeMinutes(start: Date, stop: Date, step?: number): Date[]; + +/** + * Hours Interval in Local Time; Hours (e.g., 01:00 AM); 60 minutes. + * + * Note that advancing time by one hour in local time can return the same hour or skip an hour due to daylight saving. + */ +export const timeHour: CountableTimeInterval; + +/** + * This is a convenience alias for timeHour.range(...). + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ +export function timeHours(start: Date, stop: Date, step?: number): Date[]; + +/** + * Days Interval in Local Time; days (e.g., February 7, 2012 at 12:00 AM); typically 24 hours. + * Days in local time may range from 23 to 25 hours due to daylight saving. + */ +export const timeDay: CountableTimeInterval; + +/** + * This is a convenience alias for timeDay.range(...). + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ +export function timeDays(start: Date, stop: Date, step?: number): Date[]; + +/** + * Week Interval in Local Time. Alias for sunday; 7 days and typically 168 hours. + * + * Weeks in local time may range from 167 to 169 hours due on daylight saving. + */ +export const timeWeek: CountableTimeInterval; + +/** + * This is a convenience alias for timeWeek.range(...). + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ +export function timeWeeks(start: Date, stop: Date, step?: number): Date[]; + +/** + * Week Interval for Sunday-based weeks in Local Time (e.g., February 5, 2012 at 12:00 AM). + * 7 days and typically 168 hours. + * + * Weeks in local time may range from 167 to 169 hours due on daylight saving. + */ +export const timeSunday: CountableTimeInterval; + +/** + * This is a convenience alias for timeSunday.range(...). + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ +export function timeSundays(start: Date, stop: Date, step?: number): Date[]; + +/** + * Week Interval for Monday-based weeks in Local Time (e.g., February 6, 2012 at 12:00 AM). + * 7 days and typically 168 hours. + * + * Weeks in local time may range from 167 to 169 hours due on daylight saving. + */ +export const timeMonday: CountableTimeInterval; + +/** + * This is a convenience alias for timeMonday.range(...). + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ +export function timeMondays(start: Date, stop: Date, step?: number): Date[]; + +/** + * Week Interval for Tuesday-based weeks in Local Time (e.g., February 7, 2012 at 12:00 AM). + * 7 days and typically 168 hours. + * + * Weeks in local time may range from 167 to 169 hours due on daylight saving. + */ +export const timeTuesday: CountableTimeInterval; + +/** + * This is a convenience alias for timeTuesday.range(...). + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ +export function timeTuesdays(start: Date, stop: Date, step?: number): Date[]; + +/** + * Week Interval for Wednesday-based weeks in Local Time (e.g., February 8, 2012 at 12:00 AM). + * 7 days and typically 168 hours. + * + * Weeks in local time may range from 167 to 169 hours due on daylight saving. + */ +export const timeWednesday: CountableTimeInterval; + +/** + * This is a convenience alias for timeWednesday.range(...). + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ +export function timeWednesdays(start: Date, stop: Date, step?: number): Date[]; + +/** + * Week Interval for Thursday-based weeks in Local Time (e.g., February 9, 2012 at 12:00 AM). + * 7 days and typically 168 hours. + * + * Weeks in local time may range from 167 to 169 hours due on daylight saving. + */ +export const timeThursday: CountableTimeInterval; + +/** + * This is a convenience alias for timeThursday.range(...). + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ +export function timeThursdays(start: Date, stop: Date, step?: number): Date[]; + +/** + * Week Interval for Friday-based weeks in Local Time (e.g., February 10, 2012 at 12:00 AM). + * 7 days and typically 168 hours. + * + * Weeks in local time may range from 167 to 169 hours due on daylight saving. + */ +export const timeFriday: CountableTimeInterval; + +/** + * This is a convenience alias for timeFriday.range(...). + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ +export function timeFridays(start: Date, stop: Date, step?: number): Date[]; + +/** + * Week Interval for Saturday-based weeks in Local Time (e.g., February 11, 2012 at 12:00 AM). + * 7 days and typically 168 hours. + * + * Weeks in local time may range from 167 to 169 hours due on daylight saving. + */ +export const timeSaturday: CountableTimeInterval; + +/** + * This is a convenience alias for timeSaturday.range(...). + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ +export function timeSaturdays(start: Date, stop: Date, step?: number): Date[]; + +/** + * Month Interval in Local Time; months (e.g., February 1, 2012 at 12:00 AM); ranges from 28 to 31 days. + */ +export const timeMonth: CountableTimeInterval; + +/** + * This is a convenience alias for timeMonth.range(...). + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ +export function timeMonths(start: Date, stop: Date, step?: number): Date[]; + +/** + * Year Interval in Local Time; years (e.g., January 1, 2012 at 12:00 AM); ranges from 365 to 366 days. + */ +export const timeYear: CountableTimeInterval; + +/** + * This is a convenience alias for timeYear.range(...). + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ +export function timeYears(start: Date, stop: Date, step?: number): Date[]; + +// utc Coordinated Universal Time ---------------------------------------------------------- + +/** + * Milliseconds Interval in Coordinated Universal Time (UTC); the shortest available time unit. + */ +export const utcMillisecond: CountableTimeInterval; + +/** + * This is a convenience alias for utcMillisecond.range(...). + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ +export function utcMilliseconds(start: Date, stop: Date, step?: number): Date[]; + +/** + * Seconds Interval in Coordinated Universal Time (UTC); seconds (e.g., 01:23:45.0000 AM); 1,000 milliseconds. + */ +export const utcSecond: CountableTimeInterval; + +/** + * This is a convenience alias for utcSecond.range(...). + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ +export function utcSeconds(start: Date, stop: Date, step?: number): Date[]; + +/** + * Minutes Interval in Coordinated Universal Time (UTC); minutes (e.g., 01:02:00 AM); 60 seconds. + * Note that ECMAScript ignores leap seconds. + */ +export const utcMinute: CountableTimeInterval; + +/** + * This is a convenience alias for utcMinute.range(...). + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ +export function utcMinutes(start: Date, stop: Date, step?: number): Date[]; + +/** + * Hours Interval in Coordinated Universal Time (UTC); Hours (e.g., 01:00 AM); 60 minutes. + */ +export const utcHour: CountableTimeInterval; + +/** + * This is a convenience alias for utcHour.range(...). + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ +export function utcHours(start: Date, stop: Date, step?: number): Date[]; + +/** + * Days Interval in Coordinated Universal Time (UTC); days (e.g., February 7, 2012 at 12:00 AM); 24 hours. + */ +export const utcDay: CountableTimeInterval; + +/** + * This is a convenience alias for utcDay.range(...). + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ +export function utcDays(start: Date, stop: Date, step?: number): Date[]; + +/** + * Week Interval in Local Time. Alias for sunday; 7 days and 168 hours. + */ +export const utcWeek: CountableTimeInterval; + +/** + * This is a convenience alias for utcWeek.range(...). + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ +export function utcWeeks(start: Date, stop: Date, step?: number): Date[]; + +/** + * Week Interval for Sunday-based weeks in Coordinated Universal Time (UTC) (e.g., February 5, 2012 at 12:00 AM). + * 7 days and 168 hours. + */ +export const utcSunday: CountableTimeInterval; + +/** + * This is a convenience alias for utcSunday.range(...). + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ +export function utcSundays(start: Date, stop: Date, step?: number): Date[]; + +/** + * Week Interval for Monday-based weeks in Coordinated Universal Time (UTC) (e.g., February 6, 2012 at 12:00 AM). + * 7 days and 168 hours. + */ +export const utcMonday: CountableTimeInterval; + +/** + * This is a convenience alias for utcMonday.range(...). + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ +export function utcMondays(start: Date, stop: Date, step?: number): Date[]; + +/** + * Week Interval for Tuesday-based weeks in Coordinated Universal Time (UTC) (e.g., February 7, 2012 at 12:00 AM). + * 7 days and 168 hours. + */ +export const utcTuesday: CountableTimeInterval; + +/** + * This is a convenience alias for utcTuesday.range(...). + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ +export function utcTuesdays(start: Date, stop: Date, step?: number): Date[]; + +/** + * Week Interval for Wednesday-based weeks in Coordinated Universal Time (UTC) (e.g., February 8, 2012 at 12:00 AM). + * 7 days and 168 hours. + */ +export const utcWednesday: CountableTimeInterval; + +/** + * This is a convenience alias for utcWednesday.range(...). + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ +export function utcWednesdays(start: Date, stop: Date, step?: number): Date[]; + +/** + * Week Interval for Thursday-based weeks in Coordinated Universal Time (UTC) (e.g., February 9, 2012 at 12:00 AM). + * 7 days and 168 hours. + */ +export const utcThursday: CountableTimeInterval; + +/** + * This is a convenience alias for utcThursday.range(...). + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ +export function utcThursdays(start: Date, stop: Date, step?: number): Date[]; + +/** + * Week Interval for Friday-based weeks in Coordinated Universal Time (UTC) (e.g., February 10, 2012 at 12:00 AM). + * 7 days and 168 hours. + */ +export const utcFriday: CountableTimeInterval; + +/** + * This is a convenience alias for utcFriday.range(...). + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ +export function utcFridays(start: Date, stop: Date, step?: number): Date[]; + +/** + * Week Interval for Saturday-based weeks in Coordinated Universal Time (UTC) (e.g., February 11, 2012 at 12:00 AM). + * 7 days and 168 hours. + */ +export const utcSaturday: CountableTimeInterval; + +/** + * This is a convenience alias for utcSaturday.range(...). + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ +export function utcSaturdays(start: Date, stop: Date, step?: number): Date[]; + +/** + * Month Interval in Coordinated Universal Time (UTC); months (e.g., February 1, 2012 at 12:00 AM); ranges from 28 to 31 days. + */ +export const utcMonth: CountableTimeInterval; + +/** + * This is a convenience alias for utcMonth.range(...). + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ +export function utcMonths(start: Date, stop: Date, step?: number): Date[]; + +/** + * Year Interval in Coordinated Universal Time (UTC); years (e.g., January 1, 2012 at 12:00 AM); ranges from 365 to 366 days. + */ +export const utcYear: CountableTimeInterval; + +/** + * This is a convenience alias for utcYear.range(...). + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ +export function utcYears(start: Date, stop: Date, step?: number): Date[]; + +/** + * Like d3.utcDay, except it counts days since the UNIX epoch (January 1, 1970) such that interval.every returns uniformly-spaced dates rather than varying based on day-of-month. + */ +export const unixDay: CountableTimeInterval; + +/** + * This is a convenience alias for unixDay.range(...). + * + * @param start A start date object for the range. + * @param stop A stop date object for the range. + * @param step An optional number of steps to apply when calculating the dates in the range. + */ +export function unixDays(start: Date, stop: Date, step?: number): Date[]; + +/** + * Equivalent to d3.utcTicks, but in local time. + */ +export function timeTicks(start: Date, stop: Date, count: number): Date[]; + +/** + * Returns the time interval that would be used by d3.timeTicks given the same arguments. + */ +export function timeTickInterval(start: Date, stop: Date, count: number): TimeInterval | null; + +/** + * Returns an array of approximately count dates at regular intervals between start and stop (inclusive). + * If stop is before start, dates are returned in reverse chronological order; otherwise dates are returned in chronological order. + */ +export function utcTicks(start: Date, stop: Date, count: number): Date[]; + +/** + * Returns the time interval that would be used by d3.utcTicks given the same arguments. + * If there is no associated interval, such as when start or stop is invalid, returns null. + */ +export function utcTickInterval(start: Date, stop: Date, count: number): TimeInterval | null; diff --git a/astra_scene_test/X_03/node_modules/@types/d3-time/package.json b/astra_scene_test/X_03/node_modules/@types/d3-time/package.json new file mode 100644 index 0000000000000000000000000000000000000000..363809d1e4b986851f5e0cc272924fd51a0b4864 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/d3-time/package.json @@ -0,0 +1,46 @@ +{ + "name": "@types/d3-time", + "version": "3.0.4", + "description": "TypeScript definitions for d3-time", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-time", + "license": "MIT", + "contributors": [ + { + "name": "Tom Wanzek", + "githubUsername": "tomwanzek", + "url": "https://github.com/tomwanzek" + }, + { + "name": "Alex Ford", + "githubUsername": "gustavderdrache", + "url": "https://github.com/gustavderdrache" + }, + { + "name": "Boris Yankov", + "githubUsername": "borisyankov", + "url": "https://github.com/borisyankov" + }, + { + "name": "denisname", + "githubUsername": "denisname", + "url": "https://github.com/denisname" + }, + { + "name": "Nathan Bierema", + "githubUsername": "Methuselah96", + "url": "https://github.com/Methuselah96" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/d3-time" + }, + "scripts": {}, + "dependencies": {}, + "peerDependencies": {}, + "typesPublisherContentHash": "995c6a7a1f21328f5dceb32804c5f3d92ab20a98694246d9c8f213f4eef298ed", + "typeScriptVersion": "4.9" +} \ No newline at end of file diff --git a/astra_scene_test/X_03/node_modules/@types/d3-timer/LICENSE b/astra_scene_test/X_03/node_modules/@types/d3-timer/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9e841e7a26e4eb057b24511e7b92d42b257a80e5 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/d3-timer/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/astra_scene_test/X_03/node_modules/@types/d3-timer/README.md b/astra_scene_test/X_03/node_modules/@types/d3-timer/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e82a16f2207035356e615999e03403a22998cc2a --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/d3-timer/README.md @@ -0,0 +1,15 @@ +# Installation +> `npm install --save @types/d3-timer` + +# Summary +This package contains type definitions for d3-timer (https://github.com/d3/d3-timer/). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-timer. + +### Additional Details + * Last updated: Tue, 07 Nov 2023 15:11:37 GMT + * Dependencies: none + +# Credits +These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [denisname](https://github.com/denisname), and [Nathan Bierema](https://github.com/Methuselah96). diff --git a/astra_scene_test/X_03/node_modules/@types/d3-timer/index.d.ts b/astra_scene_test/X_03/node_modules/@types/d3-timer/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..66d882490afe81fe85163be6e8e7dd8eb81358b5 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/d3-timer/index.d.ts @@ -0,0 +1,68 @@ +// Last module patch version validated against: 3.0.1 + +/** + * Returns the current time as defined by performance.now if available, and Date.now if not. + * The current time is updated at the start of a frame; it is thus consistent during the frame, and any timers scheduled during the same frame will be synchronized. + * If this method is called outside of a frame, such as in response to a user event, the current time is calculated and then fixed until the next frame, + * again ensuring consistent timing during event handling. + */ +export function now(): number; + +export interface Timer { + /** + * Restart a timer with the specified callback and optional delay and time. + * This is equivalent to stopping this timer and creating a new timer with the specified arguments, + * although this timer retains the original invocation priority. + * + * @param callback A callback function to be invoked and passed in the apparent + * elapsed time since the timer became active in milliseconds. + * @param delay An optional numeric delay in milliseconds (default = 0) relative to time. + * @param time An optional time in milliseconds relative to which the delay is calculated (default = now). + */ + restart(callbackFn: (elapsed: number) => void, delay?: number, time?: number): void; + + /** + * Stop the timer. + */ + stop(): void; +} + +/** + * Schedules and returns a new timer, invoking the specified callback repeatedly until the timer is stopped. + * The callback is passed the (apparent) elapsed time since the timer became active. + * + * @param callback A callback function to be invoked and passed in the apparent + * elapsed time since the timer became active in milliseconds. + * @param delay An optional numeric delay in milliseconds (default = 0) relative to time. + * @param time An optional time in milliseconds relative to which the delay is calculated (default = now). + */ +export function timer(callback: (elapsed: number) => void, delay?: number, time?: number): Timer; + +/** + * Immediately invoke any eligible timer callbacks. + */ +export function timerFlush(): void; + +/** + * Schedules and returns a new timer, invoking the specified callback. The timer is stopped automatically + * on its first callback. The callback is passed the (apparent) elapsed time since the timer became active. + * + * @param callback A callback function to be invoked and passed in the apparent + * elapsed time since the timer became active in milliseconds. + * @param delay An optional numeric delay in milliseconds (default = 0) relative to time. + * @param time An optional time in milliseconds relative to which the delay is calculated (default = now). + */ +export function timeout(callback: (elapsed: number) => void, delay?: number, time?: number): Timer; + +/** + * Schedules and returns a new timer, invoking the specified callback repeatedly every 'delay' milliseconds + * until the timer is stopped. + * The callback is passed the (apparent) elapsed time since the timer became active. + * + * @param callback A callback function to be invoked and passed in the apparent + * elapsed time since the timer became active in milliseconds. + * @param delay An optional numeric delay in milliseconds between repeat invocations of the callback. + * If not specified, the interval timer behaves like the regular timer. + * @param time An optional time in milliseconds relative to which the initial delay is calculated (default = now). + */ +export function interval(callback: (elapsed: number) => void, delay?: number, time?: number): Timer; diff --git a/astra_scene_test/X_03/node_modules/@types/d3-timer/package.json b/astra_scene_test/X_03/node_modules/@types/d3-timer/package.json new file mode 100644 index 0000000000000000000000000000000000000000..25669dac3c93379c7dc2b2c895471defed02b598 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/d3-timer/package.json @@ -0,0 +1,45 @@ +{ + "name": "@types/d3-timer", + "version": "3.0.2", + "description": "TypeScript definitions for d3-timer", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-timer", + "license": "MIT", + "contributors": [ + { + "name": "Tom Wanzek", + "githubUsername": "tomwanzek", + "url": "https://github.com/tomwanzek" + }, + { + "name": "Alex Ford", + "githubUsername": "gustavderdrache", + "url": "https://github.com/gustavderdrache" + }, + { + "name": "Boris Yankov", + "githubUsername": "borisyankov", + "url": "https://github.com/borisyankov" + }, + { + "name": "denisname", + "githubUsername": "denisname", + "url": "https://github.com/denisname" + }, + { + "name": "Nathan Bierema", + "githubUsername": "Methuselah96", + "url": "https://github.com/Methuselah96" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/d3-timer" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "a51fc6981e6d12715fd052f7e598dd291c354465025cbb33ece1895bdab4109c", + "typeScriptVersion": "4.5" +} \ No newline at end of file diff --git a/astra_scene_test/X_03/node_modules/@types/three/LICENSE b/astra_scene_test/X_03/node_modules/@types/three/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9e841e7a26e4eb057b24511e7b92d42b257a80e5 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/astra_scene_test/X_03/node_modules/@types/three/README.md b/astra_scene_test/X_03/node_modules/@types/three/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a800eee6b9a724e9be08224f1d29bf4618f8e88b --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/README.md @@ -0,0 +1,15 @@ +# Installation +> `npm install --save @types/three` + +# Summary +This package contains type definitions for three (https://threejs.org/). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three. + +### Additional Details + * Last updated: Wed, 03 Sep 2025 18:38:35 GMT + * Dependencies: [@dimforge/rapier3d-compat](https://npmjs.com/package/@dimforge/rapier3d-compat), [@tweenjs/tween.js](https://npmjs.com/package/@tweenjs/tween.js), [@types/stats.js](https://npmjs.com/package/@types/stats.js), [@types/webxr](https://npmjs.com/package/@types/webxr), [@webgpu/types](https://npmjs.com/package/@webgpu/types), [fflate](https://npmjs.com/package/fflate), [meshoptimizer](https://npmjs.com/package/meshoptimizer) + +# Credits +These definitions were written by [Josh Ellis](https://github.com/joshuaellis), and [Nathan Bierema](https://github.com/Methuselah96). diff --git a/astra_scene_test/X_03/node_modules/@types/three/build/three.core.d.ts b/astra_scene_test/X_03/node_modules/@types/three/build/three.core.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4af71a0d8085db23f885897c2728c74eebfc1fcf --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/build/three.core.d.ts @@ -0,0 +1 @@ +export * from "../src/Three.Core.js"; diff --git a/astra_scene_test/X_03/node_modules/@types/three/build/three.core.min.d.ts b/astra_scene_test/X_03/node_modules/@types/three/build/three.core.min.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4af71a0d8085db23f885897c2728c74eebfc1fcf --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/build/three.core.min.d.ts @@ -0,0 +1 @@ +export * from "../src/Three.Core.js"; diff --git a/astra_scene_test/X_03/node_modules/@types/three/build/three.d.cts b/astra_scene_test/X_03/node_modules/@types/three/build/three.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..1e831f0ed85e81be5a5b911cd3066c1bdd6faca0 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/build/three.d.cts @@ -0,0 +1 @@ +export * from "../src/Three.js"; diff --git a/astra_scene_test/X_03/node_modules/@types/three/build/three.module.d.ts b/astra_scene_test/X_03/node_modules/@types/three/build/three.module.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1e831f0ed85e81be5a5b911cd3066c1bdd6faca0 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/build/three.module.d.ts @@ -0,0 +1 @@ +export * from "../src/Three.js"; diff --git a/astra_scene_test/X_03/node_modules/@types/three/build/three.module.min.d.ts b/astra_scene_test/X_03/node_modules/@types/three/build/three.module.min.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1e831f0ed85e81be5a5b911cd3066c1bdd6faca0 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/build/three.module.min.d.ts @@ -0,0 +1 @@ +export * from "../src/Three.js"; diff --git a/astra_scene_test/X_03/node_modules/@types/three/build/three.tsl.d.ts b/astra_scene_test/X_03/node_modules/@types/three/build/three.tsl.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c326524c42f0581f97eea435b68a64483e90f182 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/build/three.tsl.d.ts @@ -0,0 +1 @@ +export * from "../src/Three.TSL.js"; diff --git a/astra_scene_test/X_03/node_modules/@types/three/build/three.tsl.min.d.ts b/astra_scene_test/X_03/node_modules/@types/three/build/three.tsl.min.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c326524c42f0581f97eea435b68a64483e90f182 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/build/three.tsl.min.d.ts @@ -0,0 +1 @@ +export * from "../src/Three.TSL.js"; diff --git a/astra_scene_test/X_03/node_modules/@types/three/build/three.webgpu.d.ts b/astra_scene_test/X_03/node_modules/@types/three/build/three.webgpu.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f43222f7617a1302ed7839adb88a66796b82576c --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/build/three.webgpu.d.ts @@ -0,0 +1 @@ +export * from "../src/Three.WebGPU.js"; diff --git a/astra_scene_test/X_03/node_modules/@types/three/build/three.webgpu.min.d.ts b/astra_scene_test/X_03/node_modules/@types/three/build/three.webgpu.min.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f43222f7617a1302ed7839adb88a66796b82576c --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/build/three.webgpu.min.d.ts @@ -0,0 +1 @@ +export * from "../src/Three.WebGPU.js"; diff --git a/astra_scene_test/X_03/node_modules/@types/three/build/three.webgpu.nodes.d.ts b/astra_scene_test/X_03/node_modules/@types/three/build/three.webgpu.nodes.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bb2fbdb0cffea9ecf79b5e144af70781fd485f6c --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/build/three.webgpu.nodes.d.ts @@ -0,0 +1 @@ +export * from "../src/Three.WebGPU.Nodes.js"; diff --git a/astra_scene_test/X_03/node_modules/@types/three/build/three.webgpu.nodes.min.d.ts b/astra_scene_test/X_03/node_modules/@types/three/build/three.webgpu.nodes.min.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bb2fbdb0cffea9ecf79b5e144af70781fd485f6c --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/build/three.webgpu.nodes.min.d.ts @@ -0,0 +1 @@ +export * from "../src/Three.WebGPU.Nodes.js"; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/Addons.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/Addons.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a901ce0e8117597bf03c4630b892fe0eb2f682c2 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/Addons.d.ts @@ -0,0 +1,285 @@ +export * from "./animation/AnimationClipCreator.js"; +export * from "./animation/CCDIKSolver.js"; + +export { default as WebGL } from "./capabilities/WebGL.js"; + +export * from "./controls/ArcballControls.js"; +export * from "./controls/DragControls.js"; +export * from "./controls/FirstPersonControls.js"; +export * from "./controls/FlyControls.js"; +export * from "./controls/MapControls.js"; +export * from "./controls/OrbitControls.js"; +export * from "./controls/PointerLockControls.js"; +export * from "./controls/TrackballControls.js"; +export * from "./controls/TransformControls.js"; + +export * from "./csm/CSM.js"; +export * from "./csm/CSMFrustum.js"; +export * from "./csm/CSMHelper.js"; +export * from "./csm/CSMShader.js"; + +export * as Curves from "./curves/CurveExtras.js"; +export * from "./curves/NURBSCurve.js"; +export * from "./curves/NURBSSurface.js"; +export * as NURBSUtils from "./curves/NURBSUtils.js"; +export * from "./curves/NURBSVolume.js"; + +export * from "./effects/AnaglyphEffect.js"; +export * from "./effects/AsciiEffect.js"; +export * from "./effects/OutlineEffect.js"; +export * from "./effects/ParallaxBarrierEffect.js"; +export * from "./effects/StereoEffect.js"; + +export * from "./environments/DebugEnvironment.js"; +export * from "./environments/RoomEnvironment.js"; + +export * from "./exporters/DRACOExporter.js"; +export * from "./exporters/EXRExporter.js"; +export * from "./exporters/GLTFExporter.js"; +export * from "./exporters/KTX2Exporter.js"; +export * from "./exporters/OBJExporter.js"; +export * from "./exporters/PLYExporter.js"; +export * from "./exporters/STLExporter.js"; +export * from "./exporters/USDZExporter.js"; + +export * from "./geometries/BoxLineGeometry.js"; +export * from "./geometries/ConvexGeometry.js"; +export * from "./geometries/DecalGeometry.js"; +export * from "./geometries/ParametricFunctions.js"; +export * from "./geometries/ParametricGeometry.js"; +export * from "./geometries/RoundedBoxGeometry.js"; +export * from "./geometries/TeapotGeometry.js"; +export * from "./geometries/TextGeometry.js"; + +export * from "./helpers/LightProbeHelper.js"; +export * from "./helpers/OctreeHelper.js"; +export * from "./helpers/PositionalAudioHelper.js"; +export * from "./helpers/RectAreaLightHelper.js"; +export * from "./helpers/TextureHelper.js"; +export * from "./helpers/VertexNormalsHelper.js"; +export * from "./helpers/VertexTangentsHelper.js"; +export * from "./helpers/ViewHelper.js"; + +export * from "./interactive/HTMLMesh.js"; +export * from "./interactive/InteractiveGroup.js"; +export * from "./interactive/SelectionBox.js"; +export * from "./interactive/SelectionHelper.js"; + +export * from "./lights/LightProbeGenerator.js"; +export * from "./lights/RectAreaLightUniformsLib.js"; + +export * from "./lines/Line2.js"; +export * from "./lines/LineGeometry.js"; +export * from "./lines/LineMaterial.js"; +export * from "./lines/LineSegments2.js"; +export * from "./lines/LineSegmentsGeometry.js"; +export * from "./lines/Wireframe.js"; +export * from "./lines/WireframeGeometry2.js"; + +export * from "./loaders/3DMLoader.js"; +export * from "./loaders/3MFLoader.js"; +export * from "./loaders/AMFLoader.js"; +export * from "./loaders/BVHLoader.js"; +export * from "./loaders/ColladaLoader.js"; +export * from "./loaders/DDSLoader.js"; +export * from "./loaders/DRACOLoader.js"; +export * from "./loaders/EXRLoader.js"; +export * from "./loaders/FBXLoader.js"; +export * from "./loaders/FontLoader.js"; +export * from "./loaders/GCodeLoader.js"; +export * from "./loaders/GLTFLoader.js"; +export * from "./loaders/HDRCubeTextureLoader.js"; +export * from "./loaders/HDRLoader.js"; +export * from "./loaders/IESLoader.js"; +export * from "./loaders/KMZLoader.js"; +export * from "./loaders/KTX2Loader.js"; +export * from "./loaders/KTXLoader.js"; +export * from "./loaders/LDrawLoader.js"; +export * from "./loaders/LottieLoader.js"; +export * from "./loaders/LUT3dlLoader.js"; +export * from "./loaders/LUTCubeLoader.js"; +export * from "./loaders/LWOLoader.js"; +export * from "./loaders/MD2Loader.js"; +export * from "./loaders/MDDLoader.js"; +export * from "./loaders/MTLLoader.js"; +export * from "./loaders/NRRDLoader.js"; +export * from "./loaders/OBJLoader.js"; +export * from "./loaders/PCDLoader.js"; +export * from "./loaders/PDBLoader.js"; +export * from "./loaders/PLYLoader.js"; +export * from "./loaders/PVRLoader.js"; +export * from "./loaders/RGBELoader.js"; +export * from "./loaders/STLLoader.js"; +export * from "./loaders/SVGLoader.js"; +export * from "./loaders/TDSLoader.js"; +export * from "./loaders/TGALoader.js"; +export * from "./loaders/TIFFLoader.js"; +export * from "./loaders/TTFLoader.js"; +export * from "./loaders/UltraHDRLoader.js"; +export * from "./loaders/USDLoader.js"; +export * from "./loaders/VOXLoader.js"; +export * from "./loaders/VRMLLoader.js"; +export * from "./loaders/VTKLoader.js"; +export * from "./loaders/XYZLoader.js"; + +export * from "./materials/LDrawConditionalLineMaterial.js"; +export * from "./materials/MeshGouraudMaterial.js"; +export * from "./materials/MeshPostProcessingMaterial.js"; + +export * from "./math/Capsule.js"; +export * from "./math/ColorConverter.js"; +export * from "./math/ConvexHull.js"; +export * from "./math/ImprovedNoise.js"; +export * from "./math/Lut.js"; +export * from "./math/MeshSurfaceSampler.js"; +export * from "./math/OBB.js"; +export * from "./math/Octree.js"; +export * from "./math/SimplexNoise.js"; + +export * from "./misc/ConvexObjectBreaker.js"; +export * from "./misc/GPUComputationRenderer.js"; +export * from "./misc/Gyroscope.js"; +export * from "./misc/MD2Character.js"; +export * from "./misc/MD2CharacterComplex.js"; +export * from "./misc/MorphAnimMesh.js"; +export * from "./misc/MorphBlendMesh.js"; +export * from "./misc/ProgressiveLightMap.js"; +export * from "./misc/RollerCoaster.js"; +export * from "./misc/TubePainter.js"; +export * from "./misc/Volume.js"; +export * from "./misc/VolumeSlice.js"; + +export * from "./modifiers/CurveModifier.js"; +export * from "./modifiers/EdgeSplitModifier.js"; +export * from "./modifiers/SimplifyModifier.js"; +export * from "./modifiers/TessellateModifier.js"; + +export * from "./objects/GroundedSkybox.js"; +export * from "./objects/Lensflare.js"; +export * from "./objects/MarchingCubes.js"; +export * from "./objects/Reflector.js"; +export * from "./objects/ReflectorForSSRPass.js"; +export * from "./objects/Refractor.js"; +export * from "./objects/ShadowMesh.js"; +export * from "./objects/Sky.js"; +export * from "./objects/Water.js"; +export { Water as Water2 } from "./objects/Water2.js"; +export type { WaterOptions as Water2Options } from "./objects/Water2.js"; + +export * from "./physics/AmmoPhysics.js"; +export * from "./physics/RapierPhysics.js"; + +export * from "./postprocessing/AfterimagePass.js"; +export * from "./postprocessing/BloomPass.js"; +export * from "./postprocessing/BokehPass.js"; +export * from "./postprocessing/ClearPass.js"; +export * from "./postprocessing/CubeTexturePass.js"; +export * from "./postprocessing/DotScreenPass.js"; +export * from "./postprocessing/EffectComposer.js"; +export * from "./postprocessing/FilmPass.js"; +export * from "./postprocessing/GlitchPass.js"; +export * from "./postprocessing/GTAOPass.js"; +export * from "./postprocessing/HalftonePass.js"; +export * from "./postprocessing/LUTPass.js"; +export * from "./postprocessing/MaskPass.js"; +export * from "./postprocessing/OutlinePass.js"; +export * from "./postprocessing/OutputPass.js"; +export * from "./postprocessing/Pass.js"; +export * from "./postprocessing/RenderPass.js"; +export * from "./postprocessing/RenderPixelatedPass.js"; +export * from "./postprocessing/SAOPass.js"; +export * from "./postprocessing/SavePass.js"; +export * from "./postprocessing/ShaderPass.js"; +export * from "./postprocessing/SMAAPass.js"; +export * from "./postprocessing/SSAARenderPass.js"; +export * from "./postprocessing/SSAOPass.js"; +export * from "./postprocessing/SSRPass.js"; +export * from "./postprocessing/TAARenderPass.js"; +export * from "./postprocessing/TexturePass.js"; +export * from "./postprocessing/UnrealBloomPass.js"; + +export * from "./renderers/CSS2DRenderer.js"; +export * from "./renderers/CSS3DRenderer.js"; +export * from "./renderers/Projector.js"; +export * from "./renderers/SVGRenderer.js"; + +export * from "./shaders/ACESFilmicToneMappingShader.js"; +export * from "./shaders/AfterimageShader.js"; +export * from "./shaders/BasicShader.js"; +export * from "./shaders/BleachBypassShader.js"; +export * from "./shaders/BlendShader.js"; +export * from "./shaders/BokehShader.js"; +export { BokehShader as BokehShader2 } from "./shaders/BokehShader2.js"; +export * from "./shaders/BrightnessContrastShader.js"; +export * from "./shaders/ColorCorrectionShader.js"; +export * from "./shaders/ColorifyShader.js"; +export * from "./shaders/ConvolutionShader.js"; +export * from "./shaders/CopyShader.js"; +export * from "./shaders/DepthLimitedBlurShader.js"; +export * from "./shaders/DigitalGlitch.js"; +export * from "./shaders/DOFMipMapShader.js"; +export * from "./shaders/DotScreenShader.js"; +export * from "./shaders/ExposureShader.js"; +export * from "./shaders/FilmShader.js"; +export * from "./shaders/FocusShader.js"; +export * from "./shaders/FreiChenShader.js"; +export * from "./shaders/FXAAShader.js"; +export * from "./shaders/GammaCorrectionShader.js"; +export * from "./shaders/GodRaysShader.js"; +export * from "./shaders/GTAOShader.js"; +export * from "./shaders/HalftoneShader.js"; +export * from "./shaders/HorizontalBlurShader.js"; +export * from "./shaders/HorizontalTiltShiftShader.js"; +export * from "./shaders/HueSaturationShader.js"; +export * from "./shaders/KaleidoShader.js"; +export * from "./shaders/LuminosityHighPassShader.js"; +export * from "./shaders/LuminosityShader.js"; +export * from "./shaders/MirrorShader.js"; +export * from "./shaders/NormalMapShader.js"; +export * from "./shaders/OutputShader.js"; +export * from "./shaders/RGBShiftShader.js"; +export * from "./shaders/SAOShader.js"; +export * from "./shaders/SepiaShader.js"; +export * from "./shaders/SMAAShader.js"; +export * from "./shaders/SobelOperatorShader.js"; +export * from "./shaders/SSAOShader.js"; +export * from "./shaders/SSRShader.js"; +export * from "./shaders/SubsurfaceScatteringShader.js"; +export * from "./shaders/TechnicolorShader.js"; +export * from "./shaders/ToonShader.js"; +export * from "./shaders/TriangleBlurShader.js"; +export * from "./shaders/UnpackDepthRGBAShader.js"; +export * from "./shaders/VelocityShader.js"; +export * from "./shaders/VerticalBlurShader.js"; +export * from "./shaders/VerticalTiltShiftShader.js"; +export * from "./shaders/VignetteShader.js"; +export * from "./shaders/VolumeShader.js"; +export * from "./shaders/WaterRefractionShader.js"; + +export * from "./textures/FlakesTexture.js"; + +export * as BufferGeometryUtils from "./utils/BufferGeometryUtils.js"; +export * as CameraUtils from "./utils/CameraUtils.js"; +export * as GeometryCompressionUtils from "./utils/GeometryCompressionUtils.js"; +export * as GeometryUtils from "./utils/GeometryUtils.js"; +export * from "./utils/LDrawUtils.js"; +export * as SceneUtils from "./utils/SceneUtils.js"; +export * from "./utils/ShadowMapViewer.js"; +export * as SkeletonUtils from "./utils/SkeletonUtils.js"; +export * as SortUtils from "./utils/SortUtils.js"; +export * from "./utils/UVsDebug.js"; +export * from "./utils/WebGLTextureUtils.js"; +export * from "./utils/WorkerPool.js"; + +export * from "./webxr/ARButton.js"; +export * from "./webxr/OculusHandModel.js"; +export * from "./webxr/OculusHandPointerModel.js"; +export * from "./webxr/Text2D.js"; +export * from "./webxr/VRButton.js"; +export * from "./webxr/XRButton.js"; +export * from "./webxr/XRControllerModelFactory.js"; +export * from "./webxr/XREstimatedLight.js"; +export * from "./webxr/XRHandMeshModel.js"; +export * from "./webxr/XRHandModelFactory.js"; +export * from "./webxr/XRHandPrimitiveModel.js"; +export * from "./webxr/XRPlanes.js"; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/animation/AnimationClipCreator.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/animation/AnimationClipCreator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..61f559fec648e99fee90bd33761ebda0e3a5d223 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/animation/AnimationClipCreator.d.ts @@ -0,0 +1,12 @@ +import { AnimationClip, Vector3 } from "three"; + +export interface AnimationClipCreator { + CreateRotationAnimation(period: number, axis: string): AnimationClip; + CreateScaleAxisAnimation(period: number, axis: string): AnimationClip; + CreateShakeAnimation(duration: number, shakeScale: Vector3): AnimationClip; + CreatePulsationAnimation(duration: number, pulseScale: number): AnimationClip; + CreateVisibilityAnimation(duration: number): AnimationClip; + CreateMaterialColorAnimation(duration: number, colors: number[]): AnimationClip; +} + +export const AnimationClipCreator: AnimationClipCreator; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/animation/CCDIKSolver.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/animation/CCDIKSolver.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fa82caaf8ab303c8261186f1dfc5c5e8e39ada6e --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/animation/CCDIKSolver.d.ts @@ -0,0 +1,44 @@ +import { LineBasicMaterial, MeshBasicMaterial, Object3D, SkinnedMesh, SphereGeometry, Vector3 } from "three"; + +// eslint-disable-next-line @typescript-eslint/naming-convention +export interface IK { + effector: number; + iteration?: number | undefined; + links: Array<{ + enabled?: boolean | undefined; + index: number; + limitation?: Vector3 | undefined; + rotationMin?: Vector3 | undefined; + rotationMax?: Vector3 | undefined; + }>; + minAngle?: number | undefined; + maxAngle?: number | undefined; + target: number; + blendFactor?: number | undefined; +} + +export class CCDIKSolver { + mesh: SkinnedMesh; + iks: IK[]; + + constructor(mesh: SkinnedMesh, iks?: IK[]); + + update(globalBlendFactor?: number): this; + updateOne(ik: IK, overrideBlend?: number): this; + createHelper(sphereSize?: number): CCDIKHelper; +} + +export class CCDIKHelper extends Object3D { + root: SkinnedMesh; + iks: IK[]; + + sphereGeometry: SphereGeometry; + targetSphereMaterial: MeshBasicMaterial; + effectorSphereMaterial: MeshBasicMaterial; + linkSphereMaterial: MeshBasicMaterial; + lineMaterial: LineBasicMaterial; + + constructor(mesh: SkinnedMesh, iks?: IK[], sphereSize?: number); + + dispose(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/capabilities/WebGL.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/capabilities/WebGL.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..43af4c7c5038be3f6a75a83f23dfae8a52d98831 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/capabilities/WebGL.d.ts @@ -0,0 +1,6 @@ +export default class WebGL { + static isWebGL2Available(): boolean; + static isColorSpaceAvailable(colorSpace: PredefinedColorSpace): boolean; + static getWebGL2ErrorMessage(): HTMLElement; + static getErrorMessage(version: number): HTMLElement; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/capabilities/WebGPU.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/capabilities/WebGPU.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d61b3dbe296a9e3e222c69e84b454d2e9ee44f3b --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/capabilities/WebGPU.d.ts @@ -0,0 +1,7 @@ +// tslint:disable-next-line:no-unnecessary-class + +export default class WebGPU { + static isAvailable(): boolean; + static getStaticAdapter(): unknown; + static getErrorMessage(): HTMLElement; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/controls/ArcballControls.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/controls/ArcballControls.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..59226ddf3f0a532da186b5f4c1b3620ba8f55124 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/controls/ArcballControls.d.ts @@ -0,0 +1,208 @@ +import { Camera, Controls, Raycaster, Scene } from "three"; + +export type ArcballControlsMouseActionOperation = "PAN" | "ROTATE" | "ZOOM" | "FOV"; + +export type ArcballControlsMouseActionMouse = 0 | 1 | 2 | "WHEEL"; + +export type ArcballControlsMouseActionKey = "SHIFT" | "CTRL"; + +export interface ArcballControlsEventMap { + /** + * Fires when the camera has been transformed by the controls. + */ + change: {}; + + /** + * Fires when an interaction was initiated. + */ + start: {}; + + /** + * Fires when an interaction has finished. + */ + end: {}; +} + +/** + * Arcball controls allow the camera to be controlled by a virtual trackball with full touch support and advanced + * navigation functionality. + */ +declare class ArcballControls extends Controls { + /** + * The scene rendered by the camera. + */ + scene: Scene | null; + + /** + * The size of the gizmo relative to the screen width and height. Default is 0.67. + */ + radiusFactor: number; + + /** + * Duration time of focus animation. + */ + focusAnimationTime: number; + + /** + * If true, camera's near and far values will be adjusted every time zoom is performed trying to maintain the same + * visible portion given by initial near and far values ( {@link PerspectiveCamera} only ). Default is false. + */ + adjustNearFar: boolean; + + /** + * The scaling factor used when performing zoom operation. + */ + scaleFactor: number; + + /** + * The damping inertia used if [page:.enableAnimations] is set to true. + */ + dampingFactor: number; + + /** + * Maximum angular velocity allowed on rotation animation start. + */ + wMax: number; + + /** + * Set to true to enable animations for rotation (damping) and focus operation. Default is true. + */ + enableAnimations: boolean; + + /** + * Enable or disable camera focusing on double-tap (or click) operations. Default is true. + */ + enableFocus: boolean; + + /** + * When set to true, a grid will appear when panning operation is being performed (desktop interaction only). Default is false. + */ + enableGrid: boolean; + + /** + * Set to true to make zoom become cursor centered. + */ + cursorZoom: boolean; + + /** + * Speed of rotation. Default is 1. + */ + rotateSpeed: number; + + /** + * Enable or disable camera panning. Default is true. + */ + enablePan: boolean; + + /** + * Enable or disable camera rotation. Default is true. + */ + enableRotate: boolean; + + /** + * Enable or disable zooming of the camera. + */ + enableZoom: boolean; + + /** + * How far you can dolly in ( {@link PerspectiveCamera} only ). Default is 0. + */ + minDistance: number; + + /** + * How far you can dolly out ( {@link PerspectiveCamera} only ). Default is Infinity. + */ + maxDistance: number; + + /** + * How far you can zoom in ( {@link OrthographicCamera} only ). Default is 0. + */ + minZoom: number; + + /** + * How far you can zoom out ( {@link OrthographicCamera} only ). Default is Infinity. + */ + maxZoom: number; + + /** + * @param camera The camera to be controlled. The camera must not be a child of another object, unless that object + * is the scene itself. + * @param domElement The HTML element used for event listeners. (optional) + * @param scene The scene rendered by the camera. If not given, gizmos cannot be shown. (optional) + */ + constructor(camera: Camera, domElement?: HTMLElement | null, scene?: Scene | null); + + /** + * Set a new mouse action by specifying the operation to be performed and a mouse/key combination. In case of + * conflict, replaces the existing one. + * @param operation Operations can be specified as 'ROTATE', 'PAN', 'FOV' or 'ZOOM'. + * @param mouse Mouse inputs can be specified as mouse buttons 0, 1 and 2 or 'WHEEL' for wheel notches. + * @param key Keyboard modifiers can be specified as 'CTRL', 'SHIFT' or null if not needed. + */ + setMouseAction( + operation: ArcballControlsMouseActionOperation, + mouse: ArcballControlsMouseActionMouse, + key?: ArcballControlsMouseActionKey | null, + ): boolean; + + /** + * Removes a mouse action by specifying its mouse/key combination. + * @param mouse Mouse inputs can be specified as mouse buttons 0, 1 and 2 or 'WHEEL' for wheel notches. + * @param key Keyboard modifiers can be specified as 'CTRL', 'SHIFT' or null if not needed. + */ + unsetMouseAction(mouse: ArcballControlsMouseActionMouse, key?: ArcballControlsMouseActionKey | null): boolean; + + /** + * Make gizmos more or less visible. + */ + activateGizmos(isActive: boolean): void; + + /** + * Set the camera to be controlled. Must be called in order to set a new camera to be controlled. + */ + setCamera(camera: Camera): void; + + /** + * Set the visible property of gizmos. + */ + setGizmosVisible(value: boolean): void; + + /** + * Update the `radiusFactor` value, redraw the gizmo and send a `changeEvent` to visualize the changes. + */ + setTbRadius(value: number): void; + + /** + * Reset the controls to their state from either the last time the {@link .saveState} was called, or the initial + * state. + */ + reset(): void; + + /** + * Copy the current state to clipboard (as a readable JSON text). + */ + copyState(): void; + + /** + * Set the controls state from the clipboard, assumes that the clipboard stores a JSON text as saved from + * {@link .copyState}. + */ + pasteState(): void; + + /** + * Save the current state of the controls. This can later be recovered with {@link .reset}. + */ + saveState(): void; + + /** + * Returns the {@link Raycaster} object that is used for user interaction. This object is shared between all + * instances of ArcballControls. If you set the [.layers]{@link Object3D.layers} property of the + * {@link ArcballControls}, you will also want to set the [.layers]{@link Raycaster.layers} property on the + * {@link Raycaster} with a matching value, or else the {@link ArcballControls} won't work as expected. + */ + getRaycaster(): Raycaster; + + update(): void; +} + +export { ArcballControls }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/controls/DragControls.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/controls/DragControls.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4c28f85c0ece6230f28fc4ff7220a1c42ec61b26 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/controls/DragControls.d.ts @@ -0,0 +1,81 @@ +import { Camera, Controls, MOUSE, Object3D, Raycaster, TOUCH } from "three"; + +export interface DragControlsEventMap { + /** + * Fires when the pointer is moved onto a 3D object, or onto one of its children. + */ + hoveron: { object: Object3D }; + + /** + * Fires when the pointer is moved out of a 3D object. + */ + hoveroff: { object: Object3D }; + + /** + * Fires when the user starts to drag a 3D object. + */ + dragstart: { object: Object3D }; + + /** + * Fires when the user drags a 3D object. + */ + drag: { object: Object3D }; + + /** + * Fires when the user has finished dragging a 3D object. + */ + dragend: { object: Object3D }; +} + +declare class DragControls extends Controls { + /** + * An array of draggable 3D objects. + */ + objects: Object3D[]; + + /** + * Whether children of draggable objects can be dragged independently from their parent. Default is `true`. + */ + recursive: boolean; + + /** + * This option only works if the {@link .objects} array contains a single draggable group object. If set to `true`, + * {@link DragControls} does not transform individual objects but the entire group. Default is `false`. + */ + transformGroup: boolean; + + /** + * The speed at which the object will rotate when dragged in `rotate` mode. The higher the number the faster the + * rotation. Default is `1`. + */ + rotateSpeed: number; + + /** + * The internal raycaster used for detecting 3D objects. + */ + raycaster: Raycaster; + + /** + * This object defines what type of actions are assigned to the available mouse buttons. + */ + mouseButtons: { + LEFT?: MOUSE | null | undefined; + MIDDLE?: MOUSE | null | undefined; + RIGHT?: MOUSE | null | undefined; + }; + + /** + * This object defines what type of actions are assigned to what kind of touch interaction. + */ + touches: { ONE?: TOUCH | null | undefined }; + + /** + * Creates a new instance of DragControls. + * @param objects An array of draggable 3D objects. + * @param camera The camera of the rendered scene. + * @param domElement The HTML element used for event listeners. (optional) + */ + constructor(objects: Object3D[], camera: Camera, domElement?: HTMLElement | null); +} + +export { DragControls }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/controls/FirstPersonControls.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/controls/FirstPersonControls.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..23e50827668592d40eafb6b8c7055a5270cf0141 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/controls/FirstPersonControls.d.ts @@ -0,0 +1,101 @@ +import { Camera, Controls, Vector3 } from "three"; + +/** + * This class is an alternative implementation of {@link FlyControls}. + */ +declare class FirstPersonControls extends Controls<{}> { + /** + * The movement speed. Default is *1*. + */ + movementSpeed: number; + + /** + * The look around speed. Default is `0.005`. + */ + lookSpeed: number; + + /** + * Whether or not it's possible to vertically look around. Default is `true`. + */ + lookVertical: boolean; + + /** + * Whether or not the camera is automatically moved forward. Default is `false`. + */ + autoForward: boolean; + + /** + * Whether or not it's possible to look around. Default is `true`. + */ + activeLook: boolean; + + /** + * Whether or not the camera's height influences the forward movement speed. Default is `false`. + * Use the properties {@link .heightCoef}, {@link .heightMin} and {@link .heightMax} for configuration + */ + heightSpeed: boolean; + + /** + * Determines how much faster the camera moves when it's y-component is near {@link .heightMax}. Default is *1*. + */ + heightCoef: number; + + /** + * Lower camera height limit used for movement speed adjustment. Default is *0*. + */ + heightMin: number; + + /** + * Upper camera height limit used for movement speed adjustment. Default is *1*. + */ + heightMax: number; + + /** + * Whether or not looking around is vertically constrained by [{@link .verticalMin}, {@link .verticalMax}]. Default + * is `false`. + */ + constrainVertical: boolean; + + /** + * How far you can vertically look around, lower limit. Range is 0 to Math.PI radians. Default is *0*. + */ + verticalMin: number; + + /** + * How far you can vertically look around, upper limit. Range is 0 to Math.PI radians. Default is `Math.PI`. + */ + verticalMax: number; + + /** + * Whether or not the mouse is pressed down. Read-only property. + */ + mouseDragOn: boolean; + + /** + * Creates a new instance of {@link FirstPersonControls}. + * @param object The camera to be controlled. + * @param domElement The HTML element used for event listeners. (optional) + */ + constructor(object: Camera, domElement?: HTMLElement); + + /** + * Should be called if the application window is resized. + */ + handleResize(): void; + + /** + * Ensures the controls orient the camera towards the defined target position. + * @param vector A vector representing the target position. + */ + lookAt(vector: Vector3): this; + + /** + * Ensures the controls orient the camera towards the defined target position. + * @param x The x component of the world space position. + * @param y The y component of the world space position. + * @param z The z component of the world space position. + */ + lookAt(x: number, y: number, z: number): this; +} + +export { FirstPersonControls }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/controls/FlyControls.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/controls/FlyControls.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bb4fe1370ee9e17bb01845d10ff4d2a27543d57e --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/controls/FlyControls.d.ts @@ -0,0 +1,44 @@ +import { Camera, Controls } from "three"; + +export interface FlyControlsEventMap { + /** + * Fires when the camera has been transformed by the controls. + */ + change: {}; +} + +/** + * {@link FlyControls} enables a navigation similar to fly modes in DCC tools like Blender. You can arbitrarily + * transform the camera in 3D space without any limitations (e.g. focus on a specific target). + */ +declare class FlyControls extends Controls { + /** + * The movement speed. Default is `1`. + */ + movementSpeed: number; + + /** + * The rotation speed. Default is `0.005`. + */ + rollSpeed: number; + + /** + * If set to `true`, you can only look around by performing a drag interaction. Default is `false`. + */ + dragToLook: boolean; + + /** + * If set to `true`, the camera automatically moves forward (and does not stop) when initially translated. Default + * is `false`. + */ + autoForward: boolean; + + /** + * Creates a new instance of {@link FlyControls}. + * @param object The camera to be controlled. + * @param domElement The HTML element used for event listeners. (optional) + */ + constructor(object: Camera, domElement?: HTMLElement | null); +} + +export { FlyControls }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/controls/MapControls.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/controls/MapControls.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f47a9b4c4b06d531464d99aaa3f0f679c58077b3 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/controls/MapControls.d.ts @@ -0,0 +1,21 @@ +import { Camera } from "three"; +import { OrbitControls } from "./OrbitControls.js"; + +/** + * MapControls performs orbiting, dollying (zooming), and panning. + * Unlike TrackballControls, it maintains the "up" direction + * object.up (+Y by default). + * + * Orbit - right mouse, or left mouse + ctrl/meta/shiftKey / touch: + * two-finger rotate + * Zoom - middle mouse, or mousewheel / touch: two-finger spread or squish + * Pan - left mouse, or arrow keys / touch: one-finger move + * + * @param object - The camera to be controlled. The camera must not + * be a child of another object, unless that object is the scene itself. + * @param domElement - The HTML element used for + * event listeners. + */ +export class MapControls extends OrbitControls { + constructor(object: Camera, domElement?: HTMLElement); +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/controls/OrbitControls.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/controls/OrbitControls.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0b5811d567b55c2935fcf65b190ba24f3038a12a --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/controls/OrbitControls.d.ts @@ -0,0 +1,256 @@ +import { Camera, Controls, MOUSE, TOUCH, Vector3 } from "three"; + +export interface OrbitControlsEventMap { + /** + * Fires when the camera has been transformed by the controls. + */ + change: {}; + + /** + * Fires when an interaction was initiated. + */ + start: {}; + + /** + * Fires when an interaction has finished. + */ + end: {}; +} + +/** + * Orbit controls allow the camera to orbit around a target. + */ +declare class OrbitControls extends Controls { + /** + * The focus point of the controls, the {@link .object} orbits around this. It can be updated manually at any point + * to change the focus of the controls. + */ + target: Vector3; + + /** + * The focus point of the {@link .minTargetRadius} and {@link .maxTargetRadius} limits. It can be updated manually + * at any point to change the center of interest for the {@link .target}. + */ + cursor: Vector3; + + /** + * How far you can dolly in ( {@link PerspectiveCamera} only ). Default is 0. + */ + minDistance: number; + + /** + * How far you can dolly out ( {@link PerspectiveCamera} only ). Default is Infinity. + */ + maxDistance: number; + + /** + * How far you can zoom in ( {@link OrthographicCamera} only ). Default is 0. + */ + minZoom: number; + + /** + * How far you can zoom out ( {@link OrthographicCamera} only ). Default is Infinity. + */ + maxZoom: number; + + /** + * How close you can get the target to the 3D {@link .cursor}. Default is 0. + */ + minTargetRadius: number; + + /** + * How far you can move the target from the 3D {@link .cursor}. Default is Infinity. + */ + maxTargetRadius: number; + + /** + * How far you can orbit vertically, lower limit. Range is 0 to Math.PI radians, and default is 0. + */ + minPolarAngle: number; + + /** + * How far you can orbit vertically, upper limit. Range is 0 to Math.PI radians, and default is Math.PI. + */ + maxPolarAngle: number; + + /** + * How far you can orbit horizontally, lower limit. If set, the interval [ min, max ] must be a sub-interval of + * [ - 2 PI, 2 PI ], with ( max - min < 2 PI ). Default is Infinity. + */ + minAzimuthAngle: number; + + /** + * How far you can orbit horizontally, upper limit. If set, the interval [ min, max ] must be a sub-interval of + * [ - 2 PI, 2 PI ], with ( max - min < 2 PI ). Default is Infinity. + */ + maxAzimuthAngle: number; + + /** + * Set to true to enable damping (inertia), which can be used to give a sense of weight to the controls. Default is + * false. + * Note that if this is enabled, you must call {@link .update}() in your animation loop. + */ + enableDamping: boolean; + + /** + * The damping inertia used if .enableDamping is set to true. Default is `0.05`. + * Note that for this to work, you must call {@link .update}() in your animation loop. + */ + dampingFactor: number; + + /** + * Enable or disable zooming (dollying) of the camera. + */ + enableZoom: boolean; + + /** + * Speed of zooming / dollying. Default is 1. + */ + zoomSpeed: number; + + /** + * Enable or disable horizontal and vertical rotation of the camera. Default is true. + * Note that it is possible to disable a single axis by setting the min and max of the + * [polar angle]{@link .minPolarAngle} or [azimuth angle]{@link .minAzimuthAngle} to the same value, which will + * cause the vertical or horizontal rotation to be fixed at that value. + */ + enableRotate: boolean; + + /** + * Speed of rotation. Default is 1. + */ + rotateSpeed: number; + + /** + * How fast to rotate the camera when the keyboard is used. Default is 1. + */ + keyRotateSpeed: number; + + /** + * Enable or disable camera panning. Default is true. + */ + enablePan: boolean; + + /** + * Speed of panning. Default is 1. + */ + panSpeed: number; + + /** + * Defines how the camera's position is translated when panning. If true, the camera pans in screen space. + * Otherwise, the camera pans in the plane orthogonal to the camera's up direction. Default is `true`. + */ + screenSpacePanning: boolean; + + /** + * How fast to pan the camera when the keyboard is used. Default is 7.0 pixels per keypress. + */ + keyPanSpeed: number; + + /** + * Setting this property to `true` allows to zoom to the cursor's position. Default is `false`. + */ + zoomToCursor: boolean; + + /** + * Set to true to automatically rotate around the target. + * Note that if this is enabled, you must call {@link .update}() in your animation loop. If you want the auto-rotate speed + * to be independent of the frame rate (the refresh rate of the display), you must pass the time `deltaTime`, in + * seconds, to {@link .update}(). + */ + autoRotate: boolean; + + /** + * How fast to rotate around the target if {@link .autoRotate} is true. Default is 2.0, which equates to 30 seconds + * per orbit at 60fps. + * Note that if {@link .autoRotate} is enabled, you must call {@link .update}() in your animation loop. + */ + autoRotateSpeed: number; + + /** + * This object contains references to the keycodes for controlling camera panning. Default is the 4 arrow keys. + */ + keys: { LEFT: string; UP: string; RIGHT: string; BOTTOM: string }; + + /** + * This object contains references to the mouse actions used by the controls. + */ + mouseButtons: { + LEFT?: MOUSE | null | undefined; + MIDDLE?: MOUSE | null | undefined; + RIGHT?: MOUSE | null | undefined; + }; + + /** + * This object contains references to the touch actions used by the controls. + */ + touches: { ONE?: TOUCH | null | undefined; TWO?: TOUCH | null | undefined }; + + /** + * Used internally by the {@link .saveState} and {@link .reset} methods. + */ + target0: Vector3; + + /** + * Used internally by the {@link .saveState} and {@link .reset} methods. + */ + position0: Vector3; + + /** + * Used internally by the {@link .saveState} and {@link .reset} methods. + */ + zoom0: number; + + /** + * @param object The camera to be controlled. The camera must not be a child of another object, unless that object + * is the scene itself. + * @param domElement The HTML element used for event listeners. (optional) + */ + constructor(object: Camera, domElement?: HTMLElement | null); + + /** + * Get the current vertical rotation, in radians. + */ + getPolarAngle(): number; + + /** + * Get the current horizontal rotation, in radians. + */ + getAzimuthalAngle(): number; + + /** + * Returns the distance from the camera to the target. + */ + getDistance(): number; + + /** + * Adds key event listeners to the given DOM element. `window` is a recommended argument for using this method. + * @param domElement + */ + listenToKeyEvents(domElement: HTMLElement | Window): void; + + /** + * Removes the key event listener previously defined with {@link .listenToKeyEvents}(). + */ + stopListenToKeyEvents(): void; + + /** + * Save the current state of the controls. This can later be recovered with {@link .reset}. + */ + saveState(): void; + + /** + * Reset the controls to their state from either the last time the {@link .saveState} was called, or the initial + * state. + */ + reset(): void; + + /** + * Update the controls. Must be called after any manual changes to the camera's transform, or in the update loop if + * {@link .autoRotate} or {@link .enableDamping} are set. `deltaTime`, in seconds, is optional, and is only required + * if you want the auto-rotate speed to be independent of the frame rate (the refresh rate of the display). + */ + update(deltaTime?: number | null): boolean; +} + +export { OrbitControls }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/controls/PointerLockControls.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/controls/PointerLockControls.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c05c95c29d8da05aa81f6891e6459222c0b993cf --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/controls/PointerLockControls.d.ts @@ -0,0 +1,84 @@ +import { Camera, Controls, Vector3 } from "three"; + +export interface PointerLockControlsEventMap { + /** + * Fires when the user moves the mouse. + */ + change: {}; + + /** + * Fires when the pointer lock status is "locked" (in other words: the mouse is captured). + */ + lock: {}; + + /** + * Fires when the pointer lock status is "unlocked" (in other words: the mouse is not captured anymore). + */ + unlock: {}; +} + +/** + * The implementation of this class is based on the [Pointer Lock API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Pointer_Lock_API}. + * {@link PointerLockControls} is a perfect choice for first person 3D games. + */ +declare class PointerLockControls extends Controls { + /** + * Whether or not the controls are locked. + */ + isLocked: boolean; + + /** + * Camera pitch, lower limit. Range is 0 to Math.PI radians. Default is 0. + */ + minPolarAngle: number; + + /** + * Camera pitch, upper limit. Range is 0 to Math.PI radians. Default is Math.PI. + */ + maxPolarAngle: number; + + /** + * Multiplier for how much the pointer movement influences the camera rotation. Default is 1. + */ + pointerSpeed: number; + + /** + * Creates a new instance of {@link PointerLockControls}. + * @param camera The camera of the rendered scene. + * @param domElement The HTML element used for event listeners. + */ + constructor(camera: Camera, domElement?: HTMLElement | null); + + /** + * Returns the look direction of the camera. + * @param v The target vector. + */ + getDirection(v: Vector3): Vector3; + + /** + * Moves the camera forward parallel to the xz-plane. Assumes camera.up is y-up. + * @param distance The signed distance. + */ + moveForward(distance: number): void; + + /** + * Moves the camera sidewards parallel to the xz-plane. + * @param distance The signed distance. + */ + moveRight(distance: number): void; + + /** + * Activates the pointer lock. + * + * @param {boolean} [unadjustedMovement=false] - Disables OS-level adjustment for mouse acceleration, and accesses raw mouse input instead. + * Setting it to true will disable mouse acceleration. + */ + lock(unadjustedMovement?: boolean): void; + + /** + * Exits the pointer lock. + */ + unlock(): void; +} + +export { PointerLockControls }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/controls/TrackballControls.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/controls/TrackballControls.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d1846cb284f112c102984dfe2d2a0c403daded21 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/controls/TrackballControls.d.ts @@ -0,0 +1,142 @@ +import { Camera, Controls, MOUSE, Vector3 } from "three"; + +export interface TrackballControlsEventMap { + /** + * Fires when the camera has been transformed by the controls. + */ + change: {}; + + /** + * Fires when an interaction (e.g. touch) was initiated. + */ + start: {}; + + /** + * Fires when an interaction has finished. + */ + end: {}; +} + +/** + * TrackballControls is similar to {@link OrbitControls}. However, it does not maintain a constant camera + * [up]{@link Object3D.up} vector. That means if the camera orbits over the “north” and “south” poles, it does not flip + * to stay "right side up". + */ +declare class TrackballControls extends Controls { + /** + * Represents the properties of the screen. Automatically set when {@link .handleResize}() is called. + * - left: Represents the offset in pixels to the screen's left boundary. + * - top: Represents the offset in pixels to the screen's top boundary. + * - width: Represents the screen width in pixels. + * - height: Represents the screen height in pixels. + */ + screen: { left: number; top: number; width: number; height: number }; + + /** + * The rotation speed. Default is `1.0`. + */ + rotateSpeed: number; + + /** + * The zoom speed. Default is `1.2`. + */ + zoomSpeed: number; + + /** + * The pan speed. Default is `0.3`. + */ + panSpeed: number; + + /** + * Whether or not rotation is disabled. Default is `false`. + */ + noRotate: boolean; + + /** + * Whether or not zooming is disabled. Default is `false`. + */ + noZoom: boolean; + + /** + * Whether or not panning is disabled. Default is `false`. + */ + noPan: boolean; + + /** + * Whether or not damping is disabled. Default is `false`. + */ + staticMoving: boolean; + + /** + * Defines the intensity of damping. Only considered if {@link .staticMoving} is set to `false`. Default is `0.2`. + */ + dynamicDampingFactor: number; + + /** + * How far you can dolly in ( {@link PerspectiveCamera} only ). Default is *0*. + */ + minDistance: number; + + /** + * How far you can dolly out ( {@link PerspectiveCamera} only ). Default is `Infinity`. + */ + maxDistance: number; + + /** + * How far you can zoom out ( {@link OrthographicCamera} only ). Default is `Infinity`. + */ + minZoom: number; + + /** + * How far you can zoom in ( {@link OrthographicCamera} only ). Default is *0*. + */ + maxZoom: number; + + /** + * This array holds keycodes for controlling interactions. + * - When the first defined key is pressed, all mouse interactions (left, middle, right) performs orbiting. + * - When the second defined key is pressed, all mouse interactions (left, middle, right) performs zooming. + * - When the third defined key is pressed, all mouse interactions (left, middle, right) performs panning. + * + * Default is *KeyA, KeyS, KeyD* which represents A, S, D. + */ + keys: [string, string, string]; + + /** + * This object contains references to the mouse actions used by the controls. + * - .LEFT is assigned with `THREE.MOUSE.ROTATE` + * - .MIDDLE is assigned with `THREE.MOUSE.ZOOM` + * - .RIGHT is assigned with `THREE.MOUSE.PAN` + */ + mouseButtons: { + LEFT?: MOUSE | null | undefined; + MIDDLE?: MOUSE | null | undefined; + RIGHT?: MOUSE | null | undefined; + }; + + /** + * The focus point of the controls. + */ + target: Vector3; + + /** + * Creates a new instance of TrackballControls. + * @param camera The camera of the rendered scene. + * @param domElement The HTML element used for event listeners. (optional) + */ + constructor(camera: Camera, domElement?: HTMLElement | null); + + /** + * Should be called if the application window is resized. + */ + handleResize(): void; + + update(): void; + + /** + * Resets the controls to its initial state. + */ + reset(): void; +} + +export { TrackballControls }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/controls/TransformControls.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/controls/TransformControls.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a7a20131e36bb48dcb8128ed456a19f896a2ae26 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/controls/TransformControls.d.ts @@ -0,0 +1,308 @@ +import { Camera, ColorRepresentation, Controls, Mesh, Object3D, Quaternion, Raycaster, Vector3 } from "three"; + +export type TransformControlsMode = "translate" | "rotate" | "scale"; + +export interface TransformControlsEventMap { + /** + * Fires if any type of change (object or property change) is performed. Property changes are separate events you + * can add event listeners to. The event type is "propertyname-changed". + */ + change: {}; + + /** + * Fires if a pointer (mouse/touch) becomes active. + */ + mouseDown: { mode: TransformControlsMode }; + + /** + * Fires if a pointer (mouse/touch) is no longer active. + */ + mouseUp: { mode: TransformControlsMode }; + + /** + * Fires if the controlled 3D object is changed. + */ + objectChange: {}; + + "camera-changed": { value: unknown }; + "object-changed": { value: unknown }; + "enabled-changed": { value: unknown }; + "axis-changed": { value: unknown }; + "mode-changed": { value: unknown }; + "translationSnap-changed": { value: unknown }; + "rotationSnap-changed": { value: unknown }; + "scaleSnap-changed": { value: unknown }; + "space-changed": { value: unknown }; + "size-changed": { value: unknown }; + "dragging-changed": { value: unknown }; + "showX-changed": { value: unknown }; + "showY-changed": { value: unknown }; + "showZ-changed": { value: unknown }; + "minX-changed": { value: unknown }; + "maxX-changed": { value: unknown }; + "minY-changed": { value: unknown }; + "maxY-changed": { value: unknown }; + "minZ-changed": { value: unknown }; + "maxZ-changed": { value: unknown }; + "worldPosition-changed": { value: unknown }; + "worldPositionStart-changed": { value: unknown }; + "worldQuaternion-changed": { value: unknown }; + "worldQuaternionStart-changed": { value: unknown }; + "cameraPosition-changed": { value: unknown }; + "cameraQuaternion-changed": { value: unknown }; + "pointStart-changed": { value: unknown }; + "pointEnd-changed": { value: unknown }; + "rotationAxis-changed": { value: unknown }; + "rotationAngle-changed": { value: unknown }; + "eye-changed": { value: unknown }; +} + +/** + * This class can be used to transform objects in 3D space by adapting a similar interaction model of DCC tools like + * Blender. Unlike other controls, it is not intended to transform the scene's camera. + * + * TransformControls expects that its attached 3D object is part of the scene graph. + */ +declare class TransformControls extends Controls { + /** + * The camera of the rendered scene. + */ + camera: Camera; + + /** + * The current transformation axis. + */ + axis: "X" | "Y" | "Z" | "E" | "XY" | "YZ" | "XZ" | "XYZ" | "XYZE" | null; + + /** + * The current transformation mode. Possible values are "translate", "rotate" and "scale". Default is `translate`. + */ + mode: TransformControlsMode; + + /** + * By default, 3D objects are continuously translated. If you set this property to a numeric value (world units), + * you can define in which steps the 3D object should be translated. Default is `null`. + */ + translationSnap: number | null; + + /** + * By default, 3D objects are continuously rotated. If you set this property to a numeric value (radians), you can + * define in which steps the 3D object should be rotated. Default is `null`. + */ + rotationSnap: number | null; + + /** + * By default, 3D objects are continuously scaled. If you set this property to a numeric value, you can define in + * which steps the 3D object should be scaled. Default is `null`. + */ + scaleSnap: number | null; + + /** + * Defines in which coordinate space transformations should be performed. Possible values are "world" and "local". + * Default is `world`. + */ + space: "world" | "local"; + + /** + * The size of the helper UI (axes/planes). Default is *1*. + */ + size: number; + + /** + * Whether or not dragging is currently performed. Read-only property. + */ + dragging: boolean; + + /** + * Whether or not the x-axis helper should be visible. Default is `true`. + */ + showX: boolean; + + /** + * Whether or not the y-axis helper should be visible. Default is `true`. + */ + showY: boolean; + + /** + * Whether or not the z-axis helper should be visible. Default is `true`. + */ + showZ: boolean; + + /** + * The minimum allowed X position during translation. Default is `-Infinity`. + */ + minx: number; + + /** + * The maximum allowed X position during translation. Default is `Infinity`. + */ + maxX: number; + + /** + * The minimum allowed Y position during translation. Default is `-Infinity`. + */ + minY: number; + + /** + * The maximum allowed Y position during translation. Default is `Infinity`. + */ + maxY: number; + + /** + * The minimum allowed Z position during translation. Default is `-Infinity`. + */ + minZ: number; + + /** + * The maximum allowed Z position during translation. Default is `Infinity`. + */ + maxZ: number; + + /** + * Creates a new instance of TransformControls. + * @param camera The camera of the rendered scene. + * @param domElement The HTML element used for event listeners. (optional) + */ + constructor(camera: Camera, domElement?: HTMLElement); + + /** + * Returns the visual representation of the controls. Add the helper to your scene to visually transform the + * attached 3D object. + */ + getHelper(): TransformControlsRoot; + + pointerHover(pointer: PointerEvent | null): void; + pointerDown(pointer: PointerEvent | null): void; + pointerMove(pointer: PointerEvent | null): void; + pointerUp(pointer: PointerEvent | null): void; + + /** + * Sets the 3D object that should be transformed and ensures the controls UI is visible. + * @param object The 3D object that should be transformed. + */ + attach(object: Object3D): this; + + /** + * Removes the current 3D object from the controls and makes the helper UI invisible. + */ + detach(): this; + + /** + * Resets the object's position, rotation and scale to when the current transform began. + */ + reset(): void; + + /** + * Returns the {@link Raycaster} object that is used for user interaction. This object is shared between all + * instances of TransformControls. If you set the [.layers]{@link Object3D.layers} property of the + * TransformControls, you will also want to set the [.layers]{@link Raycaster.layers} property on the + * {@link Raycaster} with a matching value, or else the TransformControls won't work as expected. + */ + getRaycaster(): Raycaster; + + /** + * Returns the transformation mode. + */ + getMode(): TransformControlsMode; + + /** + * Sets the transformation mode. + * @param mode The transformation mode. + */ + setMode(mode: TransformControlsMode): void; + + /** + * Sets the translation snap. + * @param translationSnap The translation snap. + */ + setTranslationSnap(translationSnap: number | null): void; + + /** + * Sets the rotation snap. + * @param rotationSnap The rotation snap. + */ + setRotationSnap(rotationSnap: number | null): void; + + /** + * Sets the scale snap. + * @param scaleSnap The scale snap. + */ + setScaleSnap(scaleSnap: number | null): void; + + /** + * Sets the size of the helper UI. + * @param size The size of the helper UI. + */ + setSize(size: number): void; + + /** + * Sets the coordinate space in which transformations are applied. + * @param space The coordinate space in which transformations are applied. + */ + setSpace(space: "world" | "local"): void; + + /** + * Sets the colors of the control's gizmo. + * + * @param {number|Color|string} xAxis - The x-axis color. + * @param {number|Color|string} yAxis - The y-axis color. + * @param {number|Color|string} zAxis - The z-axis color. + * @param {number|Color|string} active - The color for active elements. + */ + setColors( + xAxis: ColorRepresentation, + yAxis: ColorRepresentation, + zAxis: ColorRepresentation, + active: ColorRepresentation, + ): void; +} + +declare class TransformControlsRoot extends Object3D { + readonly isTransformControlsRoot: true; + + controls: TransformControls; + + constructor(controls: TransformControls); + + dispose(): void; +} + +declare class TransformControlsGizmo extends Object3D { + isTransformControlsGizmo: true; + + gizmo: { + translate: Object3D; + rotate: Object3D; + scale: Object3D; + }; + helper: { + translate: Object3D; + rotate: Object3D; + scale: Object3D; + }; + picker: { + translate: Object3D; + rotate: Object3D; + scale: Object3D; + }; + + constructor(); +} + +declare class TransformControlsPlane extends Mesh { + readonly isTransformControlsPlane: true; + + constructor(); + + mode: TransformControlsMode; + + axis: "X" | "Y" | "Z" | "XY" | "YZ" | "XZ" | "XYZ" | "E"; + + space: "local" | "world"; + + eye: Vector3; + worldPosition: Vector3; + worldQuaternion: Quaternion; +} + +export { TransformControls, TransformControlsGizmo, TransformControlsPlane }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/csm/CSM.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/csm/CSM.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..89a3b0e6659f0237b600b63b9068136fa03a1244 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/csm/CSM.d.ts @@ -0,0 +1,55 @@ +import { Camera, DirectionalLight, Material, Object3D, Vector2, Vector3 } from "three"; +import { CSMFrustum } from "./CSMFrustum.js"; + +export type CSMMode = "uniform" | "logarithmic" | "practical" | "custom"; + +export interface CSMParameters { + camera?: Camera; + parent?: Object3D; + cascades?: number; + maxFar?: number; + mode?: CSMMode; + shadowMapSize?: number; + shadowBias?: number; + lightDirection?: Vector3; + lightIntensity?: number; + lightNear?: number; + lightFar?: number; + lightMargin?: number; + customSplitsCallback?: (cascades: number, cameraNear: number, cameraFar: number, breaks: number[]) => void; +} + +export class CSM { + constructor(data: CSMParameters); + camera: Camera; + parent: Object3D; + cascades: number; + maxFar: number; + mode: CSMMode; + shadowMapSize: number; + shadowBias: number; + lightDirection: Vector3; + lightIntensity: number; + lightNear: number; + lightFar: number; + lightMargin: number; + customSplitsCallback: (cascades: number, cameraNear: number, cameraFar: number, breaks: number[]) => void; + fade: boolean; + mainFrustum: CSMFrustum; + frustums: CSMFrustum[]; + breaks: number[]; + lights: DirectionalLight[]; + shaders: Map; + createLights(): void; + initCascades(): void; + updateShadowBounds(): void; + getBreaks(): void; + update(): void; + injectInclude(): void; + setupMaterial(material: Material): void; + updateUniforms(): void; + getExtendedBreaks(target: Vector2[]): void; + updateFrustums(): void; + remove(): void; + dispose(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/csm/CSMFrustum.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/csm/CSMFrustum.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..339f699f00dfe407de877d149bc4e284fb0b45f0 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/csm/CSMFrustum.d.ts @@ -0,0 +1,25 @@ +import { Matrix4, Vector3 } from "three"; + +export interface CSMFrustumVerticies { + near: Vector3[]; + far: Vector3[]; +} + +export interface CSMFrustumParameters { + webGL?: boolean; + projectionMatrix?: Matrix4; + maxFar?: number; +} + +declare class CSMFrustum { + zNear: number; + vertices: CSMFrustumVerticies; + + constructor(data?: CSMFrustumParameters); + + setFromProjectionMatrix(projectionMatrix: Matrix4, maxFar: number): CSMFrustumVerticies; + split(breaks: number[], target: CSMFrustum[]): void; + toSpace(cameraMatrix: Matrix4, target: CSMFrustum): void; +} + +export { CSMFrustum }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/csm/CSMHelper.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/csm/CSMHelper.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a10ebca744f0e4e0f9d04025fbc23ed944adb6aa --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/csm/CSMHelper.d.ts @@ -0,0 +1,28 @@ +import { + Box3Helper, + BufferGeometry, + Group, + LineBasicMaterial, + LineSegments, + Mesh, + MeshBasicMaterial, + PlaneGeometry, +} from "three"; + +import { CSM } from "./CSM.js"; +import { CSMShadowNode } from "./CSMShadowNode.js"; + +export class CSMHelper extends Group { + constructor(csm: TCSM); + csm: TCSM; + displayFrustum: boolean; + displayPlanes: boolean; + displayShadowBounds: boolean; + frustumLines: LineSegments; + cascadeLines: Box3Helper[]; + cascadePlanes: Array>; + shadowLines: Box3Helper[]; + updateVisibility(): void; + update(): void; + dispose(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/csm/CSMShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/csm/CSMShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2241c56b973f36cc294d5abf977c2dc75c5b9b1d --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/csm/CSMShader.d.ts @@ -0,0 +1,4 @@ +export interface CSMShader { + lights_fragment_begin: string; + lights_pars_begin: string; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/csm/CSMShadowNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/csm/CSMShadowNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1f795e0e44bb70db602f15db21fd6c6d2f5cd265 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/csm/CSMShadowNode.d.ts @@ -0,0 +1,44 @@ +import { Camera, DirectionalLightShadow, Light, Object3D, ShadowBaseNode } from "three/webgpu"; +import { CSMFrustum } from "./CSMFrustum.js"; + +export type CSMShadowNodeMode = "uniform" | "logarithmic" | "practical" | "custom"; + +export interface CSMShadowNodeData { + cascades?: number | undefined; + maxFar?: number | undefined; + mode?: CSMShadowNodeMode | undefined; + lightMargin?: number | undefined; + customSplitsCallback?: + | ((cascades: number, cameraNear: number, cameraFar: number, breaks: number[]) => void) + | undefined; +} + +declare class LwLight extends Object3D { + target: Object3D; + shadow?: DirectionalLightShadow; + + constructor(); +} + +declare class CSMShadowNode extends ShadowBaseNode { + camera: Camera | null; + cascades: number; + maxFar: number; + mode: CSMShadowNodeMode; + lightMargin: number; + customSplitsCallback: (cascades: number, cameraNear: number, cameraFar: number, breaks: number[]) => void; + + fade: boolean; + + breaks: number[]; + mainFrustum: CSMFrustum | null; + frustums: CSMFrustum[]; + + lights: LwLight[]; + + constructor(light: Light, data?: CSMShadowNodeData); + + updateFrustums(): void; +} + +export { CSMShadowNode }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/curves/CurveExtras.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/curves/CurveExtras.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5277e72a37d83c2465fd302b1f3cb4e712c076a2 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/curves/CurveExtras.d.ts @@ -0,0 +1,68 @@ +import { Curve, Vector3 } from "three"; + +export class GrannyKnot extends Curve { + constructor(); +} + +export class HeartCurve extends Curve { + constructor(scale?: number); + scale: number; +} + +export class VivianiCurve extends Curve { + constructor(scale?: number); + scale: number; +} + +export class KnotCurve extends Curve { + constructor(); +} + +export class HelixCurve extends Curve { + constructor(); +} + +export class TrefoilKnot extends Curve { + constructor(scale?: number); + scale: number; +} + +export class TorusKnot extends Curve { + constructor(scale?: number); + scale: number; +} + +export class CinquefoilKnot extends Curve { + constructor(scale?: number); + scale: number; +} + +export class TrefoilPolynomialKnot extends Curve { + constructor(scale?: number); + scale: number; +} + +export class FigureEightPolynomialKnot extends Curve { + constructor(scale?: number); + scale: number; +} + +export class DecoratedTorusKnot4a extends Curve { + constructor(scale?: number); + scale: number; +} + +export class DecoratedTorusKnot4b extends Curve { + constructor(scale?: number); + scale: number; +} + +export class DecoratedTorusKnot5a extends Curve { + constructor(scale?: number); + scale: number; +} + +export class DecoratedTorusKnot5c extends Curve { + constructor(scale?: number); + scale: number; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/curves/NURBSCurve.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/curves/NURBSCurve.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9f26b9abffb67e19ed603f24a1ea7501c3179a93 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/curves/NURBSCurve.d.ts @@ -0,0 +1,28 @@ +import { Curve, CurveJSON, Vector2, Vector3, Vector4 } from "three"; + +export interface NURBSCurveJSON extends CurveJSON { + degree: number; + knots: number[]; + controlPoints: number[][]; + startKnot: number; + endKnot: number; +} + +export class NURBSCurve extends Curve { + degree: number; + knots: number[]; + controlPoints: Vector2[] | Vector3[] | Vector4[]; + startKnot: number; + endKnot: number; + + constructor( + degree: number, + knots: number[], + controlPoints: Vector2[] | Vector3[] | Vector4[], + startKnot?: number, + endKnot?: number, + ); + + toJSON(): NURBSCurveJSON; + fromJSON(json: NURBSCurveJSON): this; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/curves/NURBSSurface.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/curves/NURBSSurface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3487e315f0cbcbd9c5cf4aaa8c23d2a0b80c78ff --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/curves/NURBSSurface.d.ts @@ -0,0 +1,13 @@ +import { Vector2, Vector3, Vector4 } from "three"; + +export class NURBSSurface { + constructor( + degree1: number, + degree2: number, + knots1: number[], + knots2: number[], + controlPoints: Vector2[][] | Vector3[][] | Vector4[][], + ); + + getPoint(t1: number, t2: number, target: Vector3): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/curves/NURBSUtils.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/curves/NURBSUtils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..117e6c36d14063d22f18671a4850d4b0a794e7d4 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/curves/NURBSUtils.d.ts @@ -0,0 +1,146 @@ +import { Vector3, Vector4 } from "three"; + +/** + * Finds knot vector span. + * @param p degree + * @param u parametric value + * @param U knot vector + * @returns the span + */ +export function findSpan(p: number, u: number, U: readonly number[]): number; + +/** + * Calculate basis functions. See The NURBS Book, page 70, algorithm A2.2 + * @param span span in which u lies + * @param u parametric point + * @param p degrees + * @param U knot vector + * @returns array[p+1] with basis function values + */ +export function calcBasisFunctions(span: number, u: number, p: number, U: readonly number[]): number[]; + +/** + * Calculate B-Spline curve points. See The NURBS Book, page 82, algorithm A3.1. + * @param p degree of B-Spline + * @param U knot vector + * @param P control points (x, y, z, w) + * @param u parametric point + * @returns point for given u + */ +export function calcBSplinePoint(p: number, U: readonly number[], P: readonly Vector4[], u: number): Vector4; + +/** + * Calculate basis functions derivatives. See The NURBS Book, page 72, algorithm A2.3. + * @param span span in which u lies + * @param u parametric point + * @param p degree + * @param n number of derivatives to calculate + * @param U knot vector + * @returns array[n+1][p+1] with basis functions derivatives + */ +export function calcBasisFunctionDerivatives( + span: number, + u: number, + p: number, + n: number, + U: readonly number[], +): number[][]; + +/** + * Calculate derivatives of a B-Spline. See The NURBS Book, page 93, algorithm A3.2. + * @param p degree + * @param U knot vector + * @param P control points + * @param u Parametric points + * @param nd number of derivatives + * @returns array[d+1] with derivatives + */ +export function calcBSplineDerivatives( + p: number, + U: readonly number[], + P: readonly Vector4[], + u: number, + nd: number, +): Vector4[]; + +/** + * Calculate "K over I" + * @returns k!/(i!(k-i)! + */ +export function calcKoverI(k: number, i: number): number; + +/** + * Calculate derivatives (0-nd) of rational curve. See The NURBS Book, page 127, algorithm A4.2. + * @param Pders result of function calcBSplineDerivatives + * @returns array with derivatives for rational curve. + */ +export function calcRationalCurveDerivatives(Pders: readonly Vector4[]): Vector3[]; + +/** + * Calculate NURBS curve derivatives. See The NURBS Book, page 127, algorithm A4.2. + * @param p degree + * @param U knot vector + * @param P control points in homogeneous space + * @param u parametric points + * @param nd number of derivatives + * @returns array with derivatives + */ +export function calcNURBSDerivatives( + p: number, + U: readonly number[], + P: readonly Vector4[], + u: number, + nd: number, +): Vector3[]; + +/** + * Calculate rational B-Spline surface point. See The NURBS Book, page 134, algorithm A4.3. + * @param p degree of B-Spline surface + * @param q degree of B-Spline surface + * @param U knot vector + * @param V knot vector + * @param P control points (x, y, z, w) + * @param u parametric value + * @param v parametric value + * @param target + * @returns point for given (u, v) + */ +export function calcSurfacePoint( + p: number, + q: number, + U: readonly number[], + V: readonly number[], + P: readonly (readonly Vector4[])[], + u: number, + v: number, + target: Vector3, +): Vector3; + +/** + * Calculate rational B-Spline volume point. See The NURBS Book, page 134, algorithm A4.3. + * @param p degree of B-Spline volume + * @param q degree of B-Spline volume + * @param r degree of B-Spline volume + * @param U knot vector + * @param V knot vector + * @param W knot vector + * @param P control points (x, y, z, w) + * @param u parametric value + * @param v parametric value + * @param w parametric value + * @param target + * @returns point for given (u, v, w) + */ +export function calcVolumePoint( + p: number, + q: number, + r: number, + U: readonly number[], + V: readonly number[], + W: readonly number[], + P: readonly (readonly (readonly Vector4[])[])[], + u: number, + v: number, + w: number, + target: Vector3, +): Vector3; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/curves/NURBSVolume.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/curves/NURBSVolume.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3a50977bd97e7d75926012fc4a16332e6615908e --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/curves/NURBSVolume.d.ts @@ -0,0 +1,23 @@ +import { Vector3, Vector4 } from "three"; + +export class NURBSVolume { + degree1: number; + degree2: number; + degree3: number; + knots1: readonly number[]; + knots2: readonly number[]; + knots3: readonly number[]; + controlPoints: Vector4[][][]; + + constructor( + degree1: number, + degree2: number, + degree3: number, + knots1: readonly number[], + knots2: readonly number[], + knots3: readonly number[], + controlPoints: Vector4[][][], + ); + + getPoint(t1: number, t2: number, t3: number, target: Vector3): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/effects/AnaglyphEffect.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/effects/AnaglyphEffect.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2313c4f426432d4a9793da0df904dc527ba15ed5 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/effects/AnaglyphEffect.d.ts @@ -0,0 +1,17 @@ +import { Camera, Matrix3, Scene, WebGLRenderer } from "three"; + +declare class AnaglyphEffect { + colorMatrixLeft: Matrix3; + + colorMatrixRight: Matrix3; + + setSize: (width: number, height: number) => void; + + render: (scene: Scene, camera: Camera) => void; + + dispose: () => void; + + constructor(renderer: WebGLRenderer, width?: number, height?: number); +} + +export { AnaglyphEffect }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/effects/AsciiEffect.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/effects/AsciiEffect.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..18fa3b4639e48b747be353181d86b65479b3d72e --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/effects/AsciiEffect.d.ts @@ -0,0 +1,18 @@ +import { Camera, Scene, WebGLRenderer } from "three"; + +export interface AsciiEffectOptions { + resolution?: number; + scale?: number; + color?: boolean; + alpha?: boolean; + block?: boolean; + invert?: boolean; +} + +export class AsciiEffect { + constructor(renderer: WebGLRenderer, charSet?: string, options?: AsciiEffectOptions); + domElement: HTMLElement; + + render(scene: Scene, camera: Camera): void; + setSize(width: number, height: number): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/effects/OutlineEffect.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/effects/OutlineEffect.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8b400915769c3533aaad0c2431b766dbb88cae63 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/effects/OutlineEffect.d.ts @@ -0,0 +1,28 @@ +import { Camera, Scene, Vector2, Vector4, WebGLRenderer, WebGLRenderTarget, WebGLShadowMap } from "three"; + +export interface OutlineEffectParameters { + defaultThickness?: number | undefined; + defaultColor?: number[] | undefined; + defaultAlpha?: number | undefined; + defaultKeepAlive?: boolean | undefined; +} + +export class OutlineEffect { + constructor(renderer: WebGLRenderer, parameters?: OutlineEffectParameters); + enabled: boolean; + autoClear: boolean; + domElement: HTMLElement; + shadowMap: WebGLShadowMap; + + clear(color?: boolean, depth?: boolean, stencil?: boolean): void; + getPixelRatio(): number; + getSize(target: Vector2): Vector2; + render(scene: Scene, camera: Camera): void; + renderOutline(scene: Scene, camera: Camera): void; + setRenderTarget(renderTarget: WebGLRenderTarget | null): void; + setPixelRatio(value: number): void; + setScissor(x: Vector4 | number, y?: number, width?: number, height?: number): void; + setScissorTest(enable: boolean): void; + setSize(width: number, height: number, updateStyle?: boolean): void; + setViewport(x: Vector4 | number, y?: number, width?: number, height?: number): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/effects/ParallaxBarrierEffect.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/effects/ParallaxBarrierEffect.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b414ab6d4296df4a6f5759abe6919f4f2f974ea8 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/effects/ParallaxBarrierEffect.d.ts @@ -0,0 +1,11 @@ +import { Camera, Scene, WebGLRenderer } from "three"; + +declare class ParallaxBarrierEffect { + setSize: (width: number, height: number) => void; + render: (scene: Scene, camera: Camera) => void; + dispose: () => void; + + constructor(renderer: WebGLRenderer); +} + +export { ParallaxBarrierEffect }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/effects/StereoEffect.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/effects/StereoEffect.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3982d1edd5abf4d1be199573ba006ed0854e50f0 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/effects/StereoEffect.d.ts @@ -0,0 +1,9 @@ +import { Camera, Scene, WebGLRenderer } from "three"; + +export class StereoEffect { + constructor(renderer: WebGLRenderer); + + setEyeSeparation(eyeSep: number): void; + render(scene: Scene, camera: Camera): void; + setSize(width: number, height: number): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/environments/DebugEnvironment.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/environments/DebugEnvironment.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e10b6e4200ace04240b1a8fc28836ef516c29d9c --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/environments/DebugEnvironment.d.ts @@ -0,0 +1,5 @@ +import { Scene } from "three"; + +export class DebugEnvironment extends Scene { + constructor(); +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/environments/RoomEnvironment.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/environments/RoomEnvironment.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..82f9d2b9cf308c112b7e104f899e5e68586c0b77 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/environments/RoomEnvironment.d.ts @@ -0,0 +1,6 @@ +import { Scene } from "three"; + +export class RoomEnvironment extends Scene { + constructor(); + dispose(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/exporters/DRACOExporter.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/exporters/DRACOExporter.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fa73d0fbf817f493ac2632a59fa63c6accd9accb --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/exporters/DRACOExporter.d.ts @@ -0,0 +1,17 @@ +import { Mesh, Points } from "three"; + +export interface DRACOExporterOptions { + decodeSpeed?: number; + encodeSpeed?: number; + encoderMethod?: number; + quantization?: number[]; + exportUvs?: boolean; + exportNormals?: boolean; + exportColor?: boolean; +} + +export class DRACOExporter { + constructor(); + + parse(object: Mesh | Points, options?: DRACOExporterOptions): Int8Array; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/exporters/EXRExporter.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/exporters/EXRExporter.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..000f33f0adb303b701a789b53cc0971dd49110f3 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/exporters/EXRExporter.d.ts @@ -0,0 +1,27 @@ +/** + * @author sciecode / https://github.com/sciecode + * + * EXR format references: + * https://www.openexr.com/documentation/openexrfilelayout.pdf + */ + +import { DataTexture, TextureDataType, WebGLRenderer, WebGLRenderTarget } from "three"; +import { WebGPURenderer } from "three/webgpu"; + +export const NO_COMPRESSION: 0; +export const ZIPS_COMPRESSION: 2; +export const ZIP_COMPRESSION: 3; + +export interface EXRExporterParseOptions { + compression?: number; + type?: TextureDataType; +} + +export class EXRExporter { + parse( + renderer: WebGLRenderer | WebGPURenderer, + renderTarget: WebGLRenderTarget, + options?: EXRExporterParseOptions, + ): Promise>; + parse(dataTexture: DataTexture, options?: EXRExporterParseOptions): Promise>; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/exporters/GLTFExporter.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/exporters/GLTFExporter.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5154bb1a92f77579a9b1f572799d4991fa420ba0 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/exporters/GLTFExporter.d.ts @@ -0,0 +1,156 @@ +import { AnimationClip, Material, Mesh, Object3D, Texture } from "three"; + +export interface GLTFExporterOptions { + /** + * Export position, rotation and scale instead of matrix per node. Default is false + */ + trs?: boolean; + + /** + * Export only visible objects. Default is true. + */ + onlyVisible?: boolean; + + /** + * Export just the attributes within the drawRange, if defined, instead of exporting the whole array. Default is true. + */ + truncateDrawRange?: boolean; + + /** + * Export in binary (.glb) format, returning an ArrayBuffer. Default is false. + */ + binary?: boolean; + + /** + * Export with images embedded into the glTF asset. Default is true. + */ + embedImages?: boolean; + + /** + * Restricts the image maximum size (both width and height) to the given value. This option works only if embedImages is true. Default is Infinity. + */ + maxTextureSize?: number; + + /** + * List of animations to be included in the export. + */ + animations?: AnimationClip[]; + + /** + * Generate indices for non-index geometry and export with them. Default is false. + */ + forceIndices?: boolean; + + /** + * Export custom glTF extensions defined on an object's userData.gltfExtensions property. Default is false. + */ + includeCustomExtensions?: boolean; +} + +type TextureUtils = { + decompress: + | ((texture: Texture, maxTextureSize?: number) => Promise) + | ((texture: Texture, maxTextureSize?: number) => void); +}; + +declare class GLTFExporter { + textureUtils: TextureUtils | null; + + constructor(); + + register(callback: (writer: GLTFWriter) => GLTFExporterPlugin): this; + unregister(callback: (writer: GLTFWriter) => GLTFExporterPlugin): this; + + setTextureUtils(utils: TextureUtils | null): this; + + /** + * Generates a .gltf (JSON) or .glb (binary) output from the input (Scenes or Objects) + * + * @param input Scenes or objects to export. Valid options: + * - Export scenes + * ```js + * exporter.parse( scene1, ... ) + * exporter.parse( [ scene1, scene2 ], ... ) + * ``` + * - Export objects (It will create a new Scene to hold all the objects) + * ```js + * exporter.parse( object1, ... ) + * exporter.parse( [ object1, object2 ], ... ) + * ``` + * - Mix scenes and objects (It will export the scenes as usual but it will create a new scene to hold all the single objects). + * ```js + * exporter.parse( [ scene1, object1, object2, scene2 ], ... ) + * ``` + * @param onDone Will be called when the export completes. The argument will be the generated glTF JSON or binary ArrayBuffer. + * @param onError Will be called if there are any errors during the gltf generation. + * @param options Export options + */ + parse( + input: Object3D | Object3D[], + onDone: (gltf: ArrayBuffer | { [key: string]: unknown }) => void, + onError: (error: ErrorEvent) => void, + options?: GLTFExporterOptions, + ): void; + + /** + * Generates a .gltf (JSON) or .glb (binary) output from the input (Scenes or Objects). + * + * This is just like the {@link parse}() method, but instead of accepting callbacks it returns a promise that + * resolves with the result, and otherwise accepts the same options. + */ + parseAsync( + input: Object3D | Object3D[], + options?: GLTFExporterOptions, + ): Promise; +} + +declare class GLTFWriter { + textureUtils: TextureUtils | null; + + extensionsUsed: { [name: string]: boolean }; + extensionsRequired: { [name: string]: boolean }; + + constructor(); + + setPlugins(plugins: GLTFExporterPlugin[]): void; + + setTextureUtils(utils: TextureUtils | null): this; + + /** + * Process texture + * @param map Map to process + * @return Index of the processed texture in the "textures" array + */ + processTextureAsync(map: Texture): Promise; + + /** + * Applies a texture transform, if present, to the map definition. Requires + * the KHR_texture_transform extension. + */ + applyTextureTransform(mapDef: { [key: string]: unknown }, texture: Texture): void; + + /** + * Parse scenes and generate GLTF output + * + * @param input Scene or Array of THREE.Scenes + * @param onDone Callback on completed + * @param options options + */ + writeAsync( + input: Object3D | Object3D[], + onDone: (gltf: ArrayBuffer | { [key: string]: unknown }) => void, + options?: GLTFExporterOptions, + ): Promise; +} + +export interface GLTFExporterPlugin { + writeTexture?: (map: Texture, textureDef: { [key: string]: unknown }) => void; + writeMaterialAsync?: (material: Material, materialDef: { [key: string]: unknown }) => Promise; + writeMesh?: (mesh: Mesh, meshDef: { [key: string]: unknown }) => void; + writeNode?: (object: Object3D, nodeDef: { [key: string]: unknown }) => void; + beforeParse?: (input: Object3D | Object3D[]) => void; + afterParse?: (input: Object3D | Object3D[]) => void; +} + +export { GLTFExporter }; +export type { GLTFWriter }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/exporters/KTX2Exporter.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/exporters/KTX2Exporter.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..27b5fb09cf4c299e8d709538b6ad9360acade9c4 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/exporters/KTX2Exporter.d.ts @@ -0,0 +1,7 @@ +import { Data3DTexture, DataTexture, WebGLRenderer, WebGLRenderTarget } from "three"; +import { WebGPURenderer } from "three/webgpu"; + +export class KTX2Exporter { + parse(renderer: WebGLRenderer | WebGPURenderer, rtt?: WebGLRenderTarget): Promise>; + parse(texture: Data3DTexture | DataTexture): Promise>; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/exporters/OBJExporter.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/exporters/OBJExporter.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ce5e89eebd9889f5792925d52c5086656edea432 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/exporters/OBJExporter.d.ts @@ -0,0 +1,7 @@ +import { Object3D } from "three"; + +export class OBJExporter { + constructor(); + + parse(object: Object3D): string; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/exporters/PLYExporter.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/exporters/PLYExporter.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f13197687d3c612d9867ec7f74c2a73a38cd7e3d --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/exporters/PLYExporter.d.ts @@ -0,0 +1,30 @@ +import { Object3D } from "three"; + +export interface PLYExporterOptionsBase { + excludeAttributes?: string[]; + littleEndian?: boolean; +} + +export interface PLYExporterOptionsBinary extends PLYExporterOptionsBase { + binary: true; +} + +export interface PLYExporterOptionsString extends PLYExporterOptionsBase { + binary?: false; +} + +export interface PLYExporterOptions extends PLYExporterOptionsBase { + binary?: boolean; +} + +export class PLYExporter { + constructor(); + + parse(object: Object3D, onDone: (res: ArrayBuffer) => void, options: PLYExporterOptionsBinary): ArrayBuffer | null; + parse(object: Object3D, onDone: (res: string) => void, options?: PLYExporterOptionsString): string | null; + parse( + object: Object3D, + onDone: (res: string | ArrayBuffer) => void, + options?: PLYExporterOptions, + ): string | ArrayBuffer | null; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/exporters/STLExporter.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/exporters/STLExporter.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..98934536111532edaaeb269a6e103107e14a379d --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/exporters/STLExporter.d.ts @@ -0,0 +1,21 @@ +import { Object3D } from "three"; + +export interface STLExporterOptionsBinary { + binary: true; +} + +export interface STLExporterOptionsString { + binary?: false; +} + +export interface STLExporterOptions { + binary?: boolean; +} + +export class STLExporter { + constructor(); + + parse(scene: Object3D, options: STLExporterOptionsBinary): DataView; + parse(scene: Object3D, options?: STLExporterOptionsString): string; + parse(scene: Object3D, options?: STLExporterOptions): string | DataView; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/exporters/USDZExporter.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/exporters/USDZExporter.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9e153df4daf651131afbc9a768d00ba9cd92591d --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/exporters/USDZExporter.d.ts @@ -0,0 +1,26 @@ +import { Object3D } from "three"; +import * as WebGLTextureUtils from "../utils/WebGLTextureUtils.js"; +import * as WebGPUTextureUtils from "../utils/WebGPUTextureUtils.js"; + +export interface USDZExporterOptions { + ar?: { anchoring: { type: "plane" }; planeAnchoring: { alignment: "horizontal" | "vertical" | "any" } } | undefined; + includeAnchoringProperties?: boolean | undefined; + onlyVisible?: boolean | undefined; + quickLookCompatible?: boolean | undefined; + maxTextureSize?: number | undefined; +} + +export class USDZExporter { + textureUtils: typeof WebGLTextureUtils | typeof WebGPUTextureUtils | null; + + constructor(); + + parse( + scene: Object3D, + onDone: (result: Uint8Array) => void, + onError: (error: unknown) => void, + options?: USDZExporterOptions, + ): void; + + parseAsync(scene: Object3D, options?: USDZExporterOptions): Promise>; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/geometries/BoxLineGeometry.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/geometries/BoxLineGeometry.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d092553a1acd373828ed663e92773b80a1430bfa --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/geometries/BoxLineGeometry.d.ts @@ -0,0 +1,12 @@ +import { BufferGeometry } from "three"; + +export class BoxLineGeometry extends BufferGeometry { + constructor( + width?: number, + height?: number, + depth?: number, + widthSegments?: number, + heightSegments?: number, + depthSegments?: number, + ); +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/geometries/ConvexGeometry.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/geometries/ConvexGeometry.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..40d9847e0fc37b8dad6fb698e00f30e82a9b4af8 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/geometries/ConvexGeometry.d.ts @@ -0,0 +1,5 @@ +import { BufferGeometry, Vector3 } from "three"; + +export class ConvexGeometry extends BufferGeometry { + constructor(points?: Vector3[]); +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/geometries/DecalGeometry.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/geometries/DecalGeometry.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4742d0285183aaa95f00f483f5ee7f96fd9a7ee6 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/geometries/DecalGeometry.d.ts @@ -0,0 +1,16 @@ +import { BufferGeometry, Euler, Mesh, Vector3 } from "three"; + +declare class DecalGeometry extends BufferGeometry { + constructor(mesh?: Mesh, position?: Vector3, orientation?: Euler, size?: Vector3); +} + +declare class DecalVertex { + position: Vector3; + normal: Vector3 | null; + + constructor(position: Vector3, normal?: Vector3 | null); + + clone(): this; +} + +export { DecalGeometry, DecalVertex }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/geometries/ParametricFunctions.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/geometries/ParametricFunctions.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ca6d3e5ac4146dc9c7a9c3957e64c80dfb39b413 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/geometries/ParametricFunctions.d.ts @@ -0,0 +1,8 @@ +import { Vector3 } from "three"; + +declare function klein(v: number, u: number, target: Vector3): void; +declare function plane(u: number, v: number, target: Vector3): void; +declare function mobius(u: number, t: number, target: Vector3): void; +declare function mobius3d(u: number, t: number, target: Vector3): void; + +export { klein, mobius, mobius3d, plane }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/geometries/ParametricGeometry.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/geometries/ParametricGeometry.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cc1368beff03391616e74ccba22bd9c52bd09702 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/geometries/ParametricGeometry.d.ts @@ -0,0 +1,18 @@ +import { BufferGeometry, Vector3 } from "three"; + +export class ParametricGeometry extends BufferGeometry { + constructor(func?: (u: number, v: number, target: Vector3) => void, slices?: number, stacks?: number); + + /** + * @default 'ParametricGeometry' + */ + type: string; + + parameters: { + func: (u: number, v: number, dest: Vector3) => void; + slices: number; + stacks: number; + }; +} + +export { ParametricGeometry as ParametricBufferGeometry }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/geometries/RoundedBoxGeometry.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/geometries/RoundedBoxGeometry.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..360c6f0c16b635e8e8ae2fe099c465a614fc069f --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/geometries/RoundedBoxGeometry.d.ts @@ -0,0 +1,5 @@ +import { BoxGeometry } from "three"; + +export class RoundedBoxGeometry extends BoxGeometry { + constructor(width?: number, height?: number, depth?: number, segments?: number, radius?: number); +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/geometries/TeapotGeometry.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/geometries/TeapotGeometry.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ae8844c75acef416d208365a1e0d4e51c710b199 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/geometries/TeapotGeometry.d.ts @@ -0,0 +1,37 @@ +import { BufferGeometry } from "three"; + +/** + * TeapotGeometry tessellates the famous Utah teapot database by Martin Newell. + * + * TeapotGeometry is an add-on, and must be imported explicitly. See + * [Installation / Addons]{@link https://threejs.org/docs/#manual/en/introduction/Installation}. + * + * @example + * import { TeapotGeometry } from 'three/addons/geometries/TeapotGeometry.js'; + * + * const geometry = new TeapotGeometry( 50, 18 ); + * const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } ); + * const teapot = new THREE.Mesh( geometry, material ); + * scene.add( teapot ); + */ +export class TeapotGeometry extends BufferGeometry { + /** + * @param size Relative scale of the teapot. Optional; Defaults to `50`. + * @param segments Number of line segments to subdivide each patch edge. Optional; Defaults to `10`. + * @param bottom Whether the bottom of the teapot is generated or not. Optional; Defaults to `true`. + * @param lid Whether the lid is generated or not. Optional; Defaults to `true`. + * @param body Whether the body is generated or not. Optional; Defaults to `true`. + * @param fitLid Whether the lid is slightly stretched to prevent gaps between the body and lid or not. Optional; + * Defaults to `true`. + * @param blinn Whether the teapot is scaled vertically for better aesthetics or not. Optional; Defaults to `true`. + */ + constructor( + size?: number, + segments?: number, + bottom?: boolean, + lid?: boolean, + body?: boolean, + fitLid?: boolean, + blinn?: boolean, + ); +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/geometries/TextGeometry.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/geometries/TextGeometry.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2b39ff50d408817ffa2aeb1793874440c755ad5d --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/geometries/TextGeometry.d.ts @@ -0,0 +1,115 @@ +import { ExtrudeGeometry, ExtrudeGeometryOptions, Shape } from "three"; + +import { Font } from "../loaders/FontLoader.js"; + +export interface TextGeometryParameters extends ExtrudeGeometryOptions { + font: Font; + + /** + * Size of the text + * Expects a `Float`. + * @defaultValue `100` + */ + size?: number | undefined; + + /** + * Thickness to extrude text. + * Expects a `Float`. + * @defaultValue `50` + */ + depth?: number | undefined; + + /** + * @override + * @defaultValue `12` + */ + curveSegments?: number | undefined; + + /** + * @defaultValue `false` + */ + bevelEnabled?: boolean | undefined; + + /** + * How deep into text bevel goes. + * Expects a `Float`. + * @override + * @defaultValue `10` + */ + bevelThickness?: number | undefined; + + /** + * How far from text outline is bevel. + * Expects a `Float`. + * @override + * @defaultValue `8` + */ + bevelSize?: number | undefined; + + /** + * How far from text outline bevel starts. + * Expects a `Float`. + * @override + * @defaultValue `0` + */ + bevelOffset?: number | undefined; + + /** + * @override + * @defaultValue `3` + */ + bevelSegments?: number | undefined; +} + +/** + * A class for generating text as a single geometry + * @remarks + * It is constructed by providing a string of text, and a set of parameters consisting of a loaded font and settings for the geometry's parent {@link THREE.ExtrudeGeometry | ExtrudeGeometry} + * See the {@link THREE.FontLoader | FontLoader} page for additional details. + * @example + * ```typescript + * const loader = new FontLoader(); + * loader.load('fonts/helvetiker_regular.typeface.json', function (font) { + * const geometry = new TextGeometry('Hello three.js!', { + * font: font, + * size: 80, + * height: 5, + * curveSegments: 12, + * bevelEnabled: true, + * bevelThickness: 10, + * bevelSize: 8, + * bevelOffset: 0, + * bevelSegments: 5 + * }); + * }); + * ``` + * @see Example: {@link https://threejs.org/examples/#webgl_geometry_text | geometry / text } + * @see {@link https://threejs.org/docs/index.html#api/en/C:/rafaelsc/Source/threejs/three.js/docs/examples/en/geometries/TextGeometry | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/examples/jsm/geometries/TextGeometry.js | Source} + */ +export class TextGeometry extends ExtrudeGeometry { + /** + * Create a new instance of {@link TextGeometry} + * @param text The text that needs to be shown. + * @param parameters Object that can contain the following parameters. @see {@link TextGeometryParameters} for defaults. + */ + constructor(text: string, parameters?: TextGeometryParameters); + + /** + * A Read-only _string_ to check if `this` object type. + * @remarks Sub-classes will update this value. + * @defaultValue `TextGeometry` + */ + override readonly type: string | "TextGeometry"; + + /** + * An object with a property for each of the constructor parameters. + * @remarks Any modification after instantiation does not change the geometry. + */ + readonly parameters: { + readonly shapes: Shape | Shape[]; + readonly options: TextGeometryParameters; + }; +} + +export { TextGeometry as TextBufferGeometry }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/LightProbeHelper.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/LightProbeHelper.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b8b146dadeee5c92a0ce13575fd1551fd971904f --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/LightProbeHelper.d.ts @@ -0,0 +1,12 @@ +import { LightProbe, Mesh } from "three"; + +declare class LightProbeHelper extends Mesh { + lightProbe: LightProbe; + size: number; + + constructor(lightProbe: LightProbe, size?: number); + + dispose(): void; +} + +export { LightProbeHelper }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/LightProbeHelperGPU.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/LightProbeHelperGPU.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b8b146dadeee5c92a0ce13575fd1551fd971904f --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/LightProbeHelperGPU.d.ts @@ -0,0 +1,12 @@ +import { LightProbe, Mesh } from "three"; + +declare class LightProbeHelper extends Mesh { + lightProbe: LightProbe; + size: number; + + constructor(lightProbe: LightProbe, size?: number); + + dispose(): void; +} + +export { LightProbeHelper }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/OctreeHelper.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/OctreeHelper.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2610364860b18cd6c8684587eabe4e1dd1a50f15 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/OctreeHelper.d.ts @@ -0,0 +1,17 @@ +import { ColorRepresentation, LineSegments } from "three"; +import { Octree } from "../math/Octree.js"; + +export class OctreeHelper extends LineSegments { + constructor(octree: Octree, color?: ColorRepresentation); + + octree: Octree; + color: ColorRepresentation; + + /** + * @default 'OctreeHelper' + */ + type: "OctreeHelper" | string; + + update(): void; + dispose(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/PositionalAudioHelper.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/PositionalAudioHelper.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..87b90f14b2d27ab4276c7619b2e98a22cf6b7172 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/PositionalAudioHelper.d.ts @@ -0,0 +1,13 @@ +import { Line, PositionalAudio } from "three"; + +export class PositionalAudioHelper extends Line { + constructor(audio: PositionalAudio, range?: number, divisionsInnerAngle?: number, divisionsOuterAngle?: number); + + audio: PositionalAudio; + range: number; + divisionsInnerAngle: number; + divisionsOuterAngle: number; + + dispose(): void; + update(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/RapierHelper.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/RapierHelper.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..987cee03056c712091752cb7cbedd59d6a4b463d --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/RapierHelper.d.ts @@ -0,0 +1,13 @@ +import * as RAPIER from "@dimforge/rapier3d-compat"; +import { LineSegments } from "three"; + +declare class RapierHelper extends LineSegments { + world: RAPIER.World; + + constructor(world: RAPIER.World); + + update(): void; + dispose(): void; +} + +export { RapierHelper }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/RectAreaLightHelper.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/RectAreaLightHelper.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c174a174acb5323777af24a04de069a5aeb84f60 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/RectAreaLightHelper.d.ts @@ -0,0 +1,10 @@ +import { ColorRepresentation, Line, RectAreaLight } from "three"; + +export class RectAreaLightHelper extends Line { + constructor(light: RectAreaLight, color?: ColorRepresentation); + + light: RectAreaLight; + color: ColorRepresentation | undefined; + + dispose(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/TextureHelper.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/TextureHelper.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..06ed40c66a9e6b4f9b388da209b7c78ada007da2 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/TextureHelper.d.ts @@ -0,0 +1,10 @@ +import { BufferGeometry, Mesh, ShaderMaterial, Texture } from "three"; + +export class TextureHelper extends Mesh { + texture: Texture; + type: "TextureHelper"; + + constructor(texture: Texture, width?: number, height?: number, depth?: number); + + dispose(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/TextureHelperGPU.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/TextureHelperGPU.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..38c90bf2bfbe8266f15cb0cdb7742109f8a5eda1 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/TextureHelperGPU.d.ts @@ -0,0 +1,10 @@ +import { BufferGeometry, Mesh, NodeMaterial, Texture } from "three/webgpu"; + +export class TextureHelper extends Mesh { + texture: Texture; + type: "TextureHelper"; + + constructor(texture: Texture, width?: number, height?: number, depth?: number); + + dispose(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/VertexNormalsHelper.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/VertexNormalsHelper.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..69bd32a19130e06ac731b6b5165ce56afd2b0825 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/VertexNormalsHelper.d.ts @@ -0,0 +1,14 @@ +import { LineSegments, Object3D } from "three"; + +export class VertexNormalsHelper extends LineSegments { + readonly isVertexNormalsHelper: true; + + constructor(object: Object3D, size?: number, hex?: number); + + object: Object3D; + size: number; + + update(): void; + + dispose(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/VertexTangentsHelper.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/VertexTangentsHelper.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bfa26f32221163a34588a5f245acc2e0cca0113f --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/VertexTangentsHelper.d.ts @@ -0,0 +1,12 @@ +import { LineSegments, Object3D } from "three"; + +export class VertexTangentsHelper extends LineSegments { + constructor(object: Object3D, size?: number, hex?: number); + + object: Object3D; + size: number; + + update(): void; + + dispose(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/ViewHelper.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/ViewHelper.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d0f9fbb37eb91c421a9a63ba9a3708766f7562c2 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/helpers/ViewHelper.d.ts @@ -0,0 +1,17 @@ +import { Camera, Object3D, Vector3, WebGLRenderer } from "three"; + +export class ViewHelper extends Object3D { + readonly isViewHelper: true; + + animating: boolean; + center: Vector3; + + render: (renderer: WebGLRenderer) => void; + handleClick: (event: MouseEvent) => boolean; + setLabels: (labelX?: string, labelY?: string, labelZ?: string) => void; + setLabelStyle: (font?: string, color?: string, radius?: number) => void; + update: (delta: number) => void; + dispose: () => void; + + constructor(camera: Camera, domElement: HTMLElement); +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/interactive/HTMLMesh.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/interactive/HTMLMesh.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..901b689e467c9768692376a41de914ebc2798e0a --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/interactive/HTMLMesh.d.ts @@ -0,0 +1,13 @@ +import { Mesh, MeshBasicMaterial, Object3DEventMap, PlaneGeometry } from "three"; + +export interface HTMLMeshEventMap extends Object3DEventMap { + mousedown: { data: { x: number; y: number } }; + mousemove: { data: { x: number; y: number } }; + mouseup: { data: { x: number; y: number } }; + click: { data: { x: number; y: number } }; +} + +export class HTMLMesh extends Mesh { + constructor(dom: HTMLElement); + dispose(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/interactive/InteractiveGroup.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/interactive/InteractiveGroup.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b8bb3db6a59a86f84aa955a3170788f5c5c2686d --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/interactive/InteractiveGroup.d.ts @@ -0,0 +1,28 @@ +import { Camera, Group, Object3D, Object3DEventMap, Raycaster, Vector2, WebGLRenderer, XRTargetRaySpace } from "three"; + +export interface InteractiveObject3DEventMap extends Object3DEventMap { + hoveron: { data: Vector2 }; + pointerdown: { data: Vector2 }; + pointerup: { data: Vector2 }; + pointermove: { data: Vector2 }; + mousedown: { data: Vector2 }; + mouseup: { data: Vector2 }; + mousemove: { data: Vector2 }; + click: { data: Vector2 }; +} + +export class InteractiveObject3D extends Object3D {} + +export class InteractiveGroup extends Group { + raycaster: Raycaster; + + listenToPointerEvents(renderer: WebGLRenderer, camera: Camera): void; + + disconnectionPointerEvents(): void; + + listenToXRControllerEvents(controller: XRTargetRaySpace): void; + + disconnectXrControllerEvents(): void; + + disconnect(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/interactive/SelectionBox.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/interactive/SelectionBox.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4c211911b5a7942877d150460b6d0581990b684d --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/interactive/SelectionBox.d.ts @@ -0,0 +1,16 @@ +import { Camera, Frustum, Mesh, Object3D, Scene, Vector3 } from "three"; + +export class SelectionBox { + constructor(camera: Camera, scene: Scene, deep?: number); + camera: Camera; + collection: Mesh[]; + deep: number; + endPoint: Vector3; + scene: Scene; + startPoint: Vector3; + instances: Record; + + select(startPoint?: Vector3, endPoint?: Vector3): Mesh[]; + updateFrustum(startPoint: Vector3, endPoint: Vector3): void; + searchChildInFrustum(frustum: Frustum, object: Object3D): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/interactive/SelectionHelper.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/interactive/SelectionHelper.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c067405c7a535c2a5d9d4bd9d693e5540e85cd36 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/interactive/SelectionHelper.d.ts @@ -0,0 +1,17 @@ +import { Vector2, WebGLRenderer } from "three"; + +export class SelectionHelper { + constructor(renderer: WebGLRenderer, cssClassName: string); + element: HTMLElement; + isDown: boolean; + enabled: boolean; + pointBottomRight: Vector2; + pointTopLeft: Vector2; + renderer: WebGLRenderer; + startPoint: Vector2; + + onSelectStart(event: Event): void; + onSelectMove(event: Event): void; + onSelectOver(event: Event): void; + dispose(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/libs/fflate.module.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/libs/fflate.module.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e85d31ecbfd5960db5d1350f998448f5b965bf20 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/libs/fflate.module.d.ts @@ -0,0 +1 @@ +export * from "fflate"; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/libs/lil-gui.module.min.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/libs/lil-gui.module.min.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..39cb3846f41346e049c4c08eea96e11f536d617b --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/libs/lil-gui.module.min.d.ts @@ -0,0 +1,608 @@ +export type KeyToValueOfType = { [K in keyof T]: T[K] extends V ? K : never }[keyof T]; + +export default GUI; +export class GUI { + /** + * Creates a panel that holds controllers. + * @example + * new GUI(); + * new GUI( { container: document.getElementById( 'custom' ) } ); + * + * @param [options] + * @param [options.autoPlace=true] + * Adds the GUI to `document.body` and fixes it to the top right of the page. + * + * @param [options.container] + * Adds the GUI to this DOM element. Overrides `autoPlace`. + * + * @param [options.width=245] + * Width of the GUI in pixels, usually set when name labels become too long. Note that you can make + * name labels wider in CSS with `.lil‑gui { ‑‑name‑width: 55% }` + * + * @param [options.title=Controls] + * Name to display in the title bar. + * + * @param [options.injectStyles=true] + * Injects the default stylesheet into the page if this is the first GUI. + * Pass `false` to use your own stylesheet. + * + * @param [options.touchStyles=true] + * Makes controllers larger on touch devices. Pass `false` to disable touch styles. + * + * @param [options.parent] + * Adds this GUI as a child in another GUI. Usually this is done for you by `addFolder()`. + */ + constructor({ + parent, + autoPlace, + container, + width, + title, + injectStyles, + touchStyles, + }?: { + autoPlace?: boolean; + container?: HTMLElement; + width?: number; + title?: string; + injectStyles?: boolean; + touchStyles?: number; + parent?: GUI; + }); + /** + * The GUI containing this folder, or `undefined` if this is the root GUI. + */ + parent: GUI; + /** + * The top level GUI containing this folder, or `this` if this is the root GUI. + */ + root: GUI; + /** + * The list of controllers and folders contained by this GUI. + */ + children: Array; + /** + * The list of controllers contained by this GUI. + */ + controllers: Controller[]; + /** + * The list of folders contained by this GUI. + */ + folders: GUI[]; + /** + * Used to determine if the GUI is closed. Use `gui.open()` or `gui.close()` to change this. + */ + _closed: boolean; + /** + * Used to determine if the GUI is hidden. Use `gui.show()` or `gui.hide()` to change this. + */ + _hidden: boolean; + /** + * The outermost container element. + */ + domElement: HTMLElement; + /** + * The DOM element that contains the title. + */ + $title: HTMLElement; + /** + * The DOM element that contains children. + */ + $children: HTMLElement; + /** + * Adds a controller to the GUI, inferring controller type using the `typeof` operator. + * @example + * gui.add( object, 'property' ); + * gui.add( object, 'number', 0, 100, 1 ); + * gui.add( object, 'options', [ 1, 2, 3 ] ); + * + * @param object The object the controller will modify. + * @param property Name of the property to control. + * @param [$1] Minimum value for number controllers, or the set of + * selectable values for a dropdown. + * @param [max] Maximum value for number controllers. + * @param [step] Step value for number controllers. + */ + add( + object: T, + property: K, + options: ReadonlyArray | Record, + ): OptionController; + add>( + object: T, + property: K, + min?: number, + max?: number, + step?: number, + ): NumberController; + add>(object: T, property: K, options?: never): BooleanController; + add>(object: T, property: K, options?: never): StringController; + add void>>( + object: T, + property: K, + options?: never, + ): FunctionController; + /** + * Adds a color controller to the GUI. + * @example + * params = { + * cssColor: '#ff00ff', + * rgbColor: { r: 0, g: 0.2, b: 0.4 }, + * customRange: [ 0, 127, 255 ], + * }; + * + * gui.addColor( params, 'cssColor' ); + * gui.addColor( params, 'rgbColor' ); + * gui.addColor( params, 'customRange', 255 ); + * + * @param object The object the controller will modify. + * @param property Name of the property to control. + * @param rgbScale Maximum value for a color channel when using an RGB color. You may + * need to set this to 255 if your colors are too bright. + */ + addColor(object: T, property: K, rgbScale?: number): ColorController; + /** + * Adds a folder to the GUI, which is just another GUI. This method returns + * the nested GUI so you can add controllers to it. + * @example + * const folder = gui.addFolder( 'Position' ); + * folder.add( position, 'x' ); + * folder.add( position, 'y' ); + * folder.add( position, 'z' ); + * + * @param title Name to display in the folder's title bar. + */ + addFolder(title: string): GUI; + /** + * Recalls values that were saved with `gui.save()`. + * @param obj + * @param recursive Pass false to exclude folders descending from this GUI. + */ + load(obj: object, recursive?: boolean): this; + /** + * Returns an object mapping controller names to values. The object can be passed to `gui.load()` to + * recall these values. + * @example + * { + * controllers: { + * prop1: 1, + * prop2: 'value', + * ... + * }, + * folders: { + * folderName1: { controllers, folders }, + * folderName2: { controllers, folders } + * ... + * } + * } + * + * @param recursive Pass false to exclude folders descending from this GUI. + */ + save(recursive?: boolean): object; + /** + * Opens a GUI or folder. GUI and folders are open by default. + * @param open Pass false to close + * @example + * gui.open(); // open + * gui.open( false ); // close + * gui.open( gui._closed ); // toggle + */ + open(open?: boolean): this; + /** + * Closes the GUI. + */ + close(): this; + /** + * Shows the GUI after it's been hidden. + * @param show + * @example + * gui.show(); + * gui.show( false ); // hide + * gui.show( gui._hidden ); // toggle + */ + show(show?: boolean): this; + /** + * Hides the GUI. + */ + hide(): this; + openAnimated(open?: boolean): GUI; + /** + * Change the title of this GUI. + * @param title + */ + title(title: string): this; + /** + * Current title of the GUI. Use `gui.title( 'Title' )` to modify this value. + */ + _title: string; + /** + * Resets all controllers to their initial values. + * @param recursive Pass false to exclude folders descending from this GUI. + */ + reset(recursive?: boolean): this; + /** + * Pass a function to be called whenever a controller in this GUI changes. + * @param callback + * @example + * gui.onChange( event => { + * event.object // object that was modified + * event.property // string, name of property + * event.value // new value of controller + * event.controller // controller that was modified + * } ); + */ + onChange( + callback: (arg0: { object: object; property: string; value: unknown; controller: Controller }) => void, + ): this; + /** + * Used to access the function bound to `onChange` events. Don't modify this value + * directly. Use the `gui.onChange( callback )` method instead. + */ + _onChange: (arg0: { object: object; property: string; value: unknown; controller: Controller }) => void; + _callOnChange(controller: Controller): void; + /** + * Pass a function to be called whenever a controller in this GUI has finished changing. + * @param callback + * @example + * gui.onFinishChange( event => { + * event.object // object that was modified + * event.property // string, name of property + * event.value // new value of controller + * event.controller // controller that was modified + * } ); + */ + onFinishChange( + callback: (arg0: { object: object; property: string; value: unknown; controller: Controller }) => void, + ): this; + /** + * Used to access the function bound to `onFinishChange` events. Don't modify this value + * directly. Use the `gui.onFinishChange( callback )` method instead. + */ + _onFinishChange: (arg0: { object: object; property: string; value: unknown; controller: Controller }) => void; + _callOnFinishChange(controller: Controller): void; + /** + * Destroys all DOM elements and event listeners associated with this GUI + */ + destroy(): void; + /** + * Returns an array of controllers contained by this GUI and its descendents. + */ + controllersRecursive(): Controller[]; + /** + * Returns an array of folders contained by this GUI and its descendents. + */ + foldersRecursive(): GUI[]; +} +export class BooleanController< + T = Record, + K extends KeyToValueOfType = KeyToValueOfType, +> extends Controller { + constructor(parent: GUI, object: T, property: K); + $input: HTMLInputElement; +} +export class ColorController, K extends keyof T = keyof T> extends Controller { + constructor(parent: GUI, object: T, property: K, rgbScale: number); + $input: HTMLInputElement; + $text: HTMLInputElement; + $display: HTMLDivElement; + _format: + | { + isPrimitive: boolean; + match: (v: unknown) => boolean; + fromHexString: typeof normalizeColorString; + toHexString: typeof normalizeColorString; + } + | { + isPrimitive: boolean; + match: (arg: unknown) => arg is unknown[]; + fromHexString(string: unknown, target: unknown, rgbScale?: number): void; + toHexString([r, g, b]: [unknown, unknown, unknown], rgbScale?: number): string; + } + | { + isPrimitive: boolean; + match: (v: unknown) => boolean; + fromHexString(string: unknown, target: unknown, rgbScale?: number): void; + toHexString( + { + r, + g, + b, + }: { + r: unknown; + g: unknown; + b: unknown; + }, + rgbScale?: number, + ): string; + }; + _rgbScale: number; + _initialValueHexString: string | boolean; + _textFocused: boolean; + _setValueFromHexString(value: unknown): void; +} +/** + * lil-gui + * https://lil-gui.georgealways.com + * @version 0.17.0 + * @author George Michael Brower + * @license MIT + */ +/** + * Base class for all controllers. + */ +export class Controller, K extends keyof T = keyof T> { + constructor(parent: GUI, object: T, property: K, className: string, widgetTag?: string); + /** + * The GUI that contains this controller. + */ + parent: GUI; + /** + * The object this controller will modify. + */ + object: T; + /** + * The name of the property to control. + */ + property: string; + /** + * Used to determine if the controller is disabled. + * Use `controller.disable( true|false )` to modify this value + */ + _disabled: boolean; + /** + * Used to determine if the Controller is hidden. + * Use `controller.show()` or `controller.hide()` to change this. + */ + _hidden: boolean; + /** + * The value of `object[ property ]` when the controller was created. + */ + initialValue: T[K]; + /** + * The outermost container DOM element for this controller. + */ + domElement: HTMLElement; + /** + * The DOM element that contains the controller's name. + */ + $name: HTMLElement; + /** + * The DOM element that contains the controller's "widget" (which differs by controller type). + */ + $widget: HTMLElement; + /** + * The DOM element that receives the disabled attribute when using disable() + */ + $disable: HTMLElement; + _listenCallback(): void; + /** + * Sets the name of the controller and its label in the GUI. + * @param name + */ + name(name: string): this; + /** + * The controller's name. Use `controller.name( 'Name' )` to modify this value. + */ + _name: string; + /** + * Pass a function to be called whenever the value is modified by this controller. + * The function receives the new value as its first parameter. The value of `this` will be the + * controller. + * @param callback + * @example + * const controller = gui.add( object, 'property' ); + * + * controller.onChange( function( v ) { + * console.log( 'The value is now ' + v ); + * console.assert( this === controller ); + * } ); + */ + onChange(callback: (this: this, value: T[K]) => void): this; + /** + * Used to access the function bound to `onChange` events. Don't modify this value directly. + * Use the `controller.onChange( callback )` method instead. + */ + _onChange: (this: this, value: T[K]) => void; + /** + * Calls the onChange methods of this controller and its parent GUI. + */ + protected _callOnChange(): void; + _changed: boolean; + /** + * Pass a function to be called after this controller has been modified and loses focus. + * @param callback + * @example + * const controller = gui.add( object, 'property' ); + * + * controller.onFinishChange( function( v ) { + * console.log( 'Changes complete: ' + v ); + * console.assert( this === controller ); + * } ); + */ + onFinishChange(callback: (this: this, value: T[K]) => void): this; + /** + * Used to access the function bound to `onFinishChange` events. Don't modify this value + * directly. Use the `controller.onFinishChange( callback )` method instead. + */ + _onFinishChange: (this: this, value: T[K]) => void; + /** + * Should be called by Controller when its widgets lose focus. + */ + protected _callOnFinishChange(): void; + /** + * Sets the controller back to its initial value. + */ + reset(): this; + /** + * Enables this controller. + * @param enabled + * @example + * controller.enable(); + * controller.enable( false ); // disable + * controller.enable( controller._disabled ); // toggle + */ + enable(enabled?: boolean): this; + /** + * Disables this controller. + * @param disabled + * @example + * controller.disable(); + * controller.disable( false ); // enable + * controller.disable( !controller._disabled ); // toggle + */ + disable(disabled?: boolean): this; + /** + * Shows the Controller after it's been hidden. + * @param show + * @example + * controller.show(); + * controller.show( false ); // hide + * controller.show( controller._hidden ); // toggle + */ + show(show?: boolean): this; + /** + * Hides the Controller. + */ + hide(): this; + /** + * Destroys this controller and replaces it with a new option controller. Provided as a more + * descriptive syntax for `gui.add`, but primarily for compatibility with dat.gui. + * + * Use caution, as this method will destroy old references to this controller. It will also + * change controller order if called out of sequence, moving the option controller to the end of + * the GUI. + * @example + * // safe usage + * + * gui.add( object1, 'property' ).options( [ 'a', 'b', 'c' ] ); + * gui.add( object2, 'property' ); + * + * // danger + * + * const c = gui.add( object1, 'property' ); + * gui.add( object2, 'property' ); + * + * c.options( [ 'a', 'b', 'c' ] ); + * // controller is now at the end of the GUI even though it was added first + * + * assert( c.parent.children.indexOf( c ) === -1 ) + * // c references a controller that no longer exists + * + * @param options + */ + options(options: object | unknown[]): Controller; + /** + * Calls `updateDisplay()` every animation frame. Pass `false` to stop listening. + * @param listen + */ + listen(listen?: boolean): this; + /** + * Used to determine if the controller is currently listening. Don't modify this value + * directly. Use the `controller.listen( true|false )` method instead. + */ + _listening: boolean; + _listenCallbackID: number; + _listenPrevValue: unknown; + /** + * Returns `object[ property ]`. + */ + getValue(): T[K]; + /** + * Sets the value of `object[ property ]`, invokes any `onChange` handlers and updates the display. + * @param value + */ + setValue(value: T[K]): this; + /** + * Updates the display to keep it in sync with the current value. Useful for updating your + * controllers when their values have been modified outside of the GUI. + */ + updateDisplay(): this; + load(value: T[K]): this; + save(): T[K]; + /** + * Destroys this controller and removes it from the parent GUI. + */ + destroy(): void; +} +export class FunctionController< + T = Record, + K extends KeyToValueOfType void> = KeyToValueOfType void>, +> extends Controller { + constructor(parent: GUI, object: T, property: K); + $button: HTMLButtonElement; +} +export class NumberController< + T = Record, + K extends KeyToValueOfType = KeyToValueOfType, +> extends Controller { + constructor( + parent: GUI, + object: T, + property: K, + min: number | undefined, + max: number | undefined, + step: number | undefined, + ); + _decimals: unknown; + _min: unknown; + _max: unknown; + _step: unknown; + _stepExplicit: boolean; + _initInput(): void; + $input: HTMLInputElement; + _inputFocused: boolean; + _initSlider(): void; + _hasSlider: boolean; + $slider: HTMLDivElement; + $fill: HTMLDivElement; + _setDraggingStyle(active: unknown, axis?: string): void; + _getImplicitStep(): number; + _onUpdateMinMax(): void; + _normalizeMouseWheel(e: unknown): unknown; + _arrowKeyMultiplier(e: unknown): number; + _snap(value: unknown): number; + _clamp(value: unknown): unknown; + _snapClampSetValue(value: unknown): void; + get _hasScrollBar(): boolean; + get _hasMin(): boolean; + get _hasMax(): boolean; + /** + * Sets the minimum value. Only works on number controllers. + * @param min + */ + min(min: number): this; + /** + * Sets the maximum value. Only works on number controllers. + * @param max + */ + max(max: number): this; + /** + * Values set by this controller will be rounded to multiples of `step`. Only works on number + * controllers. + * @param step + */ + step(step: number): this; + /** + * Rounds the displayed value to a fixed number of decimals, without affecting the actual value + * like `step()`. Only works on number controllers. + * @example + * gui.add( object, 'property' ).listen().decimals( 4 ); + * @param decimals + */ + decimals(decimals: number): this; +} +export class OptionController, K extends keyof T = keyof T> extends Controller { + constructor(parent: GUI, object: T, property: K, options: ReadonlyArray | Record); + $select: HTMLSelectElement; + $display: HTMLDivElement; + _values: Array; + _names: unknown[]; +} +export class StringController< + T = Record, + K extends KeyToValueOfType = KeyToValueOfType, +> extends Controller { + constructor(parent: GUI, object: T, property: K); + $input: HTMLInputElement; +} +declare function normalizeColorString(string: unknown): string | false; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/libs/meshopt_decoder.module.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/libs/meshopt_decoder.module.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2b15567e19daeafc875060b5f965447600ae2216 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/libs/meshopt_decoder.module.d.ts @@ -0,0 +1 @@ +export * from "meshoptimizer/meshopt_decoder.module.js"; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/libs/stats.module.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/libs/stats.module.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..940f4c2e94c1866a51251d5e4734e816c5703606 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/libs/stats.module.d.ts @@ -0,0 +1,3 @@ +import Stats = require("stats.js"); + +export default Stats; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/libs/tween.module.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/libs/tween.module.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d4ffce6f356c3e5e3abbffb3b14c83667c90848f --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/libs/tween.module.d.ts @@ -0,0 +1,2 @@ +export * from "@tweenjs/tween.js"; +export { default as default } from "@tweenjs/tween.js"; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lighting/TiledLighting.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lighting/TiledLighting.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5eaab9b09c2a375c963e2d9e8be9058abf2b2264 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lighting/TiledLighting.d.ts @@ -0,0 +1,10 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Lighting } from "three/webgpu"; +import { Light } from "../../../src/lights/Light.js"; +import TiledLightsNode from "../tsl/lighting/TiledLightsNode.js"; + +export class TiledLighting extends Lighting { + constructor(); + + createNode(lights?: Light[]): ShaderNodeObject; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lights/LightProbeGenerator.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lights/LightProbeGenerator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4b398442b932e72663f6bdb8f87b1cd0ac359498 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lights/LightProbeGenerator.d.ts @@ -0,0 +1,10 @@ +import { CubeTexture, LightProbe, WebGLCubeRenderTarget, WebGLRenderer } from "three"; +import { WebGPURenderer } from "three/webgpu"; + +export namespace LightProbeGenerator { + function fromCubeTexture(cubeTexture: CubeTexture): LightProbe; + function fromCubeRenderTarget( + renderer: WebGLRenderer | WebGPURenderer, + cubeRenderTarget: WebGLCubeRenderTarget, + ): Promise; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lights/RectAreaLightTexturesLib.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lights/RectAreaLightTexturesLib.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7d84013a3a8f8444c78d59a59c68f4621e51121c --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lights/RectAreaLightTexturesLib.d.ts @@ -0,0 +1,7 @@ +import { RectAreaLightTexturesLib as RectAreaLightTexturesLibInterface } from "three/webgpu"; + +declare class RectAreaLightTexturesLib { + static init(): RectAreaLightTexturesLibInterface; +} + +export { RectAreaLightTexturesLib }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lights/RectAreaLightUniformsLib.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lights/RectAreaLightUniformsLib.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b272301bcee38e86d47eff46bdcba4f74a7c435e --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lights/RectAreaLightUniformsLib.d.ts @@ -0,0 +1,5 @@ +declare class RectAreaLightUniformsLib { + static init(): void; +} + +export { RectAreaLightUniformsLib }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lines/Line2.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lines/Line2.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b5b2423258d296ae96f0649fc0531f94dfa4fc9c --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lines/Line2.d.ts @@ -0,0 +1,25 @@ +import { LineGeometry } from "./LineGeometry.js"; +import { LineMaterial } from "./LineMaterial.js"; +import { LineSegments2 } from "./LineSegments2.js"; + +/** + * A polyline drawn between vertices. + * + * This adds functionality beyond {@link Line}, like arbitrary line width and changing width to be in world units. It + * extends {@link LineSegments2}, simplifying constructing segments from a chain of points. + */ +export class Line2 extends LineSegments2 { + geometry: LineGeometry; + material: LineMaterial; + + /** + * Read-only flag to check if a given object is of type Line2. + */ + readonly isLine2: true; + + /** + * @param geometry (optional) Pair(s) of vertices representing each line segment + * @param material (optional) Material for the line. Default is a {@link LineMaterial} with random color. + */ + constructor(geometry?: LineGeometry, material?: LineMaterial); +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lines/LineGeometry.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lines/LineGeometry.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fd8322293b55d211f152e1ba57088801eab353e1 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lines/LineGeometry.d.ts @@ -0,0 +1,27 @@ +import { Line } from "three"; + +import { LineSegmentsGeometry } from "./LineSegmentsGeometry.js"; + +/** + * A chain of vertices, forming a polyline. + * + * This is used in {@link Line2} to describe the shape. + */ +export class LineGeometry extends LineSegmentsGeometry { + /** + * Read-only flag to check if a given object is of type LineGeometry. + */ + readonly isLineGeometry: true; + + /** + * Creates a new geometry. + * Call [setPositions]{@link LineGeometry.setPositions} to add segments. + */ + constructor(); + + /** + * Copy the vertex positions of a {@link Line} object into this geometry. + * Assumes the source geometry is not using indices. + */ + fromLine(line: Line): this; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lines/LineMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lines/LineMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d7b2b342e630ad37df87ebca67a8bb218d41312e --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lines/LineMaterial.d.ts @@ -0,0 +1,82 @@ +import { Color, ColorRepresentation, ShaderMaterial, ShaderMaterialParameters, Vector2 } from "three"; + +export interface LineMaterialParameters extends ShaderMaterialParameters { + alphaToCoverage?: boolean | undefined; + color?: ColorRepresentation | undefined; + dashed?: boolean | undefined; + dashScale?: number | undefined; + dashSize?: number | undefined; + dashOffset?: number | undefined; + gapSize?: number | undefined; + resolution?: Vector2 | undefined; + worldUnits?: boolean | undefined; +} + +/** + * A material for drawing wireframe-style geometries. + * Unlike {@link LineBasicMaterial}, it supports arbitrary line widths and allows using world units instead of screen + * space units. This material is used with {@link LineSegments2} and {@link Line2}. + * + * Lines are always rendered with round caps and round joints. + */ +export class LineMaterial extends ShaderMaterial { + readonly isLineMaterial: true; + + /** + * @param parameters (optional) an object with one or more properties defining the material's appearance. Any + * property of the material (including any property inherited from {@link ShaderMaterial}) can be passed in here. + * + * The exception is the property color, which can be passed in as a number or hexadecimal string and is `0xffffff` + * (white) by default. Color.set( color ) is called internally. + */ + constructor(parameters?: LineMaterialParameters); + + /** + * {@link Color} of the material, by default set to white (0xffffff). + */ + get color(): Color; + set color(value: Color); + + /** + * Whether the material's sizes (width, dash gaps) are in world units. Default is `false` (screen space units.) + */ + get worldUnits(): boolean; + set worldUnits(value: boolean); + + /** + * Whether the line is dashed, or solid. Default is `false`. + */ + get dashed(): boolean; + set dashed(value: boolean); + + /** + * The scale of the dashes and gaps. Default is `1`. + */ + get dashScale(): number; + set dashScale(value: number); + + /** + * The size of the dash. Default is `1`. + */ + get dashSize(): number; + set dashSize(value: number); + + /** + * Where in the dash cycle the dash starts. Default is `0`. + */ + get dashOffset(): number; + set dashOffset(value: number); + + /** + * The size of the gap. Default is `1`. + */ + get gapSize(): number; + set gapSize(value: number); + + /** + * The size of the viewport, in screen pixels. This must be kept updated to make screen-space rendering accurate. + * The {@link LineSegments2.onBeforeRender} callback performs the update for visible objects. Default is `[1, 1]`. + */ + get resolution(): Vector2; + set resolution(value: Vector2); +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lines/LineSegments2.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lines/LineSegments2.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f35c9cfc42f14f332f2d9bbc0cbeab7908957f94 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lines/LineSegments2.d.ts @@ -0,0 +1,39 @@ +import { Mesh, Vector2, WebGLRenderer } from "three"; + +import { LineMaterial } from "./LineMaterial.js"; +import { LineSegmentsGeometry } from "./LineSegmentsGeometry.js"; + +/** + * A series of lines drawn between pairs of vertices. + * + * This adds functionality beyond {@link LineSegments}, like arbitrary line width and changing width to be in world + * units. The {@link Line2} extends this object, forming a polyline instead of individual segments. + */ +export class LineSegments2 extends Mesh { + geometry: LineSegmentsGeometry; + material: LineMaterial; + + /** + * Read-only flag to check if a given object is of type LineSegments2. + */ + readonly isLineSegments2: true; + + resolution: Vector2; + + /** + * @param geometry (optional) Pair(s) of vertices representing each line segment. + * @param material (optional) Material for the line. Default is a {@link LineMaterial} with random color. + */ + constructor(geometry?: LineSegmentsGeometry, material?: LineMaterial); + + computeLineDistances(): this; + + /** + * Called by the framework to update the material's resolution property, needed for screen-scaled widths. + * + * If your object is not visible to a camera (e.g. by [layers]{@link Object3D.layers} or + * [visible]{@link Object3D.visible}), you must call this manually whenever the viewport changes. + * @param renderer + */ + onBeforeRender(renderer: WebGLRenderer): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lines/LineSegmentsGeometry.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lines/LineSegmentsGeometry.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d9bdb86f25846a069312b30b2e5ff25fe30d9662 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lines/LineSegmentsGeometry.d.ts @@ -0,0 +1,53 @@ +import { EdgesGeometry, InstancedBufferGeometry, LineSegments, Mesh, WireframeGeometry } from "three"; + +/** + * A series of vertex pairs, forming line segments. + * + * This is used in {@link LineSegments2} to describe the shape. + */ +export class LineSegmentsGeometry extends InstancedBufferGeometry { + /** + * Read-only flag to check if a given object is of type LineSegmentsGeometry. + */ + readonly isLineSegmentsGeometry: true; + + /** + * Creates a new geometry. Call [setPositions]{@link LineSegmentsGeometry.setPositions} to add segments. + */ + constructor(); + + /** + * Replace the vertex positions with a new set. The array can be an `Array` or `Float32Array`. The length must be a + * multiple of six. + * @param array + */ + setPositions(array: number[] | Float32Array): this; + + /** + * Replace the per-vertex colors. Every sixtuple describes a segment: `[r1, g1, b1, r2, g2, b2]`. The array can be + * an `Array` or `Float32Array`. + * @param array + */ + setColors(array: number[] | Float32Array): this; + + /** + * Copy the vertex positions of a wireframe geometry into this geometry. + */ + fromWireframeGeometry(geometry: WireframeGeometry): this; + + /** + * Copy the vertex positions of an edge geometry into this geometry. + */ + fromEdgesGeometry(geometry: EdgesGeometry): this; + + /** + * Copy the vertex positions of a mesh object into this geometry. + */ + fromMesh(mesh: Mesh): this; + + /** + * Copy the vertex positions of a {@link LineSegments} object into this geometry. Assumes the source geometry is not + * using indices. + */ + fromLineSegments(lineSegments: LineSegments): this; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lines/Wireframe.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lines/Wireframe.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..810f1d0189ba384d3d0517e0670e99484a1e735d --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lines/Wireframe.d.ts @@ -0,0 +1,14 @@ +import { Mesh } from "three"; + +import { LineMaterial } from "./LineMaterial.js"; +import { LineSegmentsGeometry } from "./LineSegmentsGeometry.js"; + +declare class Wireframe extends Mesh { + readonly isWireframe: true; + + constructor(geometry?: LineSegmentsGeometry, material?: LineMaterial); + + computeLineDistances(): this; +} + +export { Wireframe }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lines/WireframeGeometry2.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lines/WireframeGeometry2.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f5e3ec0d37c74bcc7543348c0a4ef590b4c4bd58 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lines/WireframeGeometry2.d.ts @@ -0,0 +1,8 @@ +import { BufferGeometry } from "three"; + +import { LineSegmentsGeometry } from "./LineSegmentsGeometry.js"; + +export class WireframeGeometry2 extends LineSegmentsGeometry { + constructor(geometry: BufferGeometry); + readonly isWireframeGeometry2: boolean; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lines/webgpu/Line2.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lines/webgpu/Line2.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..af918be9d0c1041839cb6d728b6a6ddc236e0abf --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lines/webgpu/Line2.d.ts @@ -0,0 +1,14 @@ +import { Line2NodeMaterial } from "three/webgpu"; +import { LineGeometry } from "../LineGeometry.js"; +import { LineSegments2 } from "./LineSegments2.js"; + +declare class Line2 extends LineSegments2 { + geometry: LineGeometry; + material: Line2NodeMaterial; + + readonly isLine2: true; + + constructor(geometry?: LineGeometry, material?: Line2NodeMaterial); +} + +export { Line2 }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lines/webgpu/LineSegments2.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lines/webgpu/LineSegments2.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e4b2d41310389dcfa28edb8dc0545867ea675a19 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lines/webgpu/LineSegments2.d.ts @@ -0,0 +1,15 @@ +import { Line2NodeMaterial, Mesh } from "three/webgpu"; +import { LineSegmentsGeometry } from "../LineSegmentsGeometry.js"; + +declare class LineSegments2 extends Mesh { + geometry: LineSegmentsGeometry; + material: Line2NodeMaterial; + + readonly isLineSegments2: true; + + constructor(geometry?: LineSegmentsGeometry, material?: Line2NodeMaterial); + + computeLineDistances(): this; +} + +export { LineSegments2 }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lines/webgpu/Wireframe.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lines/webgpu/Wireframe.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0adadc919a42282a2d32d8547eb0a1fa50646e56 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/lines/webgpu/Wireframe.d.ts @@ -0,0 +1,13 @@ +import { Line2NodeMaterial, Mesh } from "three/webgpu"; + +import { WireframeGeometry2 } from "../WireframeGeometry2.js"; + +declare class Wireframe extends Mesh { + readonly isWireframe: true; + + constructor(geometry?: WireframeGeometry2, material?: Line2NodeMaterial); + + computeLineDistances(): this; +} + +export { Wireframe }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/3DMLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/3DMLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..35568203f8fc4c794f1586df89012e76deb34259 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/3DMLoader.d.ts @@ -0,0 +1,10 @@ +import { Loader, LoadingManager, Object3D } from "three"; + +export class Rhino3dmLoader extends Loader { + constructor(manager?: LoadingManager); + + parse(data: ArrayBufferLike, onLoad: (object: Object3D) => void, onError?: (event: ErrorEvent) => void): void; + setLibraryPath(path: string): Rhino3dmLoader; + setWorkerLimit(workerLimit: number): Rhino3dmLoader; + dispose(): Rhino3dmLoader; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/3MFLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/3MFLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..49bf5e8b58ec6f69045a045422d3354b1fcded47 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/3MFLoader.d.ts @@ -0,0 +1,9 @@ +import { Group, Loader, LoadingManager } from "three"; + +export class ThreeMFLoader extends Loader { + constructor(manager?: LoadingManager); + availableExtensions: object[]; + + parse(data: ArrayBuffer): Group; + addExtension(extension: object): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/AMFLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/AMFLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..23ea9debffa5cb708242ae4906cb08293c30006e --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/AMFLoader.d.ts @@ -0,0 +1,7 @@ +import { Group, Loader, LoadingManager } from "three"; + +export class AMFLoader extends Loader { + constructor(manager?: LoadingManager); + + parse(data: ArrayBuffer): Group; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/BVHLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/BVHLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..05b0724f1477073be7d13bd32df647865c7ee00c --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/BVHLoader.d.ts @@ -0,0 +1,14 @@ +import { AnimationClip, Loader, LoadingManager, Skeleton } from "three"; + +export interface BVH { + clip: AnimationClip; + skeleton: Skeleton; +} + +export class BVHLoader extends Loader { + constructor(manager?: LoadingManager); + animateBonePositions: boolean; + animateBoneRotations: boolean; + + parse(text: string): BVH; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/ColladaLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/ColladaLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..38fab405580b8f20626637ed887fb43878de1428 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/ColladaLoader.d.ts @@ -0,0 +1,11 @@ +import { Loader, Scene } from "three"; + +export interface Collada { + kinematics: object; + library: object; + scene: Scene; +} + +export class ColladaLoader extends Loader { + parse(text: string, path: string): Collada; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/DDSLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/DDSLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9053a9b232c8614a9fe1a5a6cb93e6319cb5f492 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/DDSLoader.d.ts @@ -0,0 +1,22 @@ +import { + CompressedPixelFormat, + CompressedTextureLoader, + CompressedTextureMipmap, + LoadingManager, + PixelFormat, +} from "three"; + +export interface DDS { + mipmaps: CompressedTextureMipmap[]; + width: number; + height: number; + format: PixelFormat | CompressedPixelFormat; + mipmapCount: number; + isCubemap: boolean; +} + +export class DDSLoader extends CompressedTextureLoader { + constructor(manager?: LoadingManager); + + parse(buffer: ArrayBuffer, loadMipmaps: boolean): DDS; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/DRACOLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/DRACOLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2e37a6e7d156b0717d32f09e5222e6cfb698adad --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/DRACOLoader.d.ts @@ -0,0 +1,25 @@ +import { BufferGeometry, Loader, LoadingManager } from "three"; + +export class DRACOLoader extends Loader { + constructor(manager?: LoadingManager); + + setDecoderPath(path: string): DRACOLoader; + setDecoderConfig(config: object): DRACOLoader; + setWorkerLimit(workerLimit: number): DRACOLoader; + + load( + url: string, + onLoad?: (data: BufferGeometry) => void, + onProgress?: (event: ProgressEvent) => void, + onError?: (err: unknown) => void, + ): void; + + parse( + buffer: ArrayBuffer, + onLoad?: (geometry: BufferGeometry) => void, + onError?: (err: unknown) => void, + ): void; + + preload(): DRACOLoader; + dispose(): DRACOLoader; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/EXRLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/EXRLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e767c0a308a56d373fccac0218f6db3852b15094 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/EXRLoader.d.ts @@ -0,0 +1,32 @@ +import { + DataTextureLoader, + FloatType, + HalfFloatType, + LoadingManager, + PixelFormat, + RedFormat, + RGBAFormat, + RGFormat, + TextureDataType, +} from "three"; + +export interface EXR { + header: object; + width: number; + height: number; + data: Float32Array | Uint16Array; + format: PixelFormat; + colorSpace: string; + type: typeof HalfFloatType | typeof FloatType; +} + +declare class EXRLoader extends DataTextureLoader { + type: TextureDataType; + outputFormat: typeof RGBAFormat | typeof RGFormat | typeof RedFormat; + + constructor(manager?: LoadingManager); + + parse(buffer: ArrayBuffer): EXR; + setDataType(type: typeof HalfFloatType | typeof FloatType): this; + setOutputFormat(value: typeof RGBAFormat | typeof RGFormat | typeof RedFormat): this; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/FBXLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/FBXLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b5eac71d0be0a2b4a336298670df6c8d23e606f1 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/FBXLoader.d.ts @@ -0,0 +1,7 @@ +import { Group, Loader, LoadingManager } from "three"; + +export class FBXLoader extends Loader { + constructor(manager?: LoadingManager); + + parse(FBXBuffer: ArrayBuffer | string, path: string): Group; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/FontLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/FontLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e79c4600052714442f661ee8505db45cdf2ff753 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/FontLoader.d.ts @@ -0,0 +1,41 @@ +import { Loader, LoadingManager, Shape } from "three"; + +export interface FontData { + glyphs: Record; + familyName: string; + ascender: number; + descender: number; + underlinePosition: number; + underlineThickness: number; + boundingBox: { yMin: number; xMin: number; yMax: number; xMax: number }; + resolution: number; + original_font_information: Record; +} + +export class FontLoader extends Loader { + constructor(manager?: LoadingManager); + + load( + url: string, + onLoad?: (data: Font) => void, + onProgress?: (event: ProgressEvent) => void, + onError?: (err: unknown) => void, + ): void; + + parse(json: FontData): Font; +} + +export class Font { + readonly isFont: true; + + /** + * @default 'Font' + */ + type: string; + + data: FontData; + + constructor(data: FontData); + + generateShapes(text: string, size?: number): Shape[]; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/GCodeLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/GCodeLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..74c209991018216ba78c1fe02a9c713e8f0f73c5 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/GCodeLoader.d.ts @@ -0,0 +1,8 @@ +import { Group, Loader, LoadingManager } from "three"; + +export class GCodeLoader extends Loader { + constructor(manager?: LoadingManager); + splitLayer: boolean; + + parse(data: string): Group; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/GLTFLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/GLTFLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..da46dfa4f7918d7fd5f8c2a1c8bf1648723a80f8 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/GLTFLoader.d.ts @@ -0,0 +1,152 @@ +import { + AnimationClip, + BufferAttribute, + BufferGeometry, + Camera, + FileLoader, + Group, + ImageBitmapLoader, + InterleavedBufferAttribute, + Loader, + LoadingManager, + Material, + Mesh, + MeshStandardMaterial, + Object3D, + Skeleton, + SkinnedMesh, + Texture, + TextureLoader, +} from "three"; + +import { MeshoptDecoder } from "../libs/meshopt_decoder.module.js"; +import { DRACOLoader } from "./DRACOLoader.js"; +import { KTX2Loader } from "./KTX2Loader.js"; + +export interface GLTF { + animations: AnimationClip[]; + scene: Group; + scenes: Group[]; + cameras: Camera[]; + asset: { + copyright?: string | undefined; + generator?: string | undefined; + version?: string | undefined; + minVersion?: string | undefined; + extensions?: any; + extras?: any; + }; + parser: GLTFParser; + userData: Record; +} + +export class GLTFLoader extends Loader { + dracoLoader: DRACOLoader | null; + ktx2Loader: KTX2Loader | null; + meshoptDecoder: typeof MeshoptDecoder | null; + + constructor(manager?: LoadingManager); + + setDRACOLoader(dracoLoader: DRACOLoader): this; + setKTX2Loader(ktx2Loader: KTX2Loader | null): this; + setMeshoptDecoder(meshoptDecoder: typeof MeshoptDecoder | null): this; + + register(callback: (parser: GLTFParser) => GLTFLoaderPlugin): this; + unregister(callback: (parser: GLTFParser) => GLTFLoaderPlugin): this; + + parse( + data: ArrayBuffer | string, + path: string, + onLoad: (gltf: GLTF) => void, + onError?: (event: ErrorEvent) => void, + ): void; + + parseAsync(data: ArrayBuffer | string, path: string): Promise; +} + +export type GLTFReferenceType = "materials" | "nodes" | "textures" | "meshes"; + +export interface GLTFReference { + materials?: number; + nodes?: number; + textures?: number; + meshes?: number; +} + +export class GLTFParser { + json: any; + + options: { + path: string; + manager: LoadingManager; + ktx2Loader: KTX2Loader; + meshoptDecoder: /* MeshoptDecoder */ any; + crossOrigin: string; + requestHeader: { [header: string]: string }; + }; + + fileLoader: FileLoader; + textureLoader: TextureLoader | ImageBitmapLoader; + plugins: { [name: string]: GLTFLoaderPlugin }; + extensions: { [name: string]: any }; + associations: Map; + + setExtensions(extensions: { [name: string]: any }): void; + setPlugins(plugins: { [name: string]: GLTFLoaderPlugin }): void; + + parse(onLoad: (gltf: GLTF) => void, onError?: (event: ErrorEvent) => void): void; + + getDependency: (type: string, index: number) => Promise; + getDependencies: (type: string) => Promise; + loadBuffer: (bufferIndex: number) => Promise; + loadBufferView: (bufferViewIndex: number) => Promise; + loadAccessor: (accessorIndex: number) => Promise; + loadTexture: (textureIndex: number) => Promise; + loadTextureImage: (textureIndex: number, sourceIndex: number, loader: Loader) => Promise; + loadImageSource: (sourceIndex: number, loader: Loader) => Promise; + assignTexture: ( + materialParams: { [key: string]: any }, + mapName: string, + mapDef: { + index: number; + texCoord?: number | undefined; + extensions?: any; + }, + colorSpace?: string | undefined, + ) => Promise; + assignFinalMaterial: (object: Mesh) => void; + getMaterialType: () => typeof MeshStandardMaterial; + loadMaterial: (materialIndex: number) => Promise; + createUniqueName: (originalName: string) => string; + createNodeMesh: (nodeIndex: number) => Promise; + loadGeometries: ( + /** + * GLTF.Primitive[] + * See: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/schema/mesh.primitive.schema.json + */ + primitives: Array<{ [key: string]: any }>, + ) => Promise; + loadMesh: (meshIndex: number) => Promise; + loadCamera: (cameraIndex: number) => Promise; + loadSkin: (skinIndex: number) => Promise; + loadAnimation: (animationIndex: number) => Promise; + loadNode: (nodeIndex: number) => Promise; + loadScene: () => Promise; +} + +export interface GLTFLoaderPlugin { + readonly name: string; + beforeRoot?: (() => Promise | null) | undefined; + afterRoot?: ((result: GLTF) => Promise | null) | undefined; + loadNode?: ((nodeIndex: number) => Promise | null) | undefined; + loadMesh?: ((meshIndex: number) => Promise | null) | undefined; + loadBufferView?: ((bufferViewIndex: number) => Promise | null) | undefined; + loadMaterial?: ((materialIndex: number) => Promise | null) | undefined; + loadTexture?: ((textureIndex: number) => Promise | null) | undefined; + getMaterialType?: ((materialIndex: number) => typeof Material | null) | undefined; + extendMaterialParams?: + | ((materialIndex: number, materialParams: { [key: string]: any }) => Promise | null) + | undefined; + createNodeMesh?: ((nodeIndex: number) => Promise | null) | undefined; + createNodeAttachment?: ((nodeIndex: number) => Promise | null) | undefined; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/HDRCubeTextureLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/HDRCubeTextureLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4d09d21e206c304392461bd3261b2aac0460070e --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/HDRCubeTextureLoader.d.ts @@ -0,0 +1,18 @@ +import { CubeTexture, Loader, LoadingManager, TextureDataType } from "three"; + +import { HDRLoader } from "./HDRLoader.js"; + +export class HDRCubeTextureLoader extends Loader { + constructor(manager?: LoadingManager); + hdrLoader: HDRLoader; + type: TextureDataType; + + load( + url: readonly string[], + onLoad?: (data: CubeTexture) => void, + onProgress?: (event: ProgressEvent) => void, + onError?: (err: unknown) => void, + ): CubeTexture; + + setDataType(type: TextureDataType): this; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/HDRLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/HDRLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..14d8d41a0d387b57ac02c3b3989788afb1f55ec2 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/HDRLoader.d.ts @@ -0,0 +1,22 @@ +import { DataTextureLoader, LoadingManager, TextureDataType } from "three"; + +export interface HDR { + width: number; + height: number; + data: Float32Array | Uint8Array; + header: string; + gamma: number; + exposure: number; + type: TextureDataType; +} + +declare class HDRLoader extends DataTextureLoader { + type: TextureDataType; + + constructor(manager?: LoadingManager); + + parse(buffer: ArrayBuffer): HDR; + setDataType(type: TextureDataType): this; +} + +export { HDRLoader }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/IESLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/IESLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9e4f1a8693f6a61e39b3674c52585cd57199d5e4 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/IESLoader.d.ts @@ -0,0 +1,5 @@ +import { DataTexture, Loader } from "three"; + +export class IESLoader extends Loader { + parse(text: string): DataTexture; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/KMZLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/KMZLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d62cac5dffd190fbe146e476a02b331076e5c14c --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/KMZLoader.d.ts @@ -0,0 +1,9 @@ +import { Loader, LoadingManager } from "three"; + +import { Collada } from "./ColladaLoader.js"; + +export class KMZLoader extends Loader { + constructor(manager?: LoadingManager); + + parse(data: ArrayBuffer): Collada; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/KTX2Loader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/KTX2Loader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..954300a08dae89b5b824201eeb13d7ffb8f8d62d --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/KTX2Loader.d.ts @@ -0,0 +1,55 @@ +import { CompressedTexture, Loader, LoadingManager, WebGLRenderer } from "three"; +import { Renderer, WebGPURenderer } from "three/webgpu"; +import { WorkerPool } from "../utils/WorkerPool.js"; + +export interface KTX2LoaderWorkerConfig { + astcSupported: boolean; + astcHDRSupported: boolean; + etc1Supported: boolean; + etc2Supported: boolean; + dxtSupported: boolean; + bptcSupported: boolean; + pvrtcSupported: boolean; +} + +export class KTX2Loader extends Loader { + transcoderPath: string; + transcoderBinary: ArrayBuffer | null; + transcoderPending: Promise | null; + + workerPool: WorkerPool; + workerSourceURL: string; + workerConfig: KTX2LoaderWorkerConfig; + + constructor(manager?: LoadingManager); + + /** + * The WASM transcoder and JS wrapper are available from the examples/jsm/libs/basis directory. + * @param path Path to folder containing the WASM transcoder and JS wrapper. + */ + setTranscoderPath(path: string): this; + + /** + * Sets the maximum number of web workers to be allocated by this instance. + * @param limit Maximum number of workers. Default is '4'. + */ + setWorkerLimit(limit: number): this; + + detectSupportAsync(renderer: Renderer): Promise; + + /** + * Detects hardware support for available compressed texture formats, to determine the output format for the + * transcoder. Must be called before loading a texture. + * @param renderer A renderer instance. + */ + detectSupport(renderer: WebGLRenderer | WebGPURenderer): this; + + init(): Promise; + + parse(buffer: ArrayBuffer, onLoad?: (texture: CompressedTexture) => void, onError?: (err: unknown) => void): void; + + /** + * Disposes the loader object, de-allocating any Web Workers created. + */ + dispose(): this; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/KTXLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/KTXLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..326789960a0779844e1ffee11353069f82033583 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/KTXLoader.d.ts @@ -0,0 +1,22 @@ +import { + CompressedPixelFormat, + CompressedTextureLoader, + CompressedTextureMipmap, + LoadingManager, + PixelFormat, +} from "three"; + +export interface KTX { + mipmaps: CompressedTextureMipmap[]; + width: number; + height: number; + format: PixelFormat | CompressedPixelFormat; + mipmapCount: number; + isCubemap: boolean; +} + +export class KTXLoader extends CompressedTextureLoader { + constructor(manager?: LoadingManager); + + parse(buffer: ArrayBuffer, loadMipmaps: boolean): KTX; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/LDrawLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/LDrawLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3867b219216cc2254bd31cef9d1f8ddaff868711 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/LDrawLoader.d.ts @@ -0,0 +1,38 @@ +import { Group, Loader, LoadingManager, Material } from "three"; +import { LDrawConditionalLineMaterial } from "../materials/LDrawConditionalLineMaterial.js"; +import { LDrawConditionalLineMaterial as LDrawConditionalLineNodeMaterial } from "../materials/LDrawConditionalLineNodeMaterial.js"; + +export class LDrawLoader extends Loader { + materials: Material[]; + materialsLibrary: Record; + + fileMap: Record; + + smoothNormals: boolean; + + partsLibraryPath: string; + + ConditionalLineMaterial: typeof LDrawConditionalLineMaterial | typeof LDrawConditionalLineNodeMaterial | null; + + constructor(manager?: LoadingManager); + + setPartsLibraryPath(path: string): this; + + setConditionalLineMaterial( + type: typeof LDrawConditionalLineMaterial | typeof LDrawConditionalLineNodeMaterial, + ): this; + + preloadMaterials(url: string): Promise; + + parse(text: string, onLoad: (data: Group) => void, onError?: (error: unknown) => void): void; + + setMaterials(materials: Material[]): this; + clearMaterials(): this; + addMaterials(materials: Material[]): this; + addDefaultMaterials(): this; + + setFileMap(fileMap: Record): this; + + addMaterial(material: Material): this; + getMaterial(colourCode: string): Material | null; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/LUT3dlLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/LUT3dlLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9e98e0d60aa7d384a7764a6732acda968cdbd274 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/LUT3dlLoader.d.ts @@ -0,0 +1,39 @@ +import { Data3DTexture, FloatType, Loader, LoadingManager, UnsignedByteType } from "three"; + +export interface LUT3dlResult { + size: number; + texture3D: Data3DTexture; +} + +/** + * A 3D LUT loader that supports the .3dl file format. + * + * Based on the following references: + * + * http://download.autodesk.com/us/systemdocs/help/2011/lustre/index.html?url=./files/WSc4e151a45a3b785a24c3d9a411df9298473-7ffd.htm,topicNumber=d0e9492 + * https://community.foundry.com/discuss/topic/103636/format-spec-for-3dl?mode=Post&postID=895258 + */ +export class LUT3dlLoader extends Loader { + type: typeof UnsignedByteType | typeof FloatType; + + /** + * Creates a new {@link LUT3dlLoader}. + * @param manager The LoadingManager to use. Defaults to {@link DefaultLoadingManager} + */ + constructor(manager?: LoadingManager); + + /** + * Sets the desired texture type. Only {@link THREE.UnsignedByteType} and {@link THREE.FloatType} are supported. The + * default is {@link THREE.UnsignedByteType}. + * @param type The texture type. See the Textures texture constants page for details. + */ + setType(type: typeof UnsignedByteType | typeof FloatType): this; + + /** + * Parse a 3dl data string and fire {@link onLoad} callback when complete. The argument to {@link onLoad} will be an + * object containing the following LUT data: {@link LUT3dlResult.size}, {@link LUT3dlResult.texture} and + * {@link LUT3dlResult.texture3D}. + * @param input The 3dl data string. + */ + parse(input: string): LUT3dlResult; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/LUTCubeLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/LUTCubeLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9a3f0eed0b439433d99b635419bc47462e66844e --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/LUTCubeLoader.d.ts @@ -0,0 +1,42 @@ +import { Data3DTexture, FloatType, Loader, LoadingManager, UnsignedByteType, Vector3 } from "three"; + +export interface LUTCubeResult { + title: string; + size: number; + domainMin: Vector3; + domainMax: Vector3; + texture3D: Data3DTexture; +} + +/** + * A 3D LUT loader that supports the .cube file format. + * + * Based on the following reference: + * + * https://wwwimages2.adobe.com/content/dam/acom/en/products/speedgrade/cc/pdfs/cube-lut-specification-1.0.pdf + */ +export class LUTCubeLoader extends Loader { + type: typeof UnsignedByteType | typeof FloatType; + + /** + * Creates a new {@link LUTCubeLoader}. + * @param manager The LoadingManager to use. Defaults to {@link DefaultLoadingManager} + */ + constructor(manager?: LoadingManager); + + /** + * Sets the desired texture type. Only {@link THREE.UnsignedByteType} and {@link THREE.FloatType} are supported. The + * default is {@link THREE.UnsignedByteType}. + * @param type The texture type. See the Textures texture constants page for details. + */ + setType(type: typeof UnsignedByteType | typeof FloatType): this; + + /** + * Parse a cube data string and fire {@link onLoad} callback when complete. The argument to {@link onLoad} will be + * an object containing the following LUT data: {@link LUTCubeResult.title}, {@link LUTCubeResult.size}, + * {@link LUTCubeResult.domainMin}, {@link LUTCubeResult.domainMax}, {@link LUTCubeResult.texture} and + * {@link LUTCubeResult.texture3D}. + * @param input The cube data string. + */ + parse(input: string): LUTCubeResult; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/LUTImageLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/LUTImageLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..75501c5d2b027c5f3610380e763ae8eecf585308 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/LUTImageLoader.d.ts @@ -0,0 +1,18 @@ +import { Data3DTexture, Loader, LoadingManager, Texture } from "three"; + +export interface LUTImageResult { + size: number; + texture3D: Data3DTexture; +} + +export class LUTImageLoader extends Loader { + flip: boolean; + + constructor(manager?: LoadingManager); + + getImageData(texture: Texture): ImageData; + + horz2Vert(texture: Texture): ImageData; + + parse(dataArray: Uint8ClampedArray, size: number): LUTImageResult; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/LWOLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/LWOLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ed92b45c03825880ded27107f0c35fb7d2b52ccb --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/LWOLoader.d.ts @@ -0,0 +1,19 @@ +import { Loader, LoadingManager, Material, Object3D } from "three"; + +export interface LWO { + materials: Material[]; + meshes: Object3D[]; +} + +export interface LWOLoaderParameters { + /** + * Base content delivery folder path, use when it differs from Lightwave default structure + */ + resourcePath?: string; +} + +export class LWOLoader extends Loader { + constructor(manager?: LoadingManager, parameters?: LWOLoaderParameters); + + parse(data: ArrayBuffer, path: string, modelName: string): LWO; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/LottieLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/LottieLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..69d614e30953878a8dc927031dea85d9becf329f --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/LottieLoader.d.ts @@ -0,0 +1,18 @@ +import { CanvasTexture, Loader, LoadingManager } from "three"; + +export class LottieLoader extends Loader { + /** + * @deprecated The loader has been deprecated and will be removed with r186. Use lottie-web instead and create your + * animated texture manually. + */ + constructor(manager?: LoadingManager); + + load( + url: string, + onLoad?: (data: CanvasTexture) => void, + onProgress?: (event: ProgressEvent) => void, + onError?: (err: unknown) => void, + ): CanvasTexture; + + setQuality(value: number): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/MD2Loader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/MD2Loader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6176cdb73b127ecdd04fbe592ba38af57c7d0fc6 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/MD2Loader.d.ts @@ -0,0 +1,7 @@ +import { BufferGeometry, Loader, LoadingManager } from "three"; + +export class MD2Loader extends Loader { + constructor(manager?: LoadingManager); + + parse(data: ArrayBuffer): BufferGeometry; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/MDDLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/MDDLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a2eb5ee21962733787b6ffe8cfccf1d80b91bd9b --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/MDDLoader.d.ts @@ -0,0 +1,12 @@ +import { AnimationClip, BufferAttribute, Loader, LoadingManager } from "three"; + +export interface MDD { + morphTargets: BufferAttribute[]; + clip: AnimationClip; +} + +export class MDDLoader extends Loader { + constructor(manager?: LoadingManager); + + parse(data: ArrayBuffer): MDD; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/MTLLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/MTLLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a8356e34f554eb8bff25e0445b306e4d103503c5 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/MTLLoader.d.ts @@ -0,0 +1,95 @@ +import { BufferGeometry, Loader, LoadingManager, Mapping, Material, Side, Texture, Vector2, Wrapping } from "three"; + +export interface MaterialCreatorOptions { + /** + * side: Which side to apply the material + * THREE.FrontSide (default), THREE.BackSide, THREE.DoubleSide + */ + side?: Side | undefined; + /* + * wrap: What type of wrapping to apply for textures + * THREE.RepeatWrapping (default), THREE.ClampToEdgeWrapping, THREE.MirroredRepeatWrapping + */ + wrap?: Wrapping | undefined; + /* + * normalizeRGB: RGBs need to be normalized to 0-1 from 0-255 + * Default: false, assumed to be already normalized + */ + normalizeRGB?: boolean | undefined; + /* + * ignoreZeroRGBs: Ignore values of RGBs (Ka,Kd,Ks) that are all 0's + * Default: false + */ + ignoreZeroRGBs?: boolean | undefined; + /* + * invertTrProperty: Use values 1 of Tr field for fully opaque. This option is useful for obj + * exported from 3ds MAX, vcglib or meshlab. + * Default: false + */ + invertTrProperty?: boolean | undefined; +} + +export class MTLLoader extends Loader { + constructor(manager?: LoadingManager); + materialOptions: MaterialCreatorOptions; + + parse(text: string, path: string): MTLLoader.MaterialCreator; + setMaterialOptions(value: MaterialCreatorOptions): void; +} + +export interface MaterialInfo { + kd?: number[] | undefined; + ks?: number[] | undefined; + ke?: number[] | undefined; + map_kd?: string | undefined; + map_ks?: string | undefined; + map_ke?: string | undefined; + norm?: string | undefined; + map_bump?: string | undefined; + bump?: string | undefined; + disp?: string | undefined; + map_d?: string | undefined; + ns?: number | undefined; + d?: number | undefined; + tr?: number | undefined; +} + +export interface TexParams { + scale: Vector2; + offset: Vector2; + url: string; +} + +export namespace MTLLoader { + class MaterialCreator { + constructor(baseUrl?: string, options?: MaterialCreatorOptions); + + baseUrl: string; + options: MaterialCreatorOptions; + materialsInfo: { [key: string]: MaterialInfo }; + materials: { [key: string]: Material }; + private materialsArray: Material[]; + nameLookup: { [key: string]: number }; + side: Side; + wrap: Wrapping; + crossOrigin: string; + + setCrossOrigin(value: string): this; + setManager(value: LoadingManager): void; + setMaterials(materialsInfo: { [key: string]: MaterialInfo }): void; + convert(materialsInfo: { [key: string]: MaterialInfo }): { [key: string]: MaterialInfo }; + preload(): void; + getIndex(materialName: string): number; + getAsArray(): Material[]; + create(materialName: string): Material; + createMaterial_(materialName: string): Material; + getTextureParams(value: string, matParams: any): TexParams; + loadTexture( + url: string, + mapping?: Mapping, + onLoad?: (bufferGeometry: BufferGeometry) => void, + onProgress?: (event: ProgressEvent) => void, + onError?: (event: ErrorEvent) => void, + ): Texture; + } +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/MaterialXLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/MaterialXLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e9fcafad3d09c8ce4252123ab4d7098e601561d4 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/MaterialXLoader.d.ts @@ -0,0 +1,5 @@ +import { Loader, LoadingManager, MeshPhysicalNodeMaterial } from "three/webgpu"; + +export class MaterialXLoader extends Loader<{ materials: Record }> { + constructor(manager?: LoadingManager); +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/NRRDLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/NRRDLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..feff5c22ebddf9e8b90caebd2d66f6d779b88837 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/NRRDLoader.d.ts @@ -0,0 +1,15 @@ +import { Loader, LoadingManager } from "three"; + +import { Volume } from "../misc/Volume.js"; + +export class NRRDLoader extends Loader { + constructor(manager?: LoadingManager); + manager: LoadingManager; + path: string; + + fieldFunctions: object; + + parse(data: string): Volume; + parseChars(array: number[], start?: number, end?: number): string; + setPath(value: string): this; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/OBJLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/OBJLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a6fd8313820f3d8e1df986e0897258d942d9e566 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/OBJLoader.d.ts @@ -0,0 +1,10 @@ +import { Group, Loader, LoadingManager } from "three"; +import { MTLLoader } from "./MTLLoader.js"; + +export class OBJLoader extends Loader { + constructor(manager?: LoadingManager); + materials: MTLLoader.MaterialCreator; + + parse(data: string): Group; + setMaterials(materials: MTLLoader.MaterialCreator): this; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/PCDLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/PCDLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..87e15fedc551aaea1c4d943b595fdcc6d04fddfb --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/PCDLoader.d.ts @@ -0,0 +1,8 @@ +import { BufferGeometry, Loader, LoadingManager, Points, PointsMaterial } from "three"; + +export class PCDLoader extends Loader> { + constructor(manager?: LoadingManager); + littleEndian: boolean; + + parse(data: ArrayBuffer | string): Points; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/PDBLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/PDBLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1fb85f50a7b7a295b7bbb474f8f169e5c1281982 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/PDBLoader.d.ts @@ -0,0 +1,15 @@ +import { BufferGeometry, Loader, LoadingManager } from "three"; + +export interface PDB { + geometryAtoms: BufferGeometry; + geometryBonds: BufferGeometry; + json: { + atoms: any[][]; + }; +} + +export class PDBLoader extends Loader { + constructor(manager?: LoadingManager); + + parse(text: string): PDB; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/PLYLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/PLYLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..58fde572ecad47c17ee45daafc93344645f2fede --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/PLYLoader.d.ts @@ -0,0 +1,11 @@ +import { BufferGeometry, Loader, LoadingManager } from "three"; + +export class PLYLoader extends Loader { + constructor(manager?: LoadingManager); + propertyNameMapping: object; + customPropertyMapping: Record; + + setPropertyNameMapping(mapping: object): void; + setCustomPropertyNameMapping(mapping: Record): void; + parse(data: ArrayBuffer | string): BufferGeometry; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/PVRLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/PVRLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1ba14766ebae2aa34eb07bec69b538ee6ebd2422 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/PVRLoader.d.ts @@ -0,0 +1,16 @@ +import { CompressedPixelFormat, CompressedTextureLoader, CompressedTextureMipmap, LoadingManager } from "three"; + +export interface PVR { + mipmaps: CompressedTextureMipmap[]; + width: number; + height: number; + format: CompressedPixelFormat; + mipmapCount: number; + isCubemap: boolean; +} + +export class PVRLoader extends CompressedTextureLoader { + constructor(manager?: LoadingManager); + + parse(buffer: ArrayBuffer, loadMipmaps: boolean): PVR; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/RGBELoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/RGBELoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5819174c8c183fd4f68f66336b6d401853e72d61 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/RGBELoader.d.ts @@ -0,0 +1,13 @@ +import { HDR, HDRLoader } from "./HDRLoader.js"; + +/** + * @deprecated RGBELoader has been deprecated. Please use HDRLoader instead. + */ +export interface RGBE extends HDR { +} + +/** + * @deprecated RGBELoader has been deprecated. Please use HDRLoader instead. + */ +export class RGBELoader extends HDRLoader { +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/STLLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/STLLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..46edd02fc4ff4b4122d212c8f71ec7483bfdc42a --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/STLLoader.d.ts @@ -0,0 +1,7 @@ +import { BufferGeometry, Loader, LoadingManager } from "three"; + +export class STLLoader extends Loader { + constructor(manager?: LoadingManager); + + parse(data: ArrayBuffer | string): BufferGeometry; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/SVGLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/SVGLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..216bb6d1869ed4909057e9f3bb5f2fc5aa681d92 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/SVGLoader.d.ts @@ -0,0 +1,64 @@ +import { BufferGeometry, Loader, LoadingManager, Shape, ShapePath, Vector2, Vector3 } from "three"; + +export interface SVGResultPaths extends ShapePath { + userData?: Record | undefined; +} + +export interface SVGResult { + paths: SVGResultPaths[]; + xml: XMLDocument; +} + +export interface StrokeStyle { + strokeColor: string; + strokeWidth: number; + strokeLineJoin: string; + strokeLineCap: string; + strokeMiterLimit: number; +} + +export class SVGLoader extends Loader { + constructor(manager?: LoadingManager); + + defaultDPI: number; + defaultUnit: string; + + parse(text: string): SVGResult; + + static getStrokeStyle( + width?: number, + color?: string, + lineJoin?: string, + lineCap?: string, + miterLimit?: number, + ): StrokeStyle; + + /** + * Generates a stroke with some width around the given path. + * @remarks The path can be open or closed (last point equals to first point) + * @param points Array of Vector2D (the path). Minimum 2 points. + * @param style Object with SVG properties as returned by SVGLoader.getStrokeStyle(), or SVGLoader.parse() in the path.userData.style object + * @param arcDivisions Arc divisions for round joins and endcaps. (Optional) + * @param minDistance Points closer to this distance will be merged. (Optional) + * @returns BufferGeometry with stroke triangles (In plane z = 0). UV coordinates are generated ('u' along path. 'v' across it, from left to right) + */ + static pointsToStroke( + points: Vector2[], + style: StrokeStyle, + arcDivisions?: number, + minDistance?: number, + ): BufferGeometry; + + static pointsToStrokeWithBuffers( + points: Vector2[], + style: StrokeStyle, + arcDivisions?: number, + minDistance?: number, + vertices?: number[], + normals?: number[], + uvs?: number[], + vertexOffset?: number, + ): number; + + static createShapes(shapePath: ShapePath): Shape[]; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/TDSLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/TDSLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2875d880cc65c6f2ec35631029b235299d23cf91 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/TDSLoader.d.ts @@ -0,0 +1,35 @@ +import { Color, Group, Loader, LoadingManager, Material, Mesh, Texture } from "three"; + +export class TDSLoader extends Loader { + constructor(manager?: LoadingManager); + debug: boolean; + group: Group; + manager: LoadingManager; + materials: Material[]; + meshes: Mesh[]; + position: number; + + parse(arraybuffer: ArrayBuffer, path: string): Group; + + debugMessage(message: object): void; + endChunk(chunk: object): void; + nextChunk(data: DataView, chunk: object): void; + readByte(data: DataView): number; + readChunk(data: DataView): object; + readColor(data: DataView): Color; + readDWord(data: DataView): number; + readFaceArray(data: DataView, mesh: Mesh): void; + readFile(arraybuffer: ArrayBuffer, path: string): void; + readFloat(data: DataView): number; + readInt(data: DataView): number; + readMap(data: DataView, path: string): Texture; + readMesh(data: DataView): Mesh; + readMeshData(data: DataView, path: string): void; + readMaterialEntry(data: DataView, path: string): void; + readMaterialGroup(data: DataView): object; + readNamedObject(data: DataView): void; + readShort(data: DataView): number; + readString(data: DataView, maxLength: number): string; + readWord(data: DataView): number; + resetPosition(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/TGALoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/TGALoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f8c7ffd831bdb9bea8cbab35e704bc4372d0de7d --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/TGALoader.d.ts @@ -0,0 +1,7 @@ +import { DataTexture, DataTextureLoader, LoadingManager } from "three"; + +export class TGALoader extends DataTextureLoader { + constructor(manager?: LoadingManager); + + parse(data: ArrayBuffer): DataTexture; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/TIFFLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/TIFFLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d95e0ea51e756c6098ef80e06e28fb672e4ea537 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/TIFFLoader.d.ts @@ -0,0 +1,16 @@ +import { DataTextureLoader, LoadingManager, TextureFilter } from "three"; + +export interface TIFFResult { + width: number; + height: number; + data: Uint8Array; + flipY: true; + magFilter: TextureFilter; + minFilter: TextureFilter; +} + +export class TIFFLoader extends DataTextureLoader { + constructor(manager?: LoadingManager); + + parse(buffer: Iterable): TIFFResult; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/TTFLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/TTFLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5f80fd85d904eb8d3c312c2538f370d7091b7021 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/TTFLoader.d.ts @@ -0,0 +1,10 @@ +import { Loader, LoadingManager } from "three"; +import { FontData } from "./FontLoader.js"; + +export class TTFLoader extends Loader { + reversed: boolean; + + constructor(manager?: LoadingManager); + + parse(arraybuffer: ArrayBuffer): FontData; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/USDLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/USDLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ad13001d8d16a26b5fdfdf5febac9fc6f753baae --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/USDLoader.d.ts @@ -0,0 +1,9 @@ +import { Group, Loader, LoadingManager } from "three"; + +declare class USDLoader extends Loader { + constructor(manager?: LoadingManager); + + parse(buffer: ArrayBuffer | string): Group; +} + +export { USDLoader }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/USDZLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/USDZLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..74f2e2a1855deb552afbb0576599023c87a96f5c --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/USDZLoader.d.ts @@ -0,0 +1,14 @@ +import { LoadingManager } from "three"; +import { USDLoader } from "./USDLoader.js"; + +/** + * @deprecated USDZLoader has been deprecated. Please use USDLoader instead. + */ +declare class USDZLoader extends USDLoader { + /** + * @deprecated USDZLoader has been deprecated. Please use USDLoader instead. + */ + constructor(manager?: LoadingManager); +} + +export { USDZLoader }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/UltraHDRLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/UltraHDRLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..637dbe4374ece7e5eaa123bb3ab96caafa5ae6ef --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/UltraHDRLoader.d.ts @@ -0,0 +1,21 @@ +import { DataTexture, Loader, LoadingManager, RGBAFormat, TextureDataType } from "three"; + +interface UltraHDRLoaderTextureData { + width: number; + height: number; + hdrBuffer: Uint16Array | Float32Array; + format: typeof RGBAFormat; + type: TextureDataType; +} + +declare class UltraHDRLoader extends Loader { + type: TextureDataType; + + constructor(manager?: LoadingManager); + + setDataType(value: TextureDataType): this; + + parse(buffer: ArrayBuffer, onLoad: (texData: UltraHDRLoaderTextureData) => void): void; +} + +export { UltraHDRLoader }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/VOXLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/VOXLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..32664aaa4fa2604962c5aa690582646dbe8bbd5b --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/VOXLoader.d.ts @@ -0,0 +1,21 @@ +import { Data3DTexture, Loader, LoadingManager, Mesh } from "three"; + +export interface Chunk { + palette: number[]; + size: { x: number; y: number; z: number }; + data: Uint8Array; +} + +export class VOXLoader extends Loader { + constructor(manager?: LoadingManager); + + parse(data: ArrayBuffer): object[]; +} + +export class VOXMesh extends Mesh { + constructor(chunk: Chunk); +} + +export class VOXData3DTexture extends Data3DTexture { + constructor(chunk: Chunk); +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/VRMLLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/VRMLLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..331f7e5b78e1a795f80345a750c95b0665e20259 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/VRMLLoader.d.ts @@ -0,0 +1,7 @@ +import { Loader, LoadingManager, Scene } from "three"; + +export class VRMLLoader extends Loader { + constructor(manager?: LoadingManager); + + parse(data: string, path: string): Scene; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/VTKLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/VTKLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..40e8c8a76809256bb39a2fcce0f1b2f73512058f --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/VTKLoader.d.ts @@ -0,0 +1,7 @@ +import { BufferGeometry, Loader, LoadingManager } from "three"; + +export class VTKLoader extends Loader { + constructor(manager?: LoadingManager); + + parse(data: ArrayBuffer | string, path: string): BufferGeometry; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/XYZLoader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/XYZLoader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..881035382e19459bb87847fb6f5aae321ae5981b --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/loaders/XYZLoader.d.ts @@ -0,0 +1,7 @@ +import { BufferGeometry, Loader, LoadingManager } from "three"; + +export class XYZLoader extends Loader { + constructor(manager?: LoadingManager); + + parse(data: string, onLoad: (geometry: BufferGeometry) => void): object; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/materials/LDrawConditionalLineMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/materials/LDrawConditionalLineMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..43ed9411af199cb48edd1a49e13b106d2fc299bc --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/materials/LDrawConditionalLineMaterial.d.ts @@ -0,0 +1,9 @@ +import { ShaderMaterial, ShaderMaterialParameters } from "three"; + +declare class LDrawConditionalLineMaterial extends ShaderMaterial { + readonly isLDrawConditionalLineMaterial: true; + + constructor(parameters?: ShaderMaterialParameters); +} + +export { LDrawConditionalLineMaterial }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/materials/LDrawConditionalLineNodeMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/materials/LDrawConditionalLineNodeMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..463af24656885de44d1c51c70e3097257369cd11 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/materials/LDrawConditionalLineNodeMaterial.d.ts @@ -0,0 +1,9 @@ +import { NodeMaterial, NodeMaterialParameters } from "three/webgpu"; + +declare class LDrawConditionalLineMaterial extends NodeMaterial { + readonly isLDrawConditionalLineMaterial: true; + + constructor(parameters?: NodeMaterialParameters); +} + +export { LDrawConditionalLineMaterial }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/materials/MeshGouraudMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/materials/MeshGouraudMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7d2fb5d97d1c09b88b200d2ccf3dd2db32613fe5 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/materials/MeshGouraudMaterial.d.ts @@ -0,0 +1,18 @@ +/** + * MeshGouraudMaterial + * + * Lambert illumination model with Gouraud (per-vertex) shading + */ + +import { ShaderMaterial, ShaderMaterialParameters } from "three"; + +/** + * @deprecated Use THREE.MeshLambertMaterial instead. + */ +export class MeshGouraudMaterial extends ShaderMaterial { + isMeshGouraudMaterial: true; + + constructor(parameters?: ShaderMaterialParameters); + + copy(source: MeshGouraudMaterial): this; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/materials/MeshPostProcessingMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/materials/MeshPostProcessingMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..46fca567b13a5d07fa5b1b892f60907f1ba4a19b --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/materials/MeshPostProcessingMaterial.d.ts @@ -0,0 +1,13 @@ +import { MeshPhysicalMaterial, MeshPhysicalMaterialParameters, Texture } from "three"; + +export interface MeshPostProcessingMaterialParameters extends MeshPhysicalMaterialParameters { + aoPassMap?: Texture | null | undefined; + aoPassMapScale?: number | undefined; +} + +export class MeshPostProcessingMaterial extends MeshPhysicalMaterial { + constructor(parameters: MeshPostProcessingMaterialParameters); + + get aoPassMap(): Texture | null | undefined; + set aoPassMap(aoPassMap: Texture | null | undefined); +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/materials/WoodNodeMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/materials/WoodNodeMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..27677f95db02f79540d0107ef54886774ba90a89 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/materials/WoodNodeMaterial.d.ts @@ -0,0 +1,75 @@ +import * as THREE from "three"; + +export type WoodGenus = + | "teak" + | "walnut" + | "white_oak" + | "pine" + | "poplar" + | "maple" + | "red_oak" + | "cherry" + | "cedar" + | "mahogany"; +export type WoodFinish = "raw" | "matte" | "semigloss" | "gloss"; + +export const WoodGenuses: WoodGenus[]; +export const Finishes: WoodFinish[]; + +export interface WoodParameters { + transformationMatrix: THREE.Matrix4; + centerSize: number; + largeWarpScale: number; + largeGrainStretch: number; + smallWarpStrength: number; + smallWarpScale: number; + fineWarpStrength: number; + fineWarpScale: number; + ringThickness: number; + ringBias: number; + ringSizeVariance: number; + ringVarianceScale: number; + barkThickness: number; + splotchScale: number; + splotchIntensity: number; + cellScale: number; + cellSize: number; + darkGrainColor: string | THREE.Color; + lightGrainColor: string | THREE.Color; + genus: WoodGenus; + finish: WoodFinish; + clearcoat: number; + clearcoatRoughness: number; + clearcoatDarken: number; +} + +export function GetWoodPreset(genus: WoodGenus, finish: WoodFinish): WoodParameters; + +export class WoodNodeMaterial extends THREE.MeshPhysicalMaterial { + readonly isWoodNodeMaterial: true; + + transformationMatrix: THREE.Matrix4; + centerSize: number; + largeWarpScale: number; + largeGrainStretch: number; + smallWarpStrength: number; + smallWarpScale: number; + fineWarpStrength: number; + fineWarpScale: number; + ringThickness: number; + ringBias: number; + ringSizeVariance: number; + ringVarianceScale: number; + barkThickness: number; + splotchScale: number; + splotchIntensity: number; + cellScale: number; + cellSize: number; + darkGrainColor: THREE.Color; + lightGrainColor: THREE.Color; + clearcoatDarken: number; + + constructor(params?: Partial); + + static fromPreset(genus?: WoodGenus, finish?: WoodFinish): WoodNodeMaterial; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/math/Capsule.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/math/Capsule.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f50acc55cc65fb374aac91be9830f470fcef6148 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/math/Capsule.d.ts @@ -0,0 +1,26 @@ +import { Box3, Line3, Vector3 } from "three"; + +export class Capsule { + constructor(start?: Vector3, end?: Vector3, radius?: number); + start: Vector3; + end: Vector3; + radius: number; + + set(start: Vector3, end: Vector3, radius: number): this; + clone(): Capsule; + copy(capsule: Capsule): this; + getCenter(target: Vector3): Vector3; + translate(v: Vector3): this; + checkAABBAxis( + p1x: number, + p1y: number, + p2x: number, + p2y: number, + minx: number, + maxx: number, + miny: number, + maxy: number, + radius: number, + ): boolean; + intersectsBox(box: Box3): boolean; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/math/ColorConverter.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/math/ColorConverter.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2641b9fff1110e75c8caa68c8202ab7ae0f2a81e --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/math/ColorConverter.d.ts @@ -0,0 +1,19 @@ +import { Color } from "three"; + +export interface HSL { + h: number; + s: number; + l: number; +} + +export interface CMYK { + c: number; + m: number; + y: number; + k: number; +} + +export namespace ColorConverter { + function setHSV(color: Color, h: number, s: number, v: number): Color; + function getHSV(color: Color, target: HSL): HSL; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/math/ColorSpaces.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/math/ColorSpaces.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..58d4885a19bb7b1d8856113bf68688023cc216dc --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/math/ColorSpaces.d.ts @@ -0,0 +1,15 @@ +import { ColorSpaceDefinition } from "three"; + +export const DisplayP3ColorSpace: "display-p3"; +export const LinearDisplayP3ColorSpace: "display-p3-linear"; + +export const DisplayP3ColorSpaceImpl: ColorSpaceDefinition; +export const LinearDisplayP3ColorSpaceImpl: ColorSpaceDefinition; + +export const LinearRec2020ColorSpace: "rec2020-linear"; + +export const LinearRec2020ColorSpaceImpl: ColorSpaceDefinition; + +export const ExtendedSRGBColorSpace: "extended-srgb"; + +export const ExtendedSRGBColorSpaceImpl: ColorSpaceDefinition; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/math/ConvexHull.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/math/ConvexHull.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e9a0292708e25049937f4b38dac97d4bb90bb4fe --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/math/ConvexHull.d.ts @@ -0,0 +1,89 @@ +import { Object3D, Ray, Vector3 } from "three"; + +export class Face { + constructor(); + normal: Vector3; + midpoint: Vector3; + area: number; + constant: number; + outside: VertexNode; + mark: number; + edge: HalfEdge; + + static create(a: VertexNode, b: VertexNode, c: VertexNode): Face; + + compute(): this; + getEdge(i: number): HalfEdge; +} + +export class HalfEdge { + constructor(vertex: VertexNode, face: Face); + vertex: VertexNode; + prev: HalfEdge; + next: HalfEdge; + twin: HalfEdge; + face: Face; + + head(): VertexNode; + length(): number; + lengthSquared(): number; + setTwin(edge: HalfEdge): this; + tail(): VertexNode; +} + +export class VertexNode { + constructor(point: Vector3); + point: Vector3; + prev: VertexNode; + next: VertexNode; + face: Face; +} + +export class VertexList { + constructor(); + head: VertexNode; + tail: VertexNode; + + append(vertex: VertexNode): this; + appendChain(vertex: VertexNode): this; + clear(): this; + first(): VertexNode; + insertAfter(target: VertexNode, vertex: VertexNode): this; + insertBefore(target: VertexNode, vertex: VertexNode): this; + isEmpty(): boolean; + last(): VertexNode; + remove(vertex: VertexNode): this; + removeSubList(a: VertexNode, b: VertexNode): this; +} + +export class ConvexHull { + constructor(); + tolerance: number; + faces: Face[]; + newFaces: Face[]; + assigned: VertexList; + unassigned: VertexList; + vertices: VertexNode[]; + + addAdjoiningFace(eyeVertex: VertexNode, horizonEdge: HalfEdge): HalfEdge; + addNewFaces(eyeVertex: VertexNode, horizon: HalfEdge[]): this; + addVertexToFace(vertex: VertexNode, face: Face): this; + addVertexToHull(eyeVertex: VertexNode): this; + cleanup(): this; + compute(): this; + computeExtremes(): object; + computeHorizon(eyePoint: Vector3, crossEdge: HalfEdge, face: Face, horizon: HalfEdge[]): this; + computeInitialHull(): this; + containsPoint(point: Vector3): boolean; + deleteFaceVertices(face: Face, absorbingFace: Face): this; + intersectRay(ray: Ray, target: Vector3): Vector3 | null; + intersectsRay(ray: Ray): boolean; + makeEmpty(): this; + nextVertexToAdd(): VertexNode | undefined; + reindexFaces(): this; + removeAllVerticesFromFace(face: Face): VertexNode | undefined; + removeVertexFromFace(vertex: VertexNode, face: Face): this; + resolveUnassignedPoints(newFaces: Face[]): this; + setFromPoints(points: Vector3[]): this; + setFromObject(object: Object3D): this; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/math/ImprovedNoise.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/math/ImprovedNoise.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ace34300a37e1a714cb29e90a52674c2ac4d7281 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/math/ImprovedNoise.d.ts @@ -0,0 +1,4 @@ +export class ImprovedNoise { + constructor(); + noise(x: number, y: number, z: number): number; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/math/Lut.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/math/Lut.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8f5660f0a4c3dae3d2ef86354e5791a693728ddc --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/math/Lut.d.ts @@ -0,0 +1,27 @@ +import { Color } from "three"; + +export class Lut { + constructor(colormap?: string, numberofcolors?: number); + lut: Color[]; + map: object[]; + n: number; + minV: number; + maxV: number; + + set(value: Lut): this; + setMin(min: number): this; + setMax(max: number): this; + setColorMap(colormap?: string, numberofcolors?: number): this; + copy(lut: Lut): this; + getColor(alpha: number): Color; + addColorMap(colormapName: string, arrayOfColors: number[][]): void; + createCanvas(): HTMLCanvasElement; + updateCanvas(canvas: HTMLCanvasElement): HTMLCanvasElement; +} + +export interface ColorMapKeywords { + rainbow: number[][]; + cooltowarm: number[][]; + blackbody: number[][]; + grayscale: number[][]; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/math/MeshSurfaceSampler.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/math/MeshSurfaceSampler.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..703fb2bc0268646aa176ae469305f3aa1d3c0083 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/math/MeshSurfaceSampler.d.ts @@ -0,0 +1,21 @@ +import { BufferGeometry, Color, Mesh, Vector2, Vector3 } from "three"; + +export class MeshSurfaceSampler { + distribution: Float32Array | null; + geometry: BufferGeometry; + positionAttribute: Float32Array; + weightAttribute: string | null; + + constructor(mesh: Mesh); + binarySearch(x: number): number; + build(): this; + sample(targetPosition: Vector3, targetNormal?: Vector3, targetColor?: Color, targetUV?: Vector2): this; + sampleFace( + faceIndex: number, + targetPosition: Vector3, + targetNormal?: Vector3, + targetColor?: Color, + targetUV?: Vector2, + ): this; + setWeightAttribute(name: string | null): this; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/math/OBB.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/math/OBB.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..885f1cbe9c4f3c824bed02df0640cebdbe7cf0ce --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/math/OBB.d.ts @@ -0,0 +1,24 @@ +import { Box3, Matrix3, Matrix4, Plane, Ray, Sphere, Vector3 } from "three"; + +export class OBB { + center: Vector3; + halfSize: Vector3; + rotation: Matrix3; + + constructor(center?: Vector3, halfSize?: Vector3, rotation?: Matrix3); + set(center: Vector3, halfSize: Vector3, rotation: Matrix3): this; + copy(obb: OBB): this; + clone(): this; + getSize(result: Vector3): Vector3; + clampPoint(point: Vector3, result: Vector3): Vector3; + containsPoint(point: Vector3): boolean; + intersectsBox3(box3: Box3): boolean; + intersectsSphere(sphere: Sphere): boolean; + intersectsOBB(obb: OBB, epsilon?: number): boolean; + intersectsPlane(plane: Plane): boolean; + intersectRay(ray: Ray, result: Vector3): Vector3 | null; + intersectsRay(ray: Ray): boolean; + fromBox3(box3: Box3): this; + equals(obb: OBB): boolean; + applyMatrix4(matrix: Matrix4): this; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/math/Octree.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/math/Octree.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fd81a754a08ded0d98063d5de142131ff4f4878c --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/math/Octree.d.ts @@ -0,0 +1,32 @@ +import { Box3, Layers, Object3D, Ray, Sphere, Triangle } from "three"; + +import { Capsule } from "./Capsule.js"; + +export class Octree { + box: Box3 | null | undefined; + bounds: Box3; + + subTrees: Octree[]; + triangles: Triangle[]; + layers: Layers; + + trianglesPerLeaf: number; + maxLevel: number; + + constructor(box?: Box3 | null); + + addTriangle(triangle: Triangle): this; + calcBox(): this; + split(level: number): this; + build(): this; + getRayTriangles(ray: Ray, triangles: Triangle[]): Triangle[]; + triangleCapsuleIntersect(capsule: Capsule, triangle: Triangle): any; + triangleSphereIntersect(sphere: Sphere, triangle: Triangle): any; + getSphereTriangles(sphere: Sphere, triangles: Triangle[]): Triangle[]; + getCapsuleTriangles(capsule: Capsule, triangles: Triangle[]): Triangle[]; + sphereIntersect(sphere: Sphere): any; + capsuleIntersect(capsule: Capsule): any; + rayIntersect(ray: Ray): any; + fromGraphNode(group: Object3D): this; + clear(): this; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/math/SimplexNoise.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/math/SimplexNoise.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e7dc2b5bd1b90c07b63abe8e8adfc3bba3945698 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/math/SimplexNoise.d.ts @@ -0,0 +1,9 @@ +export class SimplexNoise { + constructor(r?: object); + dot(g: number[], x: number, y: number): number; + dot3(g: number[], x: number, y: number, z: number): number; + dot4(g: number[], x: number, y: number, z: number, w: number): number; + noise(xin: number, yin: number): number; + noise3d(xin: number, yin: number, zin: number): number; + noise4d(x: number, y: number, z: number, w: number): number; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/ConvexObjectBreaker.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/ConvexObjectBreaker.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..241cb15f32e152d03decee14e24e9f364de09ad7 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/ConvexObjectBreaker.d.ts @@ -0,0 +1,25 @@ +import { Object3D, Plane, Vector3 } from "three"; + +export interface CutByPlaneOutput { + object1: Object3D; + object2: Object3D; +} + +export class ConvexObjectBreaker { + constructor(minSizeForBreak?: number, smallDelta?: number); + prepareBreakableObject( + object: Object3D, + mass: number, + velocity: Vector3, + angularVelocity: Vector3, + breakable: boolean, + ): void; + subdivideByImpact( + object: Object3D, + pointOfImpact: Vector3, + normal: Vector3, + maxRadialIterations: number, + maxRandomIterations: number, + ): Object3D[]; + cutByPlane(object: Object3D, plane: Plane, output: CutByPlaneOutput): number; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/GPUComputationRenderer.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/GPUComputationRenderer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..184b3e38bf6a4056112ab7f24a780a714179589f --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/GPUComputationRenderer.d.ts @@ -0,0 +1,55 @@ +import { + DataTexture, + IUniform, + MagnificationTextureFilter, + Material, + MinificationTextureFilter, + ShaderMaterial, + Texture, + TextureDataType, + TextureFilter, + WebGLRenderer, + WebGLRenderTarget, + Wrapping, +} from "three"; + +export interface Variable { + name: string; + initialValueTexture: Texture; + material: ShaderMaterial; + dependencies: Variable[]; + renderTargets: WebGLRenderTarget[]; + wrapS: number; + wrapT: number; + minFilter: number; + magFilter: number; +} + +export class GPUComputationRenderer { + constructor(sizeX: number, sizeY: number, renderer: WebGLRenderer); + + setDataType(type: TextureDataType): void; + + addVariable(variableName: string, computeFragmentShader: string, initialValueTexture: Texture): Variable; + setVariableDependencies(variable: Variable, dependencies: Variable[] | null): void; + + init(): string | null; + compute(): void; + + getCurrentRenderTarget(variable: Variable): WebGLRenderTarget; + getAlternateRenderTarget(variable: Variable): WebGLRenderTarget; + addResolutionDefine(materialShader: ShaderMaterial): void; + createShaderMaterial(computeFragmentShader: string, uniforms?: { [uniform: string]: IUniform }): ShaderMaterial; + createRenderTarget( + sizeXTexture: number, + sizeYTexture: number, + wrapS: Wrapping, + wrapT: number, + minFilter: MinificationTextureFilter, + magFilter: MagnificationTextureFilter, + ): WebGLRenderTarget; + createTexture(): DataTexture; + renderTexture(input: Texture, output: WebGLRenderTarget): void; + doRenderTarget(material: Material, output: WebGLRenderTarget): void; + dispose(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/Gyroscope.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/Gyroscope.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..274b24e3b5b60fcb94e7640c089d2bad95dd3e48 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/Gyroscope.d.ts @@ -0,0 +1,5 @@ +import { Object3D } from "three"; + +export class Gyroscope extends Object3D { + constructor(); +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/MD2Character.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/MD2Character.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f8ad157360db26659f12bed6b715f5daf9481b30 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/MD2Character.d.ts @@ -0,0 +1,33 @@ +import { AnimationMixer, Mesh, Object3D, Texture } from "three"; + +export interface MD2PartsConfig { + baseUrl: string; + body: string; + skins: string[]; + weapons: Array<[string, string]>; +} + +export class MD2Character { + constructor(); + scale: number; + animationFPS: number; + root: Object3D; + meshBody: Mesh | null; + meshWeapon: Mesh | null; + skinsBody: Texture[]; + skinsWeapon: Texture[]; + weapons: Mesh[]; + activeAnimation: string | null; + mixer: AnimationMixer | null; + loadCounter: number; + + onLoadComplete(): void; + loadParts(config: MD2PartsConfig): void; + setPlaybackRate(rate: number): void; + setWireframe(wireframeEnabled: boolean): void; + setSkin(index: number): void; + setWeapon(index: number): void; + setAnimation(clipName: string): void; + syncWeaponAnimation(): void; + update(delta: number): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/MD2CharacterComplex.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/MD2CharacterComplex.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..418175bb690617e4af5037e8d5e8e00686ac60a9 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/MD2CharacterComplex.d.ts @@ -0,0 +1,55 @@ +import { Mesh, Object3D, Texture } from "three"; + +export class MD2CharacterComplex { + constructor(); + scale: number; + animationFPS: number; + transitionFrames: number; + maxSpeed: number; + maxReverseSpeed: number; + frontAcceleration: number; + backAcceleration: number; + frontDeceleration: number; + angularSpeed: number; + root: Object3D; + meshBody: Mesh | null; + meshWeapon: Mesh | null; + controls: { + crouch?: boolean | undefined; + jump?: boolean | undefined; + attack?: boolean | undefined; + moveForward?: boolean | undefined; + moveBackward?: boolean | undefined; + moveLeft?: boolean | undefined; + moveRight?: boolean | undefined; + } | null; + skinsBody: Texture[]; + skinsWeapon: Texture[]; + weapons: Mesh[]; + currentSkin: number; + onLoadComplete: () => void; + + meshes: Mesh[]; + animations: object[]; + loadCounter: number; + speed: number; + bodyOrientation: number; + walkSpeed: number; + crouchSpeed: number; + activeAnimation: string; + oldAnimation: string; + + enableShadows(enable: boolean): void; + setVisible(enable: boolean): void; + shareParts(original: MD2CharacterComplex): void; + loadParts(config: object): void; + setPlaybackRate(rate: number): void; + setWireframe(wireframeEnabled: boolean): void; + setSkin(index: number): void; + setWeapon(index: number): void; + setAnimation(animationName: string): void; + update(delta: number): void; + updateAnimations(delta: number): void; + updateBehaviors(): void; + updateMovementModel(delta: number): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/MorphAnimMesh.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/MorphAnimMesh.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e4910785a3647f154b45875f7f63ea53f168f72e --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/MorphAnimMesh.d.ts @@ -0,0 +1,13 @@ +import { AnimationAction, AnimationMixer, BufferGeometry, Material, Mesh } from "three"; + +export class MorphAnimMesh extends Mesh { + constructor(geometry: BufferGeometry, material: Material); + mixer: AnimationMixer; + activeAction: AnimationAction | null; + + setDirectionForward(): void; + setDirectionBackward(): void; + playAnimation(label: string, fps: number): void; + updateAnimation(delta: number): void; + copy(source: MorphAnimMesh, recursive?: boolean): this; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/MorphBlendMesh.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/MorphBlendMesh.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fa0dd3a170c191694ed2c7a70bfd9ea93243844f --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/MorphBlendMesh.d.ts @@ -0,0 +1,21 @@ +import { BufferGeometry, Material, Mesh } from "three"; + +export class MorphBlendMesh extends Mesh { + constructor(geometry: BufferGeometry, material: Material); + animationsMap: object; + animationsList: object[]; + + createAnimation(name: string, start: number, end: number, fps: number): void; + autoCreateAnimations(fps: number): void; + setAnimationDirectionForward(name: string): void; + setAnimationDirectionBackward(name: string): void; + setAnimationFPS(name: string, fps: number): void; + setAnimationDuration(name: string, duration: number): void; + setAnimationWeight(name: string, weight: number): void; + setAnimationTime(name: string, time: number): void; + getAnimationTime(name: string): number; + getAnimationDuration(name: string): number; + playAnimation(name: string): void; + stopAnimation(name: string): void; + update(delta: number): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/ProgressiveLightMap.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/ProgressiveLightMap.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..752ddff52a2a300d7f4c38660176443279a6a1e1 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/ProgressiveLightMap.d.ts @@ -0,0 +1,58 @@ +import { + Camera, + Material, + Mesh, + MeshBasicMaterial, + MeshPhongMaterial, + Object3D, + PlaneGeometry, + Scene, + Texture, + Vector3, + WebGLRenderer, + WebGLRenderTarget, +} from "three"; + +export interface UVBoxes { + w: number; + h: number; + index: number; +} + +export interface LightMapContainers { + basicMat: Material | Material[]; + object: Object3D; +} + +declare class ProgressiveLightMap { + renderer: WebGLRenderer; + res: number; + lightMapContainers: LightMapContainers[]; + scene: Scene; + buffer1Active: boolean; + firstUpdate: boolean; + warned: boolean; + labelMesh: Mesh | null; + blurringPlane: Mesh | null; + + progressiveLightMap1: WebGLRenderTarget; + progressiveLightMap2: WebGLRenderTarget; + + uvMat: MeshPhongMaterial; + + uv_boxes?: UVBoxes[]; + + constructor(renderer: WebGLRenderer, res?: number); + + addObjectsToLightMap(objects: Object3D[]): void; + + update(camera: Camera, blendWindow?: number, blurEdges?: boolean): void; + + showDebugLightmap(visible: boolean, position?: Vector3): void; + + private _initializeBlurPlane(res: number, lightMap?: Texture | null): void; + + dispose(): void; +} + +export { ProgressiveLightMap }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/ProgressiveLightMapGPU.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/ProgressiveLightMapGPU.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9e9abebffb4c372e1119ae8052a79357c8bdd42b --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/ProgressiveLightMapGPU.d.ts @@ -0,0 +1,27 @@ +import { Camera, Material, Object3D, Vector3, WebGPURenderer } from "three/webgpu"; + +export interface UVBoxes { + w: number; + h: number; + index: number; +} + +export interface LightMapContainers { + basicMat: Material | Material[]; + object: Object3D; +} + +declare class ProgressiveLightMap { + renderer: WebGPURenderer; + resolution: number; + + constructor(renderer: WebGPURenderer, resolution?: number); + + addObjectsToLightMap(objects: Object3D[]): void; + + update(camera: Camera, blendWindow?: number, blurEdges?: boolean): void; + + showDebugLightmap(visible: boolean, position?: Vector3 | null): void; +} + +export { ProgressiveLightMap }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/RollerCoaster.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/RollerCoaster.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..67c8fc97f94e1ee59a9758aeb421871672577dd2 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/RollerCoaster.d.ts @@ -0,0 +1,26 @@ +import { BufferGeometry, Mesh, Vector3 } from "three"; + +interface Curve { + getPointAt(u: number): Vector3; + getTangentAt(u: number): Vector3; +} + +export class RollerCoasterGeometry extends BufferGeometry { + constructor(curve: Curve, divisions: number); +} + +export class RollerCoasterLiftersGeometry extends BufferGeometry { + constructor(curve: Curve, divisions: number); +} + +export class RollerCoasterShadowGeometry extends BufferGeometry { + constructor(curve: Curve, divisions: number); +} + +export class SkyGeometry extends BufferGeometry { + constructor(); +} + +export class TreesGeometry extends BufferGeometry { + constructor(landscape: Mesh); +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/TubePainter.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/TubePainter.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5867f0ce4005b1c98253aa61631a486912633052 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/TubePainter.d.ts @@ -0,0 +1,10 @@ +import { Matrix4, Mesh, Vector3 } from "three"; + +export class TubePainter { + constructor(); + + mesh: Mesh; + + stroke(position1: Vector3, position2: Vector3, matrix1: Matrix4, matrix2: Matrix4): void; + updateGeometry(start: number, end: number): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/Volume.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/Volume.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..700b82edcb29e13e5a839d5c1e38d727546f009a --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/Volume.d.ts @@ -0,0 +1,37 @@ +import { Matrix3, TypedArray } from "three"; + +import { VolumeSlice } from "./VolumeSlice.js"; + +export class Volume { + constructor(xLength?: number, yLength?: number, zLength?: number, type?: string, arrayBuffer?: ArrayLike); + + xLength: number; + yLength: number; + zLength: number; + + axisOrder: Array<"x" | "y" | "z">; + + data: TypedArray; + + spacing: number[]; + offset: number[]; + + matrix: Matrix3; + + lowerThreshold: number; + upperThreshold: number; + + sliceList: VolumeSlice[]; + + getData(i: number, j: number, k: number): number; + access(i: number, j: number, k: number): number; + reverseAccess(index: number): number[]; + + map(functionToMap: () => void, context: this): this; + + extractPerpendicularPlane(axis: string, RASIndex: number): object; + extractSlice(axis: string, index: number): VolumeSlice; + + repaintAllSlices(): this; + computeMinMax(): number[]; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/VolumeSlice.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/VolumeSlice.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9900f7de9e142722297d4cc8c7439056d813742b --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/misc/VolumeSlice.d.ts @@ -0,0 +1,28 @@ +import { Matrix3, Mesh } from "three"; + +import { Volume } from "./Volume.js"; + +export class VolumeSlice { + constructor(volume: Volume, index?: number, axis?: string); + + index: number; + axis: string; + + canvas: HTMLCanvasElement; + canvasBuffer: HTMLCanvasElement; + + ctx: CanvasRenderingContext2D; + ctxBuffer: CanvasRenderingContext2D; + + mesh: Mesh; + + geometryNeedsUpdate: boolean; + + sliceAccess: number; + jLength: number; + iLength: number; + matrix: Matrix3; + + repaint(): void; + updateGeometry(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/modifiers/CurveModifier.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/modifiers/CurveModifier.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4f0b14072ab19657772e5bae42ff375c5efe6bdd --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/modifiers/CurveModifier.d.ts @@ -0,0 +1,41 @@ +import { BufferGeometry, Curve, DataTexture, InstancedMesh, IUniform, Material, Mesh, Vector3 } from "three"; + +export interface SplineUniform { + spineTexture: IUniform; + pathOffset: IUniform; + pathSegment: IUniform; + spineOffset: IUniform; + flow: IUniform; +} +export function initSplineTexture(numberOfCurves?: number): DataTexture; + +export function updateSplineTexture(texture: DataTexture, splineCurve: Curve, offset?: number): void; + +export function getUniforms(splineTexture: DataTexture): SplineUniform; + +export function modifyShader(material: Material, uniforms: SplineUniform, numberOfCurves?: number): void; + +export class Flow { + curveArray: number[]; + curveLengthArray: number[]; + + object3D: Mesh; + splineTexture: DataTexture; + uniforms: SplineUniform; + + constructor(mesh: Mesh, numberOfCurves?: number); + updateCurve(index: number, curve: Curve): void; + moveAlongCurve(amount: number): void; +} + +export class InstancedFlow extends Flow { + object3D: InstancedMesh; + + offsets: number[]; + whichCurve: number[]; + + constructor(count: number, curveCount: number, geometry: BufferGeometry, material: Material); + + moveIndividualAlongCurve(index: number, offset: number): void; + setCurve(index: number, curveNo: number): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/modifiers/CurveModifierGPU.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/modifiers/CurveModifierGPU.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..222098ec3f24dd895f4ed696c026070e5c9dfaeb --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/modifiers/CurveModifierGPU.d.ts @@ -0,0 +1,31 @@ +import { BufferGeometry, Curve, DataTexture, InstancedMesh, IUniform, Material, Mesh, Vector3 } from "three"; + +export interface SplineUniform { + spineTexture: DataTexture; + pathOffset: number; + pathSegment: number; + spineOffset: number; + spineLength: number; + flow: number; +} +export function initSplineTexture(numberOfCurves?: number): DataTexture; + +export function updateSplineTexture(texture: DataTexture, splineCurve: Curve, offset?: number): void; + +export function getUniforms(splineTexture: DataTexture): SplineUniform; + +export function modifyShader(material: Material, uniforms: SplineUniform, numberOfCurves: number): void; + +export class Flow { + curveArray: number[]; + curveLengthArray: number[]; + + object3D: Mesh; + splineTexture: DataTexture; + uniforms: SplineUniform; + + constructor(mesh: Mesh, numberOfCurves?: number); + + updateCurve(index: number, curve: Curve): void; + moveAlongCurve(amount: number): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/modifiers/EdgeSplitModifier.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/modifiers/EdgeSplitModifier.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c5b5f4ed9023890043d6a05fbfea32616727b5fe --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/modifiers/EdgeSplitModifier.d.ts @@ -0,0 +1,26 @@ +import { BufferGeometry } from "three"; + +/** + * {@link EdgeSplitModifier} is intended to modify the geometry "dissolving" the edges to give a smoother look. + * + * @example + * const geometry = new THREE.IcosahedronGeometry( 10, 3 ); + * const modifier = new EdgeSplitModifier(); + * const cutOffAngle = 0.5; + * const tryKeepNormals = false; + * + * modifier.modify( geometry, cutOffAngle, tryKeepNormals ); + */ +export class EdgeSplitModifier { + /** + * Create a new {@link EdgeSplitModifier} object. + */ + constructor(); + + /** + * Using interpolated vertex normals, the mesh faces will blur at the edges and appear smooth. + * You can control the smoothness by setting the `cutOffAngle`. + * To try to keep the original normals, set `tryKeepNormals` to `true`. + */ + modify(geometry: BufferGeometry, cutOffPoint: number, tryKeepNormals: boolean): BufferGeometry; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/modifiers/SimplifyModifier.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/modifiers/SimplifyModifier.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..53d13bf1194c1c6e77493244c02eeb79db349944 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/modifiers/SimplifyModifier.d.ts @@ -0,0 +1,6 @@ +import { BufferGeometry } from "three"; + +export class SimplifyModifier { + constructor(); + modify(geometry: BufferGeometry, count: number): BufferGeometry; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/modifiers/TessellateModifier.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/modifiers/TessellateModifier.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a13c97eb67fcca66351c4cfa93b096d7c4ef3635 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/modifiers/TessellateModifier.d.ts @@ -0,0 +1,9 @@ +import { BufferGeometry } from "three"; + +export class TessellateModifier { + constructor(maxEdgeLength?: number, maxIterations?: number); + maxEdgeLength: number; + maxIterations: number; + + modify(geometry: TGeometry): TGeometry; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/GroundedSkybox.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/GroundedSkybox.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0fe38a299b6b86d4f2d50690d7b44e14e08f6efd --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/GroundedSkybox.d.ts @@ -0,0 +1,5 @@ +import { Mesh, MeshBasicMaterial, SphereGeometry, Texture } from "three"; + +export class GroundedSkybox extends Mesh { + constructor(map: Texture, height: number, radius: number, resolution?: number); +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/Lensflare.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/Lensflare.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c67330761f91f27965e089dcf0d9cf410d5041cd --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/Lensflare.d.ts @@ -0,0 +1,21 @@ +import { Color, Mesh, Texture } from "three"; + +declare class Lensflare extends Mesh { + readonly isLensflare: true; + + constructor(); + + addElement: (element: LensflareElement) => void; + dispose: () => void; +} + +declare class LensflareElement { + texture: Texture; + size: number; + distance: number; + color: Color; + + constructor(texture: Texture, size?: number, distance?: number, color?: Color); +} + +export { Lensflare, LensflareElement }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/LensflareMesh.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/LensflareMesh.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5ccc2b486e83fe900c1a043bb5489f76e0bea5fc --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/LensflareMesh.d.ts @@ -0,0 +1,21 @@ +import { Color, Mesh, Texture } from "three"; + +declare class LensflareMesh extends Mesh { + readonly isLensflare: true; + + constructor(); + + addElement: (element: LensflareElement) => void; + dispose: () => void; +} + +declare class LensflareElement { + texture: Texture; + size: number; + distance: number; + color: Color; + + constructor(texture: Texture, size?: number, distance?: number, color?: Color); +} + +export { LensflareElement, LensflareMesh }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/MarchingCubes.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/MarchingCubes.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f34ad9ac80a6a9f3d21529514c0db293c8439db9 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/MarchingCubes.d.ts @@ -0,0 +1,76 @@ +import { BufferGeometry, Color, Material, Mesh } from "three"; + +export class MarchingCubes extends Mesh { + constructor( + resolution: number, + material: Material, + enableUvs?: boolean, + enableColors?: boolean, + maxPolyCount?: number, + ); + + enableUvs: boolean; + enableColors: boolean; + + resolution: number; + + // parameters + + isolation: number; + + // size of field, 32 is pushing it in Javascript :) + + size: number; + size2: number; + size3: number; + halfsize: number; + + // deltas + + delta: number; + yd: number; + zd: number; + + field: Float32Array; + normal_cache: Float32Array; + palette: Float32Array; + + maxCount: number; + count: number; + + hasPositions: boolean; + hasNormals: boolean; + hasColors: boolean; + hasUvs: boolean; + + positionArray: Float32Array; + normalArray: Float32Array; + + uvArray: Float32Array; + colorArray: Float32Array; + + begin(): void; + end(): void; + + init(resolution: number): void; + + addBall(ballx: number, bally: number, ballz: number, strength: number, subtract: number, colors?: Color): void; + + addPlaneX(strength: number, subtract: number): void; + addPlaneY(strength: number, subtract: number): void; + addPlaneZ(strength: number, subtract: number): void; + + setCell(x: number, y: number, z: number, value: number): void; + getCell(x: number, y: number, z: number): number; + + blur(intensity: number): void; + + reset(): void; + update(): void; + render(renderCallback: any): void; + generateGeometry(): BufferGeometry; + generateBufferGeometry(): BufferGeometry; +} + +export const edgeTable: Int32Array[]; +export const triTable: Int32Array[]; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/Reflector.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/Reflector.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3bb9bd4a0dd4dfced96a7bf555ad750cb1c2675d --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/Reflector.d.ts @@ -0,0 +1,22 @@ +import { BufferGeometry, ColorRepresentation, Mesh, PerspectiveCamera, WebGLRenderTarget } from "three"; + +export interface ReflectorOptions { + color?: ColorRepresentation | undefined; + textureWidth?: number | undefined; + textureHeight?: number | undefined; + clipBias?: number | undefined; + shader?: object | undefined; + multisample?: number | undefined; +} + +export class Reflector extends Mesh { + type: "Reflector"; + forceUpdate: boolean; + camera: PerspectiveCamera; + + constructor(geometry?: BufferGeometry, options?: ReflectorOptions); + + getRenderTarget(): WebGLRenderTarget; + + dispose(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/ReflectorForSSRPass.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/ReflectorForSSRPass.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..13b65b8c4b653a1ed0b57a7177152806785baf15 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/ReflectorForSSRPass.d.ts @@ -0,0 +1,62 @@ +import { + BufferGeometry, + Camera, + Color, + IUniform, + Mesh, + Scene, + ShaderMaterial, + Vector2, + WebGLRenderer, + WebGLRenderTarget, +} from "three"; + +export interface ReflectorShader { + name: string; + defines: { + DISTANCE_ATTENUATION: boolean; + FRESNEL: boolean; + }; + uniforms: { + [key: string]: IUniform; + }; + vertexShader: string; + fragmentShader: string; +} + +export interface ReflectorForSSRPassOptions { + clipBias?: number | undefined; + textureWidth?: number | undefined; + textureHeight?: number | undefined; + color?: number | undefined; + useDepthTexture?: boolean | undefined; + shader?: ReflectorShader | undefined; +} + +export class ReflectorForSSRPass extends Mesh { + type: "ReflectorForSSRPass"; + options: ReflectorForSSRPassOptions; + + static ReflectorShader: ReflectorShader; + + needsUpdate: boolean; + maxDistance: number; + opacity: number; + color: Color; + resolution: Vector2; + + get distanceAttenuation(): boolean; + set distanceAttenuation(val: boolean); + get fresnel(): boolean; + set fresnel(val: boolean); + + material: ShaderMaterial; + + renderTarget: WebGLRenderTarget; + + constructor(geometry: TGeometry, options: ReflectorForSSRPassOptions); + + doRender: (renderer: WebGLRenderer, scene: Scene, camera: Camera) => void; + + getRenderTarget: () => WebGLRenderTarget; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/Refractor.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/Refractor.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..64cbe1cbb829831073920c5652e2f987ff0c1ae5 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/Refractor.d.ts @@ -0,0 +1,21 @@ +import { BufferGeometry, ColorRepresentation, Mesh, PerspectiveCamera, ShaderMaterial, WebGLRenderTarget } from "three"; + +export interface RefractorOptions { + color?: ColorRepresentation | undefined; + textureWidth?: number | undefined; + textureHeight?: number | undefined; + clipBias?: number | undefined; + shader?: object | undefined; + multisample?: number | undefined; +} + +export class Refractor extends Mesh { + type: "Refractor"; + camera: PerspectiveCamera; + + constructor(geometry?: BufferGeometry, options?: RefractorOptions); + + getRenderTarget(): WebGLRenderTarget; + + dispose(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/ShadowMesh.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/ShadowMesh.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..639a80cf4bc43f31a9ad28a278fde8319ea23bf1 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/ShadowMesh.d.ts @@ -0,0 +1,10 @@ +import { BufferGeometry, Matrix4, Mesh, MeshBasicMaterial, Plane, Vector4 } from "three"; + +export class ShadowMesh extends Mesh { + readonly isShadowMesh: true; + meshMatrix: Matrix4; + + constructor(mesh: Mesh); + + update(plane: Plane, lightPosition4D: Vector4): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/Sky.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/Sky.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d4ae62a1dc565068dd8b515c9a51e42babd482c5 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/Sky.d.ts @@ -0,0 +1,28 @@ +import { BoxGeometry, Mesh, ShaderMaterial } from "three"; + +/** + * {@link Sky} creates a ready to go sky environment for your scenes. + * + * @example + * const sky = new Sky(); + * sky.scale.setScalar( 450000 ); + * + * const phi = MathUtils.degToRad( 90 ); + * const theta = MathUtils.degToRad( 180 ); + * const sunPosition = new Vector3().setFromSphericalCoords( 1, phi, theta ); + * + * sky.material.uniforms.sunPosition.value = sunPosition; + * + * scene.add( sky ); + */ +export class Sky extends Mesh { + /** + * Create a new {@link Sky} instance. + */ + constructor(); + + geometry: BoxGeometry; + material: ShaderMaterial; + + static SkyShader: object; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/SkyMesh.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/SkyMesh.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1fb14111694d7cc09af812edbd6992c4b837561f --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/SkyMesh.d.ts @@ -0,0 +1,17 @@ +import { ShaderNodeObject } from "three/tsl"; +import { BoxGeometry, Mesh, NodeMaterial, UniformNode, Vector3 } from "three/webgpu"; + +declare class SkyMesh extends Mesh { + turbidity: ShaderNodeObject>; + rayleigh: ShaderNodeObject>; + mieCoefficient: ShaderNodeObject>; + mieDirectionalG: ShaderNodeObject>; + sunPosition: ShaderNodeObject>; + upUniform: ShaderNodeObject>; + + readonly isSky: true; + + constructor(); +} + +export { SkyMesh }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/Water.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/Water.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cef6e3711ade17eb40ce6b8b7651cc6b944da727 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/Water.d.ts @@ -0,0 +1,22 @@ +import { BufferGeometry, ColorRepresentation, Mesh, ShaderMaterial, Side, Texture, Vector3 } from "three"; + +export interface WaterOptions { + textureWidth?: number; + textureHeight?: number; + clipBias?: number; + alpha?: number; + time?: number; + waterNormals?: Texture; + sunDirection?: Vector3; + sunColor?: ColorRepresentation; + waterColor?: ColorRepresentation; + eye?: Vector3; + distortionScale?: number; + side?: Side; + fog?: boolean; +} + +export class Water extends Mesh { + material: ShaderMaterial; + constructor(geometry: BufferGeometry, options: WaterOptions); +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/Water2.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/Water2.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e09d314dd07567da3474bc87a043ba7b596a84e3 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/Water2.d.ts @@ -0,0 +1,21 @@ +import { BufferGeometry, ColorRepresentation, Mesh, ShaderMaterial, Texture, Vector2 } from "three"; + +export interface WaterOptions { + color?: ColorRepresentation | undefined; + textureWidth?: number | undefined; + textureHeight?: number | undefined; + clipBias?: number | undefined; + flowDirection?: Vector2 | undefined; + flowSpeed?: number | undefined; + reflectivity?: number | undefined; + scale?: number | undefined; + shader?: object | undefined; + flowMap?: Texture | undefined; + normalMap0?: Texture | undefined; + normalMap1?: Texture | undefined; +} + +export class Water extends Mesh { + material: ShaderMaterial; + constructor(geometry: BufferGeometry, options: WaterOptions); +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/Water2Mesh.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/Water2Mesh.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5ed9cf4002d2ba4be0ce53e1716d6482587a6230 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/Water2Mesh.d.ts @@ -0,0 +1,53 @@ +import { + BufferGeometry, + Color, + ColorRepresentation, + Mesh, + NodeMaterial, + TempNode, + Texture, + TextureNode, + UniformNode, + Vector2, + Vector3, +} from "three/webgpu"; + +export interface WaterMeshOptions { + normalMap0: Texture; + normalMap1: Texture; + flowMap?: Texture | null | undefined; + + color?: ColorRepresentation | undefined; + flowDirection?: Vector2 | undefined; + flowSpeed?: number | undefined; + reflectivity?: number | undefined; + scale?: number | undefined; +} + +declare class WaterMesh extends Mesh { + readonly isWater: true; + + constructor(geometry: BufferGeometry, options: WaterMeshOptions); +} + +declare class WaterNode extends TempNode { + waterBody: WaterMesh; + + normalMap0: TextureNode; + normalMap1: TextureNode; + flowMap: TextureNode; + + color: UniformNode; + flowDirection: UniformNode; + flowSpeed: UniformNode; + reflectivity: UniformNode; + scale: UniformNode; + flowConfig: UniformNode; + + constructor(options: WaterMeshOptions, waterBody: WaterMesh); + + updateFlow(delta: number): void; +} + +export { WaterMesh }; +export type { WaterNode }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/WaterMesh.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/WaterMesh.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..db0c76d62d204178a5fa42f8e3326c9190b878d7 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/objects/WaterMesh.d.ts @@ -0,0 +1,40 @@ +import { + BufferGeometry, + Color, + ColorRepresentation, + Mesh, + NodeMaterial, + Texture, + TextureNode, + UniformNode, + Vector3, +} from "three/webgpu"; + +export interface WaterMeshOptions { + resolution?: number | undefined; + waterNormals: Texture; + alpha?: number | undefined; + size?: number | undefined; + sunColor?: ColorRepresentation | undefined; + sunDirection?: Vector3 | undefined; + waterColor?: ColorRepresentation | undefined; + distortionScale?: number | undefined; +} + +declare class WaterMesh extends Mesh { + readonly isWater: true; + + resolution: number; + + waterNormals: TextureNode; + alpha: UniformNode; + size: UniformNode; + sunColor: UniformNode; + sunDirection: UniformNode; + waterColor: UniformNode; + distortionScale: UniformNode; + + constructor(geometry: BufferGeometry, options: WaterMeshOptions); +} + +export { WaterMesh }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/physics/AmmoPhysics.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/physics/AmmoPhysics.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..821246a5fcbdc33f605f2ce987f0253f1a3109f0 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/physics/AmmoPhysics.d.ts @@ -0,0 +1,9 @@ +import { Mesh, Object3D, Vector3 } from "three"; + +export interface AmmoPhysicsObject { + addScene: (scene: Object3D) => void; + addMesh: (mesh: Mesh, mass?: number) => void; + setMeshPosition: (mesh: Mesh, position: Vector3, index?: number) => void; +} + +export function AmmoPhysics(): Promise; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/physics/JoltPhysics.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/physics/JoltPhysics.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bfbd0a4364774cc4438743e8c54de8e7f3c7e79b --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/physics/JoltPhysics.d.ts @@ -0,0 +1,10 @@ +import { Mesh, Object3D, Vector3Like } from "three"; + +export interface JoltPhysicsObject { + addScene: (scene: Object3D) => void; + addMesh: (mesh: Mesh, mass?: number, restitution?: number) => void; + setMeshPosition: (mesh: Mesh, position: Vector3Like, index?: number) => void; + setMeshVelocity: (mesh: Mesh, velocity: Vector3Like, index?: number) => void; +} + +export function JoltPhysics(): Promise; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/physics/RapierPhysics.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/physics/RapierPhysics.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..76cfb4676b91b5456fe950070ac2c00e624df913 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/physics/RapierPhysics.d.ts @@ -0,0 +1,25 @@ +import * as RAPIER from "@dimforge/rapier3d-compat"; +import { Mesh, Object3D } from "three"; + +type Vector = { x: number; y: number; z: number }; + +export interface RapierPhysicsObject { + RAPIER: typeof RAPIER; + world: RAPIER.World; + addScene: (scene: Object3D) => void; + addMesh: (mesh: Mesh, mass?: number, restitution?: number) => void; + removeMesh: (mesh: Mesh) => void; + setMeshPosition: (mesh: Mesh, position: Vector, index?: number) => void; + setMeshVelocity: (mesh: Mesh, velocity: Vector, index?: number) => void; + addHeightfield: ( + mesh: Mesh, + width: number, + depth: number, + heights: Float32Array, + scale: Vector, + ) => RAPIER.RigidBody; +} + +export function RapierPhysics(): Promise; + +export type RAPIER = typeof RAPIER; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/AfterimagePass.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/AfterimagePass.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..263e2c2e48276dc7139b88985f5aec8154a2f7d6 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/AfterimagePass.d.ts @@ -0,0 +1,17 @@ +import { IUniform, ShaderMaterial } from "three"; + +import { Pass } from "./Pass.js"; + +declare class AfterimagePass extends Pass { + uniforms: Record; + + compFsMaterial: ShaderMaterial; + copyFsMaterial: ShaderMaterial; + + constructor(damp?: number); + + get damp(): number; + set damp(value: number); +} + +export { AfterimagePass }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/BloomPass.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/BloomPass.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1725758208686cb04c158b78a2b75458b0327c94 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/BloomPass.d.ts @@ -0,0 +1,14 @@ +import { ShaderMaterial, WebGLRenderTarget } from "three"; + +import { FullScreenQuad, Pass } from "./Pass.js"; + +export class BloomPass extends Pass { + constructor(strength?: number, kernelSize?: number, sigma?: number); + renderTargetX: WebGLRenderTarget; + renderTargetY: WebGLRenderTarget; + copyUniforms: object; + materialCopy: ShaderMaterial; + convolutionUniforms: object; + materialConvolution: ShaderMaterial; + fsQuad: FullScreenQuad; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/BokehPass.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/BokehPass.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c3c5f15bf3861fa561e72506384c235894cc2902 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/BokehPass.d.ts @@ -0,0 +1,23 @@ +import { Camera, Color, MeshDepthMaterial, Scene, ShaderMaterial, WebGLRenderTarget } from "three"; + +import { FullScreenQuad, Pass } from "./Pass.js"; + +export interface BokehPassParameters { + focus?: number; + aspect?: number; + aperture?: number; + maxblur?: number; +} + +export class BokehPass extends Pass { + constructor(scene: Scene, camera: Camera, params: BokehPassParameters); + scene: Scene; + camera: Camera; + renderTargetColor: WebGLRenderTarget; + renderTargetDepth: WebGLRenderTarget; + materialDepth: MeshDepthMaterial; + materialBokeh: ShaderMaterial; + uniforms: object; + fsQuad: FullScreenQuad; + oldClearColor: Color; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/ClearPass.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/ClearPass.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e05636bbe7d9134614e5c123172b17b43b80626c --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/ClearPass.d.ts @@ -0,0 +1,9 @@ +import { ColorRepresentation } from "three"; + +import { FullScreenQuad, Pass } from "./Pass.js"; + +export class ClearPass extends Pass { + constructor(clearColor?: ColorRepresentation, clearAlpha?: number); + clearColor: ColorRepresentation; + clearAlpha: number; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/CubeTexturePass.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/CubeTexturePass.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..090400da98a06f1226dbfdde24dc984e5000211f --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/CubeTexturePass.d.ts @@ -0,0 +1,14 @@ +import { CubeTexture, Mesh, PerspectiveCamera, Scene } from "three"; + +import { FullScreenQuad, Pass } from "./Pass.js"; + +export class CubeTexturePass extends Pass { + constructor(camera: PerspectiveCamera, envMap?: CubeTexture, opacity?: number); + camera: PerspectiveCamera; + cubeShader: object; + cubeMesh: Mesh; + envMap: CubeTexture; + opacity: number; + cubeScene: Scene; + cubeCamera: PerspectiveCamera; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/DotScreenPass.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/DotScreenPass.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b4f0b8d865d38eb71d7287bd1b100f8654fb53fb --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/DotScreenPass.d.ts @@ -0,0 +1,10 @@ +import { ShaderMaterial, Vector2 } from "three"; + +import { FullScreenQuad, Pass } from "./Pass.js"; + +export class DotScreenPass extends Pass { + constructor(center?: Vector2, angle?: number, scale?: number); + uniforms: object; + material: ShaderMaterial; + fsQuad: FullScreenQuad; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/EffectComposer.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/EffectComposer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ae300491a0c6bbb47a4415cb4726857766248e6c --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/EffectComposer.d.ts @@ -0,0 +1,31 @@ +import { Clock, WebGLRenderer, WebGLRenderTarget } from "three"; + +import { FullScreenQuad, Pass } from "./Pass.js"; +import { ShaderPass } from "./ShaderPass.js"; + +export { FullScreenQuad } from "./Pass.js"; +export { Pass }; + +export class EffectComposer { + constructor(renderer: WebGLRenderer, renderTarget?: WebGLRenderTarget); + renderer: WebGLRenderer; + renderTarget1: WebGLRenderTarget; + renderTarget2: WebGLRenderTarget; + writeBuffer: WebGLRenderTarget; + readBuffer: WebGLRenderTarget; + passes: Pass[]; + copyPass: ShaderPass; + clock: Clock; + renderToScreen: boolean; + + swapBuffers(): void; + addPass(pass: Pass): void; + insertPass(pass: Pass, index: number): void; + removePass(pass: Pass): void; + isLastEnabledPass(passIndex: number): boolean; + render(deltaTime?: number): void; + reset(renderTarget?: WebGLRenderTarget): void; + setSize(width: number, height: number): void; + setPixelRatio(pixelRatio: number): void; + dispose(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/FXAAPass.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/FXAAPass.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c09f93f9d6288592aade04ada968601a325e4fbf --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/FXAAPass.d.ts @@ -0,0 +1,7 @@ +import { ShaderPass } from "./ShaderPass.js"; + +declare class FXAAPass extends ShaderPass { + constructor(); +} + +export { FXAAPass }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/FilmPass.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/FilmPass.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1011520b764de43d194db46e9d4300f01f3da923 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/FilmPass.d.ts @@ -0,0 +1,10 @@ +import { ShaderMaterial } from "three"; + +import { FullScreenQuad, Pass } from "./Pass.js"; + +export class FilmPass extends Pass { + constructor(intensity?: number, grayscale?: boolean); + uniforms: object; + material: ShaderMaterial; + fsQuad: FullScreenQuad; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/GTAOPass.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/GTAOPass.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d2e209b68c15cafc0bb8285f80b3920fd3fed375 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/GTAOPass.d.ts @@ -0,0 +1,121 @@ +import { + Box3, + Camera, + Color, + ColorRepresentation, + DataTexture, + DepthTexture, + MeshNormalMaterial, + Scene, + ShaderMaterial, + Texture, + WebGLRenderer, + WebGLRenderTarget, +} from "three"; + +import { FullScreenQuad, Pass } from "./Pass.js"; + +export class GTAOPass extends Pass { + width: number; + height: number; + clear: boolean; + camera: Camera; + scene: Scene; + output: number; + blendIntensity: number; + + pdRings: number; + pdRadiusExponent: number; + pdSamples: number; + + gtaoNoiseTexture: DataTexture; + pdNoiseTexture: DataTexture; + + gtaoRenderTarget: WebGLRenderTarget; + pdRenderTarget: WebGLRenderTarget; + + gtaoMaterial: ShaderMaterial; + + normalMaterial: MeshNormalMaterial; + + pdMaterial: ShaderMaterial; + + depthRenderMaterial: ShaderMaterial; + + copyMaterial: ShaderMaterial; + + blendMaterial: ShaderMaterial; + + fsQuad: FullScreenQuad; + + originalClearColor: Color; + + depthTexture: DepthTexture; + normalTexture: Texture; + + constructor( + scene: Scene, + camera: Camera, + width?: number | undefined, + height?: number | undefined, + parameters?: { depthTexture?: DepthTexture | undefined; normalTexture?: Texture | undefined } | undefined, + ); + + get gtaoMap(): Texture; + + setGBuffer(depthTexture?: DepthTexture | undefined, normalTexture?: Texture | undefined): void; + + setSceneClipBox(box: Box3): void; + + updateGtaoMaterial(parameters: { + radius?: number | undefined; + distanceExponent?: number | undefined; + thickness?: number | undefined; + distanceFallOff?: number | undefined; + scale?: number | undefined; + samples?: number | undefined; + screenSpaceRadius?: boolean | undefined; + }): void; + + updatePdMaterial(parameters: { + lumaPhi?: number | undefined; + depthPhi?: number | undefined; + normalPhi?: number | undefined; + radius?: number | undefined; + radiusExponent?: number | undefined; + rings?: number | undefined; + samples?: number | undefined; + }): void; + + renderPass( + renderer: WebGLRenderer, + passMaterial: ShaderMaterial, + renderTarget: WebGLRenderTarget | null, + clearColor?: ColorRepresentation | undefined, + clearAlpha?: number | undefined, + ): void; + + renderOverride( + renderer: WebGLRenderer, + overrideMaterial: MeshNormalMaterial, + renderTarget: WebGLRenderTarget | null, + clearColor?: ColorRepresentation | undefined, + clearAlpha?: number | undefined, + ): void; + + overrideVisibility(): void; + + restoreVisibility(): void; + + generateNoise(size?: number): DataTexture; + + static OUTPUT: { + Off: -1; + Default: 0; + Diffuse: 1; + Depth: 2; + Normal: 3; + AO: 4; + Denoise: 5; + }; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/GlitchPass.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/GlitchPass.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5e38587168b5adb2a928fe328475c05a2f5f1b0d --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/GlitchPass.d.ts @@ -0,0 +1,16 @@ +import { DataTexture, ShaderMaterial } from "three"; + +import { FullScreenQuad, Pass } from "./Pass.js"; + +export class GlitchPass extends Pass { + constructor(dt_size?: number); + uniforms: object; + material: ShaderMaterial; + fsQuad: FullScreenQuad; + goWild: boolean; + curF: number; + randX: number; + + generateTrigger(): void; + generateHeightmap(dt_size: number): DataTexture; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/HalftonePass.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/HalftonePass.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..59a74ef1ac0b1d173dcdd4cd55097a464a1277ac --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/HalftonePass.d.ts @@ -0,0 +1,37 @@ +import { IUniform, ShaderMaterial } from "three"; + +import { FullScreenQuad, Pass } from "./Pass.js"; + +export interface HalftonePassParameters { + shape?: number; + radius?: number; + rotateR?: number; + rotateB?: number; + rotateG?: number; + scatter?: number; + blending?: number; + blendingMode?: number; + greyscale?: boolean; + disable?: boolean; +} + +export class HalftonePass extends Pass { + constructor(params: HalftonePassParameters); + uniforms: { + tDiffuse: IUniform; + shape: IUniform; + radius: IUniform; + rotateR: IUniform; + rotateG: IUniform; + rotateB: IUniform; + scatter: IUniform; + width: IUniform; + height: IUniform; + blending: IUniform; + blendingMode: IUniform; + greyscale: IUniform; + disable: IUniform; + }; + material: ShaderMaterial; + fsQuad: FullScreenQuad; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/LUTPass.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/LUTPass.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..934872ac3e76dc7f0a1d0ca33fef8b2c9c4e429c --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/LUTPass.d.ts @@ -0,0 +1,13 @@ +import { Data3DTexture, DataTexture } from "three"; +import { ShaderPass } from "./ShaderPass.js"; + +export interface LUTPassParameters { + lut?: DataTexture | Data3DTexture; + intensity?: number; +} + +export class LUTPass extends ShaderPass { + lut?: DataTexture | Data3DTexture; + intensity?: number; + constructor(params?: LUTPassParameters); +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/MaskPass.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/MaskPass.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..164d2fee062eb06f96c112a3a52a8a5c99a9172d --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/MaskPass.d.ts @@ -0,0 +1,14 @@ +import { Camera, Scene } from "three"; + +import { FullScreenQuad, Pass } from "./Pass.js"; + +export class MaskPass extends Pass { + constructor(scene: Scene, camera: Camera); + scene: Scene; + camera: Camera; + inverse: boolean; +} + +export class ClearMaskPass extends Pass { + constructor(); +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/OutlinePass.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/OutlinePass.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fdc3769d466567dcba7875cec5e04c72cd7ab6b4 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/OutlinePass.d.ts @@ -0,0 +1,64 @@ +import { + Camera, + Color, + Matrix4, + MeshBasicMaterial, + MeshDepthMaterial, + Object3D, + Scene, + ShaderMaterial, + Texture, + Vector2, + WebGLRenderTarget, +} from "three"; + +import { FullScreenQuad, Pass } from "./Pass.js"; + +export class OutlinePass extends Pass { + constructor(resolution: Vector2, scene: Scene, camera: Camera, selectedObjects?: Object3D[]); + renderScene: Scene; + renderCamera: Camera; + selectedObjects: Object3D[]; + visibleEdgeColor: Color; + hiddenEdgeColor: Color; + edgeGlow: number; + usePatternTexture: boolean; + edgeThickness: number; + edgeStrength: number; + downSampleRatio: number; + pulsePeriod: number; + resolution: Vector2; + patternTexture: Texture; + + maskBufferMaterial: MeshBasicMaterial; + renderTargetMaskBuffer: WebGLRenderTarget; + depthMaterial: MeshDepthMaterial; + prepareMaskMaterial: ShaderMaterial; + renderTargetDepthBuffer: WebGLRenderTarget; + renderTargetMaskDownSampleBuffer: WebGLRenderTarget; + renderTargetBlurBuffer1: WebGLRenderTarget; + renderTargetBlurBuffer2: WebGLRenderTarget; + edgeDetectionMaterial: ShaderMaterial; + renderTargetEdgeBuffer1: WebGLRenderTarget; + renderTargetEdgeBuffer2: WebGLRenderTarget; + separableBlurMaterial1: ShaderMaterial; + separableBlurMaterial2: ShaderMaterial; + overlayMaterial: ShaderMaterial; + copyUniforms: object; + materialCopy: ShaderMaterial; + oldClearColor: Color; + oldClearAlpha: number; + fsQuad: FullScreenQuad; + tempPulseColor1: Color; + tempPulseColor2: Color; + textureMatrix: Matrix4; + + updateSelectionCache(): void; + changeVisibilityOfSelectedObjects(bVisible: boolean): void; + changeVisibilityOfNonSelectedObjects(bVisible: boolean): void; + updateTextureMatrix(): void; + getPrepareMaskMaterial(): ShaderMaterial; + getEdgeDetectionMaterial(): ShaderMaterial; + getSeparableBlurMaterial(): ShaderMaterial; + getOverlayMaterial(): ShaderMaterial; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/OutputPass.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/OutputPass.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c04a59f7f80c88c90bf3d87ec6a83b0732fed70e --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/OutputPass.d.ts @@ -0,0 +1,10 @@ +import { ShaderMaterial } from "three"; + +import { FullScreenQuad, Pass } from "./Pass.js"; + +export class OutputPass extends Pass { + constructor(); + uniforms: object; + material: ShaderMaterial; + fsQuad: FullScreenQuad; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/Pass.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/Pass.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dc28b08a9af014a3b2edf9e4a1a366c9f4394159 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/Pass.d.ts @@ -0,0 +1,31 @@ +import { Material, WebGLRenderer, WebGLRenderTarget } from "three"; + +export class Pass { + constructor(); + + isPass: boolean; + enabled: boolean; + needsSwap: boolean; + clear: boolean; + renderToScreen: boolean; + + setSize(width: number, height: number): void; + render( + renderer: WebGLRenderer, + writeBuffer: WebGLRenderTarget, + readBuffer: WebGLRenderTarget, + deltaTime: number, + maskActive: boolean, + ): void; + + dispose(): void; +} + +export class FullScreenQuad { + constructor(material?: Material); + + render(renderer: WebGLRenderer): void; + dispose(): void; + + material: Material; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/RenderPass.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/RenderPass.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2f296fac04e29662bcc7eb676d5984d76a7b4497 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/RenderPass.d.ts @@ -0,0 +1,23 @@ +import { Camera, Color, Material, Scene } from "three"; + +import { Pass } from "./Pass.js"; + +export class RenderPass extends Pass { + constructor( + scene: Scene, + camera: Camera, + overrideMaterial?: Material | null, + clearColor?: Color | null, + clearAlpha?: number | null, + ); + + scene: Scene; + camera: Camera; + + overrideMaterial: Material | null; + + clearColor: Color | null; + clearAlpha: number | null; + + clearDepth: boolean; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/RenderPixelatedPass.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/RenderPixelatedPass.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b592fa4a95f066bce79e361614a16644bc0963ea --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/RenderPixelatedPass.d.ts @@ -0,0 +1,30 @@ +import { Camera, MeshNormalMaterial, Scene, ShaderMaterial, Vector2, WebGLRenderTarget } from "three"; + +import { FullScreenQuad, Pass } from "./Pass.js"; + +export interface RenderPixelatedPassParameters { + normalEdgeStrength?: number; + depthEdgeStrength?: number; +} + +export class RenderPixelatedPass extends Pass { + constructor(pixelSize: number, scene: Scene, camera: Camera, options?: RenderPixelatedPassParameters); + pixelSize: number; + resolution: Vector2; + renderResolution: Vector2; + + pixelatedMaterial: ShaderMaterial; + normalMaterial: MeshNormalMaterial; + + fsQuad: FullScreenQuad; + scene: Scene; + camera: Camera; + + normalEdgeStrength: RenderPixelatedPassParameters["normalEdgeStrength"]; + depthEdgeStrength: RenderPixelatedPassParameters["depthEdgeStrength"]; + + beautyRenderTarget: WebGLRenderTarget; + normalRenderTarget: WebGLRenderTarget; + + setPixelSize(pixelSize: number): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/RenderTransitionPass.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/RenderTransitionPass.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..14c1a9de9d23ce9846ba49a4a55b042c11eb2829 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/RenderTransitionPass.d.ts @@ -0,0 +1,33 @@ +import { Camera, Object3D, ShaderMaterial, Texture, WebGLRenderer, WebGLRenderTarget } from "three"; +import { FullScreenQuad, Pass } from "./Pass.js"; + +export class RenderTransitionPass extends Pass { + material: ShaderMaterial; + fsQuad: FullScreenQuad; + + sceneA: Object3D; + cameraA: Camera; + sceneB: Object3D; + cameraB: Camera; + + renderTargetA: WebGLRenderTarget; + renderTargetB: WebGLRenderTarget; + + constructor(sceneA: Object3D, cameraA: Camera, sceneB: Object3D, cameraB: Camera); + + setTransition(value: number): void; + + useTexture(value: boolean): void; + + setTexture(value: Texture | null): void; + + setTextureThreshold(value: number): void; + + setSize(width: number, height: number): void; + + render(renderer: WebGLRenderer, writeBuffer: WebGLRenderTarget): void; + + dispose(): void; + + createMaterial(): ShaderMaterial; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/SAOPass.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/SAOPass.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2e5c0ff0a463525c090648de3c11c3a253ed1477 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/SAOPass.d.ts @@ -0,0 +1,70 @@ +import { + Camera, + Color, + ColorRepresentation, + Material, + MeshNormalMaterial, + Scene, + ShaderMaterial, + Vector2, + WebGLRenderer, + WebGLRenderTarget, +} from "three"; + +import { FullScreenQuad, Pass } from "./Pass.js"; + +export enum OUTPUT { + Default, + SAO, + Normal, +} + +export interface SAOPassParams { + output: OUTPUT; + saoBias: number; + saoIntensity: number; + saoScale: number; + saoKernelRadius: number; + saoMinResolution: number; + saoBlur: boolean; + saoBlurRadius: number; + saoBlurStdDev: number; + saoBlurDepthCutoff: number; +} + +export class SAOPass extends Pass { + constructor(scene: Scene, camera: Camera, resolution?: Vector2); + scene: Scene; + camera: Camera; + originalClearColor: Color; + oldClearColor: Color; + oldClearAlpha: number; + resolution: Vector2; + saoRenderTarget: WebGLRenderTarget; + blurIntermediateRenderTarget: WebGLRenderTarget; + normalRenderTarget: WebGLRenderTarget; + normalMaterial: MeshNormalMaterial; + saoMaterial: ShaderMaterial; + vBlurMaterial: ShaderMaterial; + hBlurMaterial: ShaderMaterial; + materialCopy: ShaderMaterial; + fsQuad: FullScreenQuad; + params: SAOPassParams; + + static OUTPUT: typeof OUTPUT; + + renderPass( + renderer: WebGLRenderer, + passMaterial: Material, + renderTarget: WebGLRenderTarget, + clearColor?: ColorRepresentation, + clearAlpha?: number, + ): void; + renderOverride( + renderer: WebGLRenderer, + overrideMaterial: Material, + renderTarget: WebGLRenderTarget, + clearColor?: ColorRepresentation, + clearAlpha?: number, + ): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/SMAAPass.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/SMAAPass.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a23b49c9bebdc5bd99a0fa20196b04b64d5b0684 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/SMAAPass.d.ts @@ -0,0 +1,21 @@ +import { ShaderMaterial, Texture, WebGLRenderTarget } from "three"; + +import { FullScreenQuad, Pass } from "./Pass.js"; + +export class SMAAPass extends Pass { + constructor(); + edgesRT: WebGLRenderTarget; + weightsRT: WebGLRenderTarget; + areaTexture: Texture; + searchTexture: Texture; + uniformsEdges: object; + materialEdges: ShaderMaterial; + uniformsWeights: object; + materialWeights: ShaderMaterial; + uniformsBlend: object; + materialBlend: ShaderMaterial; + fsQuad: FullScreenQuad; + + getAreaTexture(): string; + getSearchTexture(): string; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/SSAARenderPass.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/SSAARenderPass.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fceaa8a98eb1b3bd69a2f2a9cef5c7bec5a33b9f --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/SSAARenderPass.d.ts @@ -0,0 +1,26 @@ +import { Camera, ColorRepresentation, Scene, ShaderMaterial, WebGLRenderTarget } from "three"; + +import { FullScreenQuad, Pass } from "./Pass.js"; + +export class SSAARenderPass extends Pass { + scene: Scene; + camera: Camera; + + sampleLevel: number; + unbiased: boolean; + + stencilBuffer: boolean; + + clearColor: ColorRepresentation; + clearAlpha: number; + + copyUniforms: object; + + copyMaterial: ShaderMaterial; + + fsQuad: FullScreenQuad; + + sampleRenderTarget?: WebGLRenderTarget | undefined; + + constructor(scene: Scene, camera: Camera, clearColor?: ColorRepresentation, clearAlpha?: number); +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/SSAOPass.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/SSAOPass.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0cdd34a72c8a84875c605554eba10a7cb024cb03 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/SSAOPass.d.ts @@ -0,0 +1,68 @@ +import { + Camera, + Color, + ColorRepresentation, + DataTexture, + Material, + MeshNormalMaterial, + Scene, + ShaderMaterial, + Vector3, + WebGLRenderer, + WebGLRenderTarget, +} from "three"; + +import { FullScreenQuad, Pass } from "./Pass.js"; + +export enum SSAOPassOUTPUT { + Default, + SSAO, + Blur, + Depth, + Normal, +} + +export class SSAOPass extends Pass { + constructor(scene: Scene, camera: Camera, width?: number, height?: number, kernelSize?: number); + scene: Scene; + camera: Camera; + width: number; + height: number; + clear: boolean; + kernelRadius: number; + kernel: Vector3[]; + noiseTexture: DataTexture; + output: SSAOPassOUTPUT; + minDistance: number; + maxDistance: number; + normalRenderTarget: WebGLRenderTarget; + ssaoRenderTarget: WebGLRenderTarget; + blurRenderTarget: WebGLRenderTarget; + ssaoMaterial: ShaderMaterial; + normalMaterial: MeshNormalMaterial; + blurMaterial: ShaderMaterial; + depthRenderMaterial: ShaderMaterial; + copyMaterial: ShaderMaterial; + fsQuad: FullScreenQuad; + originalClearColor: Color; + + static OUTPUT: typeof SSAOPassOUTPUT; + + dipose(): void; + generateSampleKernel(kernelSize: number): Vector3[]; + generateRandomKernelRotations(): void; + renderPass( + renderer: WebGLRenderer, + passMaterial: Material, + renderTarget: WebGLRenderTarget, + clearColor?: ColorRepresentation, + clearAlpha?: number, + ): void; + renderOverride( + renderer: WebGLRenderer, + overrideMaterial: Material, + renderTarget: WebGLRenderTarget, + clearColor?: ColorRepresentation, + clearAlpha?: number, + ): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/SSRPass.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/SSRPass.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..069f1d34060e322e3cad7a680819a0b53860d6a8 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/SSRPass.d.ts @@ -0,0 +1,99 @@ +import { + Camera, + Color, + Mesh, + MeshBasicMaterial, + MeshNormalMaterial, + Scene, + ShaderMaterial, + WebGLRenderer, + WebGLRenderTarget, +} from "three"; +import { ReflectorForSSRPass } from "../objects/ReflectorForSSRPass.js"; +import { FullScreenQuad, Pass } from "./Pass.js"; + +export interface SSRPassParams { + renderer: WebGLRenderer; + scene: Scene; + camera: Camera; + width?: number | undefined; + height?: number | undefined; + selects: Mesh[] | null; + isPerspectiveCamera?: boolean | undefined; + isBouncing?: boolean | undefined; + groundReflector: ReflectorForSSRPass | null; +} + +declare class SSRPass extends Pass { + width: number; + height: number; + clear: boolean; + renderer: WebGLRenderer; + scene: Scene; + camera: Camera; + groundReflector: ReflectorForSSRPass | null; + opacity: number; + output: number; + maxDistance: number; + thickness: number; + tempColor: Color; + + get selects(): Mesh[] | null; + set selects(val: Mesh[] | null); + selective: boolean; + get bouncing(): boolean; + set bouncing(val: boolean); + + blur: boolean; + + get distanceAttenuation(): boolean; + set distanceAttenuation(val: boolean); + get fresnel(): boolean; + set fresnel(val: boolean); + get infiniteThick(): boolean; + set infiniteThick(val: boolean); + + beautyRenderTarget: WebGLRenderTarget; + prevRenderTarget: WebGLRenderTarget; + normalRenderTarget: WebGLRenderTarget; + metalnessRenderTarget: WebGLRenderTarget; + ssrRenderTarget: WebGLRenderTarget; + + blurRenderTarget: WebGLRenderTarget; + blurRenderTarget2: WebGLRenderTarget; + + ssrMaterial: ShaderMaterial; + + normalMaterial: MeshNormalMaterial; + + metalnessOnMaterial: MeshBasicMaterial; + + metalnessOffMaterial: MeshBasicMaterial; + + blurMaterial: ShaderMaterial; + blurMaterial2: ShaderMaterial; + + depthRenderMaterial: ShaderMaterial; + + copyMaterial: ShaderMaterial; + + fsQuad: FullScreenQuad; + + originalClearColor: Color; + + static OUTPUT: { + Default: 0; + SSR: 1; + Beauty: 3; + Depth: 4; + Normal: 5; + Metalness: 7; + }; + + constructor(params: SSRPassParams); + + get resolutionScale(): number; + set resolutionScale(value: number); +} + +export { SSRPass }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/SavePass.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/SavePass.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..53e31a31b8b00ad4fc00be1da11b6ba907f94384 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/SavePass.d.ts @@ -0,0 +1,12 @@ +import { ShaderMaterial, WebGLRenderTarget } from "three"; + +import { FullScreenQuad, Pass } from "./Pass.js"; + +export class SavePass extends Pass { + constructor(renderTarget?: WebGLRenderTarget); + textureID: string; + renderTarget: WebGLRenderTarget; + uniforms: object; + material: ShaderMaterial; + fsQuad: FullScreenQuad; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/ShaderPass.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/ShaderPass.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d7eb0de041925999c23d12dd52cdac925019f3ca --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/ShaderPass.d.ts @@ -0,0 +1,11 @@ +import { ShaderMaterial } from "three"; + +import { FullScreenQuad, Pass } from "./Pass.js"; + +export class ShaderPass extends Pass { + constructor(shader: object, textureID?: string); + textureID: string; + uniforms: { [name: string]: { value: any } }; + material: ShaderMaterial; + fsQuad: FullScreenQuad; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/TAARenderPass.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/TAARenderPass.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e463ce22f4fbf0eedd17c0e6b7ead24dd7d3d614 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/TAARenderPass.d.ts @@ -0,0 +1,8 @@ +import { Camera, ColorRepresentation, Scene } from "three"; + +import { SSAARenderPass } from "./SSAARenderPass.js"; + +export class TAARenderPass extends SSAARenderPass { + constructor(scene: Scene, camera: Camera, clearColor?: ColorRepresentation, clearAlpha?: number); + accumulate: boolean; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/TexturePass.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/TexturePass.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e8de86796f2d539c9d4f6ad53bfbc765380661cd --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/TexturePass.d.ts @@ -0,0 +1,12 @@ +import { IUniform, ShaderMaterial, Texture } from "three"; + +import { FullScreenQuad, Pass } from "./Pass.js"; + +export class TexturePass extends Pass { + constructor(map?: Texture, opacity?: number); + map: Texture | undefined; + opacity: number; + uniforms: Record; + material: ShaderMaterial; + fsQuad: FullScreenQuad; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/UnrealBloomPass.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/UnrealBloomPass.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5123441343ca2581c455427a11e2f0950b4a72d3 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/postprocessing/UnrealBloomPass.d.ts @@ -0,0 +1,31 @@ +import { Color, MeshBasicMaterial, ShaderMaterial, Vector2, Vector3, WebGLRenderTarget } from "three"; + +import { FullScreenQuad, Pass } from "./Pass.js"; + +export class UnrealBloomPass extends Pass { + constructor(resolution: Vector2, strength: number, radius: number, threshold: number); + resolution: Vector2; + strength: number; + radius: number; + threshold: number; + clearColor: Color; + renderTargetsHorizontal: WebGLRenderTarget[]; + renderTargetsVertical: WebGLRenderTarget[]; + nMips: number; + renderTargetBright: WebGLRenderTarget; + highPassUniforms: object; + materialHighPassFilter: ShaderMaterial; + separableBlurMaterials: ShaderMaterial[]; + compositeMaterial: ShaderMaterial; + bloomTintColors: Vector3[]; + copyUniforms: object; + blendMaterial: ShaderMaterial; + oldClearColor: Color; + oldClearAlpha: number; + basic: MeshBasicMaterial; + fsQuad: FullScreenQuad; + + dispose(): void; + getSeparableBlurMaterial(): ShaderMaterial; + getCompositeMaterial(): ShaderMaterial; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/renderers/CSS2DRenderer.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/renderers/CSS2DRenderer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d0ef6e89137a5aa85b85d51235c70436cf7ebe09 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/renderers/CSS2DRenderer.d.ts @@ -0,0 +1,23 @@ +import { Camera, Object3D, Scene, Vector2 } from "three"; + +export class CSS2DObject extends Object3D { + constructor(element: HTMLElement); + element: HTMLElement; + center: Vector2; + + onBeforeRender: (renderer: unknown, scene: Scene, camera: Camera) => void; + onAfterRender: (renderer: unknown, scene: Scene, camera: Camera) => void; +} + +export type CSS2DParameters = { + element?: HTMLElement; +}; + +export class CSS2DRenderer { + constructor(parameters?: CSS2DParameters); + domElement: HTMLElement; + + getSize(): { width: number; height: number }; + setSize(width: number, height: number): void; + render(scene: Scene, camera: Camera): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/renderers/CSS3DRenderer.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/renderers/CSS3DRenderer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..20fd94c56b8a1be8d6d916071281647fd3c0ba39 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/renderers/CSS3DRenderer.d.ts @@ -0,0 +1,26 @@ +import { Camera, Object3D, Scene } from "three"; + +export class CSS3DObject extends Object3D { + constructor(element: HTMLElement); + element: HTMLElement; + + onBeforeRender: (renderer: unknown, scene: Scene, camera: Camera) => void; + onAfterRender: (renderer: unknown, scene: Scene, camera: Camera) => void; +} + +export class CSS3DSprite extends CSS3DObject { + constructor(element: HTMLElement); +} + +export interface CSS3DParameters { + element?: HTMLElement; +} + +export class CSS3DRenderer { + constructor(parameters?: CSS3DParameters); + domElement: HTMLElement; + + getSize(): { width: number; height: number }; + setSize(width: number, height: number): void; + render(scene: Scene, camera: Camera): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/renderers/Projector.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/renderers/Projector.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0733e2d84c4d674c9a0c780d3c3ed51ee0bea046 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/renderers/Projector.d.ts @@ -0,0 +1,60 @@ +import { Camera, Color, Material, Object3D, Scene, Vector2, Vector3, Vector4 } from "three"; + +export class RenderableObject { + id: number; + object: Object3D; + z: number; + renderOrder: number; +} + +export class RenderableFace { + id: number; + v1: RenderableVertex; + v2: RenderableVertex; + v3: RenderableVertex; + normalModel: Vector3; + vertexNormalsModel: Vector3[]; + vertexNormalsLength: number; + color: Color; + material: Material; + uvs: Vector2[]; + z: number; + renderOrder: number; +} + +export class RenderableVertex { + position: Vector3; + positionWorld: Vector3; + positionScreen: Vector4; + visible: boolean; + + copy(vertex: RenderableVertex): void; +} + +export class RenderableLine { + id: number; + v1: RenderableVertex; + v2: RenderableVertex; + vertexColors: Color[]; + material: Material; + z: number; + renderOrder: number; +} + +export class RenderableSprite { + id: number; + object: Object3D; + x: number; + y: number; + z: number; + rotation: number; + scale: Vector2; + material: Material; + renderOrder: number; +} + +export class Projector { + constructor(); + + projectScene(scene: Scene, camera: Camera, sortObjects: boolean, sortElements: boolean): any; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/renderers/SVGRenderer.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/renderers/SVGRenderer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ea737b1bf425fde35c00a731135092ba1818fabb --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/renderers/SVGRenderer.d.ts @@ -0,0 +1,26 @@ +import { Camera, Color, Object3D, Scene } from "three"; + +export class SVGObject extends Object3D { + constructor(node: SVGElement); + node: SVGElement; +} + +export class SVGRenderer { + constructor(); + domElement: SVGElement; + autoClear: boolean; + sortObjects: boolean; + sortElements: boolean; + overdraw: number; + outputColorSpace: string; + info: { render: { vertices: number; faces: number } }; + + getSize(): { width: number; height: number }; + setQuality(quality: string): void; + setClearColor(color: Color, alpha: number): void; + setPixelRatio(): void; + setSize(width: number, height: number): void; + setPrecision(precision: number): void; + clear(): void; + render(scene: Scene, camera: Camera): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/ACESFilmicToneMappingShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/ACESFilmicToneMappingShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c0a4d9709b26d861d7d28e535b0983dbbb0af653 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/ACESFilmicToneMappingShader.d.ts @@ -0,0 +1,11 @@ +import { IUniform, Texture } from "three"; + +export const ACESFilmicToneMappingShader: { + name: string; + uniforms: { + tDiffuse: IUniform; + exposure: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/AfterimageShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/AfterimageShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..365a10bab85e54a169e3ff143a37451d53475e97 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/AfterimageShader.d.ts @@ -0,0 +1,12 @@ +import { IUniform } from "three"; + +export const AfterimageShader: { + name: string; + uniforms: { + damp: IUniform; + tOld: IUniform; + tNew: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/BasicShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/BasicShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b50e15bd73fea46c372aebc7be9d7b289e1631a --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/BasicShader.d.ts @@ -0,0 +1,6 @@ +export const BasicShader: { + name: string; + uniforms: {}; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/BleachBypassShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/BleachBypassShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7e6bd842527454cb67400b3578e6c218cf251ddc --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/BleachBypassShader.d.ts @@ -0,0 +1,10 @@ +import { IUniform } from "three"; + +export const BleachBypassShader: { + uniforms: { + tDiffuse: IUniform; + opacity: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/BlendShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/BlendShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dd75a6d9daea9028b412c95f60b570f6201381b8 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/BlendShader.d.ts @@ -0,0 +1,13 @@ +import { IUniform } from "three"; + +export const BlendShader: { + name: string; + uniforms: { + tDiffuse1: IUniform; + tDiffuse2: IUniform; + mixRatio: IUniform; + opacity: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/BokehShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/BokehShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..90e31c1234d180f01d18a82ae70b7e38d638abea --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/BokehShader.d.ts @@ -0,0 +1,21 @@ +import { IUniform } from "three"; + +export const BokehShader: { + name: string; + defines: { + DEPTH_PACKING: number; + PERSPECTIVE_CAMERA: number; + }; + uniforms: { + tColor: IUniform; + tDepth: IUniform; + focus: IUniform; + aspect: IUniform; + aperture: IUniform; + maxblur: IUniform; + nearClip: IUniform; + farClip: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/BokehShader2.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/BokehShader2.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ec7bc7dbf9d3155e55b326c99e3a91f12aad44df --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/BokehShader2.d.ts @@ -0,0 +1,44 @@ +import { IUniform } from "three"; + +export interface BokehShaderUniforms { + textureWidth: IUniform; + textureHeight: IUniform; + focalDepth: IUniform; + focalLength: IUniform; + fstop: IUniform; + tColor: IUniform; + tDepth: IUniform; + maxblur: IUniform; + showFocus: IUniform; + manualdof: IUniform; + vignetting: IUniform; + depthblur: IUniform; + threshold: IUniform; + gain: IUniform; + bias: IUniform; + fringe: IUniform; + znear: IUniform; + zfar: IUniform; + noise: IUniform; + dithering: IUniform; + pentagon: IUniform; + shaderFocus: IUniform; + focusCoords: IUniform; +} + +export const BokehShader: { + name: string; + uniforms: BokehShaderUniforms; + vertexShader: string; + fragmentShader: string; +}; + +export const BokehDepthShader: { + name: string; + uniforms: { + mNear: IUniform; + mFar: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/BrightnessContrastShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/BrightnessContrastShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d15b3ea73e9a74887a25febaddda4e939b58089e --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/BrightnessContrastShader.d.ts @@ -0,0 +1,12 @@ +import { IUniform } from "three"; + +export const BrightnessContrastShader: { + name: string; + uniforms: { + tDiffuse: IUniform; + brightness: IUniform; + contrast: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/ColorCorrectionShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/ColorCorrectionShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2485a37f1c3cd6305730445a3746a39646b082c4 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/ColorCorrectionShader.d.ts @@ -0,0 +1,13 @@ +import { IUniform } from "three"; + +export const ColorCorrectionShader: { + name: string; + uniforms: { + tDiffuse: IUniform; + powRGB: IUniform; + mulRGB: IUniform; + addRGB: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/ColorifyShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/ColorifyShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..505091ed5bf9ac9e6f5e579be28c8551341421e4 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/ColorifyShader.d.ts @@ -0,0 +1,10 @@ +import { IUniform } from "three"; + +export const ColorifyShader: { + uniforms: { + tDiffuse: IUniform; + color: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/ConvolutionShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/ConvolutionShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f4031dc0fb9790b21693ead5af3e1f3737944ff4 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/ConvolutionShader.d.ts @@ -0,0 +1,17 @@ +import { IUniform } from "three"; + +export const ConvolutionShader: { + defines: { + KERNEL_SIZE_FLOAT: string; + KERNEL_SIZE_INT: string; + }; + uniforms: { + tDiffuse: IUniform; + uImageIncrement: IUniform; + cKernel: IUniform; + }; + vertexShader: string; + fragmentShader: string; + + buildKernel(sigma: number): number[]; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/CopyShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/CopyShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5a41951a4e9ecd32eaaefc76a9dc26463b20372f --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/CopyShader.d.ts @@ -0,0 +1,10 @@ +import { IUniform } from "three"; + +export const CopyShader: { + uniforms: { + tDiffuse: IUniform; + opacity: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/DOFMipMapShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/DOFMipMapShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2f4ae3f98d5372da4426cd3e7ca0757733fc1c1a --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/DOFMipMapShader.d.ts @@ -0,0 +1,13 @@ +import { IUniform } from "three"; + +export const DOFMipMapShader: { + name: string; + uniforms: { + tColor: IUniform; + tDepth: IUniform; + focus: IUniform; + maxblur: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/DepthLimitedBlurShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/DepthLimitedBlurShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..87e9f43abd0ecd57752c4d28c79ab3016525d318 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/DepthLimitedBlurShader.d.ts @@ -0,0 +1,28 @@ +import { IUniform, Material, Vector2 } from "three"; + +export const DepthLimitedBlurShader: { + name: string; + defines: { + KERNEL_RADIUS: number; + DEPTH_PACKING: number; + PERSPECTIVE_CAMERA: number; + }; + uniforms: { + tDiffuse: IUniform; + size: IUniform; + sampleUvOffsets: IUniform; + sampleWeights: IUniform; + tDepth: IUniform; + cameraNear: IUniform; + cameraFar: IUniform; + depthCutoff: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; + +export const BlurShaderUtils: { + createSampleWeights(kernelRadius: number, stdDev: number): number[]; + createSampleOffsets(kernelRadius: number, uvIncrement: Vector2): Vector2[]; + configure(configure: Material, kernelRadius: number, stdDev: number, uvIncrement: Vector2): void; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/DigitalGlitch.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/DigitalGlitch.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8459d8d486e23588c146b467052f653cfaa94da1 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/DigitalGlitch.d.ts @@ -0,0 +1,19 @@ +import { IUniform } from "three"; + +export const DigitalGlitch: { + uniforms: { + tDiffuse: IUniform; + tDisp: IUniform; + byp: IUniform; + amount: IUniform; + angle: IUniform; + seed: IUniform; + seed_x: IUniform; + seed_y: IUniform; + distortion_x: IUniform; + distortion_y: IUniform; + col_s: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/DotScreenShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/DotScreenShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1e93af8297d9cc1064bd8331f2a592f64422089f --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/DotScreenShader.d.ts @@ -0,0 +1,13 @@ +import { IUniform } from "three"; + +export const DotScreenShader: { + uniforms: { + tDiffuse: IUniform; + tSize: IUniform; + center: IUniform; + angle: IUniform; + scale: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/ExposureShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/ExposureShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..229af695deb410bf9a4fba6f0612e36ade511057 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/ExposureShader.d.ts @@ -0,0 +1,11 @@ +import { IUniform, Texture } from "three"; + +export const ExposureShader: { + name: "ExposureShader"; + uniforms: { + tDiffuse: IUniform; + exposure: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/FXAAShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/FXAAShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bea73800f8999e82c431220b03552052b1cf0b64 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/FXAAShader.d.ts @@ -0,0 +1,11 @@ +import { IUniform } from "three"; + +export const FXAAShader: { + name: string; + uniforms: { + tDiffuse: IUniform; + resolution: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/FilmShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/FilmShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e2467719963ccade45b2758dd7ba107fb7f3d692 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/FilmShader.d.ts @@ -0,0 +1,12 @@ +import { IUniform } from "three"; + +export const FilmShader: { + uniforms: { + tDiffuse: IUniform; + time: IUniform; + intensity: IUniform; + grayscale: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/FocusShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/FocusShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c91b106fe81cd7fbc8ebeea4ecf830d4390c59eb --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/FocusShader.d.ts @@ -0,0 +1,14 @@ +import { IUniform } from "three"; + +export const FocusShader: { + name: string; + uniforms: { + tDiffuse: IUniform; + screenWidth: IUniform; + screenHeight: IUniform; + sampleDistance: IUniform; + waveFactor: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/FreiChenShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/FreiChenShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..17a443ac49417db86b27939d3ef4f01f6d86c09f --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/FreiChenShader.d.ts @@ -0,0 +1,11 @@ +import { IUniform } from "three"; + +export const FreiChenShader: { + name: string; + uniforms: { + tDiffuse: IUniform; + aspect: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/GTAOShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/GTAOShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d048f7ff5e1280136a07b0041acddae4fe443219 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/GTAOShader.d.ts @@ -0,0 +1,59 @@ +import { DataTexture, IUniform, Matrix4, Vector2, Vector3 } from "three"; + +export const GTAOShader: { + name: string; + defines: { + PERSPECTIVE_CAMERA: number; + SAMPLES: number; + NORMAL_VECTOR_TYPE: number; + DEPTH_SWIZZLING: string; + SCREEN_SPACE_RADIUS: number; + SCREEN_SPACE_RADIUS_SCALE: number; + SCENE_CLIP_BOX: number; + }; + uniforms: { + tNormal: IUniform; + tDepth: IUniform; + tNoise: IUniform; + resolution: IUniform; + cameraNear: IUniform; + cameraFar: IUniform; + cameraProjectionMatrix: IUniform; + cameraProjectionMatrixInverse: IUniform; + radius: IUniform; + distanceExponent: IUniform; + thickness: IUniform; + distanceFallOff: IUniform; + scale: IUniform; + sceneBoxMin: IUniform; + sceneBoxMax: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; + +export const GTAODepthShader: { + name: string; + defines: { + PERSPECTIVE_CAMERA: number; + }; + uniforms: { + tDepth: IUniform; + cameraNear: IUniform; + cameraFar: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; + +export const GTAOBlendShader: { + name: string; + uniforms: { + tDiffuse: IUniform; + intensity: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; + +export function generateMagicSquareNoise(samples?: number): DataTexture; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/GammaCorrectionShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/GammaCorrectionShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dff32f4eddf3b3065dc2f0928f00571171f85bb4 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/GammaCorrectionShader.d.ts @@ -0,0 +1,9 @@ +import { IUniform } from "three"; + +export const GammaCorrectionShader: { + uniforms: { + tDiffuse: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/GodRaysShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/GodRaysShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..31b3b6c770a9862d12420a96af6ff06ac6d298c2 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/GodRaysShader.d.ts @@ -0,0 +1,44 @@ +import { IUniform } from "three"; + +export const GodRaysDepthMaskShader: { + name: string; + uniforms: { + tInput: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; + +export const GodRaysGenerateShader: { + name: string; + uniforms: { + tInput: IUniform; + fStepSize: IUniform; + vSunPositionScreenSpace: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; + +export const GodRaysCombineShader: { + name: string; + uniforms: { + tColors: IUniform; + tGodRays: IUniform; + fGodRayIntensity: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; + +export const GodRaysFakeSunShader: { + name: string; + uniforms: { + vSunPositionScreenSpace: IUniform; + fAspect: IUniform; + sunColor: IUniform; + bgColor: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/HalftoneShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/HalftoneShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..17dc1c10754e938d64c0dc491c4ac62c8ce046cb --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/HalftoneShader.d.ts @@ -0,0 +1,22 @@ +import { IUniform } from "three"; + +export const HalftoneShader: { + name: string; + uniforms: { + tDiffuse: IUniform; + shape: IUniform; + radius: IUniform; + rotateR: IUniform; + rotateG: IUniform; + rotateB: IUniform; + scatter: IUniform; + width: IUniform; + height: IUniform; + blending: IUniform; + blendingMode: IUniform; + greyscale: IUniform; + disable: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/HorizontalBlurShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/HorizontalBlurShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ea2e58a2b21092c56a11bd40724c404911231eed --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/HorizontalBlurShader.d.ts @@ -0,0 +1,10 @@ +import { IUniform } from "three"; + +export const HorizontalBlurShader: { + uniforms: { + tDiffuse: IUniform; + h: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/HorizontalTiltShiftShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/HorizontalTiltShiftShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2295328e2cbace0b89226099ea47458e79791de2 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/HorizontalTiltShiftShader.d.ts @@ -0,0 +1,12 @@ +import { IUniform } from "three"; + +export const HorizontalTiltShiftShader: { + name: string; + uniforms: { + tDiffuse: IUniform; + h: IUniform; + r: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/HueSaturationShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/HueSaturationShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e2ee185803ef5fa3652bf24150e833dfc0fd8741 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/HueSaturationShader.d.ts @@ -0,0 +1,12 @@ +import { IUniform } from "three"; + +export const HueSaturationShader: { + name: string; + uniforms: { + tDiffuse: IUniform; + hue: IUniform; + saturation: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/KaleidoShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/KaleidoShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4772356c79146452bca5e0a957687b344309a58a --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/KaleidoShader.d.ts @@ -0,0 +1,12 @@ +import { IUniform } from "three"; + +export const KaleidoShader: { + name: string; + uniforms: { + tDiffuse: IUniform; + sides: IUniform; + angle: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/LuminosityHighPassShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/LuminosityHighPassShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0026b6db8bd483f1a6520c9cee472e14d0f3626e --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/LuminosityHighPassShader.d.ts @@ -0,0 +1,15 @@ +import { IUniform } from "three"; + +export const LuminosityHighPassShader: { + name: string; + shaderID: string; + uniforms: { + tDiffuse: IUniform; + luminosityThreshold: IUniform; + smoothWidth: IUniform; + defaultColor: IUniform; + defaultOpacity: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/LuminosityShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/LuminosityShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a1b6e1560c2aec259305c9361f8325bc72408c33 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/LuminosityShader.d.ts @@ -0,0 +1,10 @@ +import { IUniform } from "three"; + +export const LuminosityShader: { + name: string; + uniforms: { + tDiffuse: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/MirrorShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/MirrorShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8b6a1d9d83f87221eafff03933fe4978ed8285c7 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/MirrorShader.d.ts @@ -0,0 +1,11 @@ +import { IUniform } from "three"; + +export const MirrorShader: { + name: string; + uniforms: { + tDiffuse: IUniform; + side: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/NormalMapShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/NormalMapShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dd17abff5ac89ac95ebb4d52a85a1c5d2c6be82c --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/NormalMapShader.d.ts @@ -0,0 +1,13 @@ +import { IUniform } from "three"; + +export const NormalMapShader: { + name: string; + uniforms: { + heightMap: IUniform; + resolution: IUniform; + scale: IUniform; + height: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/OutputShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/OutputShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..461b1c17fc11d66cdfdaf0f286147594d6bb5625 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/OutputShader.d.ts @@ -0,0 +1,11 @@ +import { IUniform } from "three"; + +export const OutputShader: { + name: string; + uniforms: { + tDiffuse: IUniform; + toneMappingExposure: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/PoissonDenoiseShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/PoissonDenoiseShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..26b720d64907fc55a3ce390150003ec0073753a2 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/PoissonDenoiseShader.d.ts @@ -0,0 +1,28 @@ +import { IUniform, Matrix4, Vector2 } from "three"; + +export const PoissonDenoiseShader: { + name: string; + defines: { + SAMPLES: number; + SAMPLE_VECTORS: string; + NORMAL_VECTOR_TYPE: number; + DEPTH_VALUE_SOURCE: number; + }; + uniforms: { + tDiffuse: IUniform; + tNormal: IUniform; + tDepth: IUniform; + tNoise: IUniform; + resolution: IUniform; + cameraProjectionMatrixInverse: IUniform; + lumaPhi: IUniform; + depthPhi: IUniform; + normalPhi: IUniform; + radius: IUniform; + index: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; + +export function generatePdSamplePointInitializer(samples: number, rings: number, radiusExponent: number): string; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/RGBShiftShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/RGBShiftShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c40c313c45d126d8819c4ed83faf1435433447e1 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/RGBShiftShader.d.ts @@ -0,0 +1,11 @@ +import { IUniform } from "three"; + +export const RGBShiftShader: { + uniforms: { + tDiffuse: IUniform; + amount: IUniform; + angle: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/SAOShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/SAOShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..887cdc737fbe2345b1930cb901e0c59f7087074c --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/SAOShader.d.ts @@ -0,0 +1,29 @@ +import { IUniform } from "three"; + +export const SAOShader: { + name: string; + defines: { + NUM_SAMPLES: number; + NUM_RINGS: number; + DIFFUSE_TEXTURE: number; + PERSPECTIVE_CAMERA: number; + }; + uniforms: { + tDepth: IUniform; + tDiffuse: IUniform; + tNormal: IUniform; + size: IUniform; + cameraNear: IUniform; + cameraFar: IUniform; + cameraProjectionMatrix: IUniform; + cameraInverseProjectionMatrix: IUniform; + scale: IUniform; + intensity: IUniform; + bias: IUniform; + minResolution: IUniform; + kernelRadius: IUniform; + randomSeed: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/SMAAShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/SMAAShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7ffa361ce2484efe47b70b7c9367460c384b1042 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/SMAAShader.d.ts @@ -0,0 +1,43 @@ +import { IUniform } from "three"; + +export const SMAAEdgesShader: { + name: string; + defines: { + SMAA_THRESHOLD: string; + }; + uniforms: { + tDiffuse: IUniform; + resolution: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; + +export const SMAAWeightsShader: { + name: string; + defines: { + SMAA_MAX_SEARCH_STEPS: string; + SMAA_AREATEX_MAX_DISTANCE: string; + SMAA_AREATEX_PIXEL_SIZE: string; + SMAA_AREATEX_SUBTEX_SIZE: string; + }; + uniforms: { + tDiffuse: IUniform; + tArea: IUniform; + tSearch: IUniform; + resolution: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; + +export const SMAABlendShader: { + name: string; + uniforms: { + tDiffuse: IUniform; + tColor: IUniform; + resolution: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/SSAOShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/SSAOShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1fd274a225365ae116453b5e8a5267fc91762c54 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/SSAOShader.d.ts @@ -0,0 +1,49 @@ +import { IUniform } from "three"; + +export const SSAOShader: { + name: string; + defines: { + PERSPECTIVE_CAMERA: number; + KERNEL_SIZE: number; + }; + uniforms: { + tNormal: IUniform; + tDepth: IUniform; + tNoise: IUniform; + kernel: IUniform; + cameraNear: IUniform; + cameraFar: IUniform; + resolution: IUniform; + cameraProjectionMatrix: IUniform; + cameraInverseProjectionMatrix: IUniform; + kernelRadius: IUniform; + minDistance: IUniform; + maxDistance: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; + +export const SSAODepthShader: { + name: string; + defines: { + PERSPECTIVE_CAMERA: number; + }; + uniforms: { + tDepth: IUniform; + cameraNear: IUniform; + cameraFar: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; + +export const SSAOBlurShader: { + name: string; + uniforms: { + tDiffuse: IUniform; + resolution: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/SSRShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/SSRShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..66313b796e9246402a28404ebe0cd5232db619df --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/SSRShader.d.ts @@ -0,0 +1,62 @@ +import { IUniform, Matrix4, Texture, Vector2 } from "three"; +/** + * References: + * https://lettier.github.io/3d-game-shaders-for-beginners/screen-space-reflection.html + */ + +export const SSRShader: SSRShader; +export interface SSRShader { + name: string; + defines: { + MAX_STEP: number; + isPerspectiveCamera: boolean; + isDistanceAttenuation: boolean; + isFresnel: boolean; + isInfiniteThick: boolean; + isSelective: boolean; + }; + uniforms: { + tDiffuse: IUniform; + tNormal: IUniform; + tMetalness: IUniform; + tDepth: IUniform; + cameraNear: IUniform; + cameraFar: IUniform; + resolution: IUniform; + cameraProjectionMatrix: IUniform; + cameraInverseProjectionMatrix: IUniform; + opacity: IUniform; + maxDistance: IUniform; + cameraRange: IUniform; + thickness: IUniform; + }; + vertexShader: string; + fragmentShader: string; +} + +export const SSRDepthShader: SSRDepthShader; +export interface SSRDepthShader { + name: string; + defines: { + PERSPECTIVE_CAMERA: number; + }; + uniforms: { + tDepth: IUniform; + cameraNear: IUniform; + cameraFar: IUniform; + }; + vertexShader: string; + fragmentShader: string; +} + +export const SSRBlurShader: SSRBlurShader; +export interface SSRBlurShader { + name: string; + uniforms: { + tDiffuse: IUniform; + resolution: IUniform; + opacity: IUniform; + }; + vertexShader: string; + fragmentShader: string; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/SepiaShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/SepiaShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2cc9e3068d75dd2d310ad618ffc73a41875092ae --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/SepiaShader.d.ts @@ -0,0 +1,10 @@ +import { IUniform } from "three"; + +export const SepiaShader: { + uniforms: { + tDiffuse: IUniform; + amount: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/SobelOperatorShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/SobelOperatorShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..db7cc997de7dedb5fd29a44e03e14f3b68532cb6 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/SobelOperatorShader.d.ts @@ -0,0 +1,11 @@ +import { IUniform } from "three"; + +export const SobelOperatorShader: { + name: string; + uniforms: { + tDiffuse: IUniform; + resolution: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/SubsurfaceScatteringShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/SubsurfaceScatteringShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..83c9f458f5425220a063a0cb5a1ace4b849e17e0 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/SubsurfaceScatteringShader.d.ts @@ -0,0 +1,38 @@ +import { IUniform } from "three"; + +export const SubsurfaceScatteringShader: { + name: string; + uniforms: { + alphaMap: IUniform; + ambientLightColor: IUniform; + color: IUniform; + diffuse: IUniform; + directionalLights: IUniform; + directionalShadowMap: IUniform; + directionalShadowMatrix: IUniform; + emissive: IUniform; + hemisphereLights: IUniform; + lightProbe: IUniform; + map: IUniform; + opacity: IUniform; + pointLights: IUniform; + pointShadowMap: IUniform; + pointShadowMatrix: IUniform; + rectAreaLights: IUniform; + shininess: IUniform; + specular: IUniform; + spotLights: IUniform; + spotShadowMap: IUniform; + spotShadowMatrix: IUniform; + thicknessAmbient: IUniform; + thicknessAttenuation: IUniform; + thicknessColor: IUniform; + thicknessDistortion: IUniform; + thicknessMap: IUniform; + thicknessPower: IUniform; + thicknessScale: IUniform; + uvTransform: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/TechnicolorShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/TechnicolorShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..953b88d87b9ed5fc22ed711dafdb7e6794e4859f --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/TechnicolorShader.d.ts @@ -0,0 +1,10 @@ +import { IUniform } from "three"; + +export const TechnicolorShader: { + name: string; + uniforms: { + tDiffuse: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/ToonShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/ToonShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f11aee4c06243dddbbc0eec57094aedc3074d722 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/ToonShader.d.ts @@ -0,0 +1,54 @@ +import { IUniform } from "three"; + +export const ToonShader1: { + uniforms: { + uDirLightPos: IUniform; + uDirLightColor: IUniform; + uAmbientLightColor: IUniform; + uBaseColor: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; + +export const ToonShader2: { + uniforms: { + uDirLightPos: IUniform; + uDirLightColor: IUniform; + uAmbientLightColor: IUniform; + uBaseColor: IUniform; + uLineColor1: IUniform; + uLineColor2: IUniform; + uLineColor3: IUniform; + uLineColor4: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; + +export const ToonShaderHatching: { + uniforms: { + uDirLightPos: IUniform; + uDirLightColor: IUniform; + uAmbientLightColor: IUniform; + uBaseColor: IUniform; + uLineColor1: IUniform; + uLineColor2: IUniform; + uLineColor3: IUniform; + uLineColor4: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; + +export const ToonShaderDotted: { + uniforms: { + uDirLightPos: IUniform; + uDirLightColor: IUniform; + uAmbientLightColor: IUniform; + uBaseColor: IUniform; + uLineColor1: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/TriangleBlurShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/TriangleBlurShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8c83f7d112d16ba54a14cd5925627647f623c3a3 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/TriangleBlurShader.d.ts @@ -0,0 +1,11 @@ +import { IUniform } from "three"; + +export const TriangleBlurShader: { + name: string; + uniforms: { + texture: IUniform; + delta: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/UnpackDepthRGBAShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/UnpackDepthRGBAShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6657e6549dc3f9ff427d9415419bc7f0ecefb411 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/UnpackDepthRGBAShader.d.ts @@ -0,0 +1,11 @@ +import { IUniform } from "three"; + +export const UnpackDepthRGBAShader: { + name: string; + uniforms: { + tDiffuse: IUniform; + opacity: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/VelocityShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/VelocityShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6c3516a276ac14a38ce7373b390b8f9ef8dda483 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/VelocityShader.d.ts @@ -0,0 +1,16 @@ +import { IUniform, UniformsLib } from "three"; + +export const VelocityShader: { + name: string; + uniforms: + & (typeof UniformsLib)["common"] + & (typeof UniformsLib)["displacementmap"] + & { + modelMatrixPrev: IUniform; + currentProjectionViewMatrix: IUniform; + previousProjectionViewMatrix: IUniform; + }; + + fragmentShader: string; + vertexShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/VerticalBlurShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/VerticalBlurShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..efd33c4de11ec200edfd004a54cbd2d73f6ee93b --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/VerticalBlurShader.d.ts @@ -0,0 +1,10 @@ +import { IUniform } from "three"; + +export const VerticalBlurShader: { + uniforms: { + tDiffuse: IUniform; + v: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/VerticalTiltShiftShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/VerticalTiltShiftShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..30a7dd97fd1f8c0078f365ab911c6e0a0c845815 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/VerticalTiltShiftShader.d.ts @@ -0,0 +1,12 @@ +import { IUniform } from "three"; + +export const VerticalTiltShiftShader: { + name: string; + uniforms: { + tDiffuse: IUniform; + v: IUniform; + r: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/VignetteShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/VignetteShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4fa814543d1450536177914f8f1dbd78df2b5c19 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/VignetteShader.d.ts @@ -0,0 +1,11 @@ +import { IUniform } from "three"; + +export const VignetteShader: { + uniforms: { + tDiffuse: IUniform; + offset: IUniform; + darkness: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/VolumeShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/VolumeShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..15c3e041b49b4ff5974ec53e6a7eca076b333994 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/VolumeShader.d.ts @@ -0,0 +1,14 @@ +import { IUniform } from "three"; + +export const VolumeRenderShader1: { + uniforms: { + u_size: IUniform; + u_renderstyle: IUniform; + u_renderthreshold: IUniform; + u_clim: IUniform; + u_data: IUniform; + u_cmdata: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/WaterRefractionShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/WaterRefractionShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1dcdc5f610c616b57451b5b3d43c87ab02f1fef2 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/shaders/WaterRefractionShader.d.ts @@ -0,0 +1,14 @@ +import { IUniform } from "three"; + +export const WaterRefractionShader: { + name: string; + uniforms: { + color: IUniform; + time: IUniform; + tDiffuse: IUniform; + tDudv: IUniform; + textureMatrix: IUniform; + }; + vertexShader: string; + fragmentShader: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/textures/FlakesTexture.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/textures/FlakesTexture.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c1ccd17ee2d1229a97e031bb09921f84ad00ae96 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/textures/FlakesTexture.d.ts @@ -0,0 +1,3 @@ +export class FlakesTexture extends HTMLCanvasElement { + constructor(width?: number, height?: number); +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/transpiler/AST.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/transpiler/AST.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3e024f420783ff6ea51a0729f82e2394d8ddbd3f --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/transpiler/AST.d.ts @@ -0,0 +1,275 @@ +export class Comment { + constructor(comment: string); + + comment: string; + + readonly isComment: true; +} + +export class Program { + constructor(body?: Statement[]); + + body: Statement[]; + + readonly isProgram: true; +} + +// Boolean seems to be handled as a Unary +export type Statement = + | VariableDeclaration + | Uniform + | Varying + | FunctionParameter + | FunctionDeclaration + | Expression + | Ternary + | Operator + | Unary + | Number + | String + | Conditional + | FunctionCall + | Return + | Discard + | Continue + | Break + | Accessor + | StaticElement + | DynamicElement + | AccessorElements + | For + | While + | Switch + | SwitchCase + | null; + +export class VariableDeclaration { + constructor( + type: string, + name: string, + value?: Accessor | null, + next?: VariableDeclaration | null, + immutable?: boolean, + ); + + type: string; + name: string; + value: Accessor | null; + next: VariableDeclaration | null; + + immutable: boolean; + + readonly isVariableDeclaration: true; +} + +export class Uniform { + constructor(type: string, name: string); + + type: string; + name: string; + + readonly isUniform: true; +} + +export class Varying { + constructor(type: string, name: string); + + type: string; + name: string; + + readonly isVarying: true; +} + +export class FunctionParameter { + constructor(type: string, name: string, qualifier?: string | null, immutable?: boolean); + + type: string; + name: string; + qualifier: string | null; + immutable: boolean; + + readonly isFunctionParameter: true; +} + +export class FunctionDeclaration { + constructor(type: string, name: string, params?: FunctionParameter[], body?: Statement[]); + + type: string; + name: string; + params: FunctionParameter[]; + body: Statement[]; + + readonly isFunctionDeclaration: true; +} + +export class Expression { + constructor(expression: string); + + expression: string; + + readonly isExpression: true; +} + +export class Ternary { + constructor(cond: Statement, left: Statement, right: Statement); + + cond: Statement; + left: Statement; + right: Statement; + + readonly isTernary: true; +} + +export class Operator { + constructor(type: string, left: Statement, right: Statement); + + type: string; + left: Statement; + right: Statement; + + readonly isOperator: true; +} + +export class Unary { + constructor(type: string, expression: Statement, after?: boolean); + + type: string; + expression: Statement; + after: boolean; + + readonly isUnary: true; +} + +export class Number { + constructor(value: string, type?: string); + + type: string; + value: string; + + readonly isNumber: true; +} + +export class String { + constructor(value: string); + + value: string; + + readonly isString: true; +} + +export class Conditional { + constructor(cond?: Conditional | null, body?: Statement[]); + + cond: Conditional | null; + body: Statement[]; + elseConditional: Conditional | null; + + readonly isConditional: true; +} + +export class FunctionCall { + constructor(name: string, params?: Statement[]); + + name: string; + params: Statement[]; + + readonly isFunctionCall: true; +} + +export class Return { + constructor(value: Statement); + + value: Statement; + + readonly isReturn: true; +} + +export class Discard { + constructor(); + + readonly isDiscard: true; +} + +export class Continue { + constructor(); + + readonly isContinue: true; +} + +export class Break { + constructor(); + + readonly isBreak: true; +} + +export class Accessor { + constructor(property: string); + + property: string; + + readonly isAccessor: true; +} + +export class StaticElement { + constructor(value: Statement); + + value: Statement; + + readonly isStaticElement: true; +} + +export class DynamicElement { + constructor(value: Statement); + + value: Statement; + + readonly isDynamicElement: true; +} + +export class AccessorElements { + constructor(object: FunctionCall | Accessor, elements?: (StaticElement | DynamicElement)[]); + + object: FunctionCall | Accessor; + elements: (StaticElement | DynamicElement)[]; + + readonly isAccessorElements: true; +} + +export class For { + constructor(initialization: Statement, condition: Statement, afterthought: Statement, body?: Statement[]); + + initialization: Statement; + condition: Statement; + afterthought: Statement; + body: Statement[]; + + readonly isFor: true; +} + +export class While { + constructor(condition: Statement, body?: Statement[]); + + condition: Statement; + body: Statement[]; + + readonly isWhile: true; +} + +export class Switch { + constructor(discriminant: Statement, cases: Statement[]); + + discriminant: Statement; + cases: Statement[]; + + readonly isSwitch: true; +} + +export class SwitchCase { + constructor(body: Statement, conditions?: Statement[] | null); + + body: Statement[]; + conditions: Statement[]; + + isDefault: boolean; + readonly isSwitchCase: true; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/transpiler/GLSLDecoder.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/transpiler/GLSLDecoder.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c19cb148fadcb9ae623384eaeeaae77c89699c51 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/transpiler/GLSLDecoder.d.ts @@ -0,0 +1,7 @@ +import { Program } from "./AST.js"; + +export default class GLSLDecoder { + constructor(); + + parse(source: string): Program; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/transpiler/ShaderToyDecoder.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/transpiler/ShaderToyDecoder.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c5ac449a73b52e262170e8221988fee793a34e05 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/transpiler/ShaderToyDecoder.d.ts @@ -0,0 +1,3 @@ +import GLSLDecoder from "./GLSLDecoder.js"; + +export default class ShaderToyDecoder extends GLSLDecoder {} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/transpiler/TSLEncoder.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/transpiler/TSLEncoder.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4fea0266925fa804f3c104c789bd84652efd44db --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/transpiler/TSLEncoder.d.ts @@ -0,0 +1,47 @@ +import { + Comment, + Conditional, + Expression, + For, + FunctionDeclaration, + Program, + Statement, + Switch, + Ternary, + Uniform, + VariableDeclaration, + Varying, + While, +} from "./AST.js"; + +export default class TSLEncoder { + constructor(); + + tab: string; + imports: Set; + global: Set; + overloadings: Map; + iife: boolean; + reference: boolean; + block: Statement | null; + + addImport(name: string): void; + emitUniform(node: Uniform): string; + emitExpression(node: Expression, output?: string | null): string; + emitBody(body: Statement[]): string; + emitTernary(node: Ternary): string; + emitConditional(node: Conditional): string; + emitLoop(node: For): string; + emitSwitch(switchNode: Switch): string; + emitFor(node: For): string; + emitForWhile(node: For): string; + emitWhile(node: While): string; + emitVariables(node: VariableDeclaration, isRoot?: boolean): string; + emitVarying(node: Varying): string; + emitOverloadingFunction(nodes: FunctionDeclaration[]): string; + emitFunction(node: FunctionDeclaration): string; + setLastStatement(statement: Statement | null): void; + emitComment(statement: Comment, body: Statement[]): string; + emitExtraLine(statement: Statement, body: Statement[]): string; + emit(ast: Program): string; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/transpiler/Transpiler.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/transpiler/Transpiler.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4e4f4dbe76c314fafdae3c7234f9e3d90607d475 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/transpiler/Transpiler.d.ts @@ -0,0 +1,5 @@ +export default class Transpiler { + constructor(decoder: { parse(source: string): U }, encoder: { emit(decoded: U): V }); + + parse(source: string): V; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/AfterImageNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/AfterImageNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2a0939abd851a3d055a5212bea4ad2f578667b0b --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/AfterImageNode.d.ts @@ -0,0 +1,16 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Node, TempNode, TextureNode, UniformNode } from "three/webgpu"; + +export default class AfterImageNode extends TempNode { + textureNode: TextureNode; + textureNodeOld: Node; + damp: UniformNode; + + constructor(textureNode: Node, damp?: number); + + getTextureNode(): TextureNode; + + setSize(width: number, height: number): void; +} + +export const afterImage: (node: Node, damp?: number) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/AnaglyphPassNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/AnaglyphPassNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9c457e93fa1c887084e9c90764e695537104cd4d --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/AnaglyphPassNode.d.ts @@ -0,0 +1,13 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Camera, Scene } from "three/webgpu"; +import StereoCompositePassNode from "./StereoCompositePassNode.js"; + +declare class AnaglyphPassNode extends StereoCompositePassNode { + readonly isAnaglyphPassNode: true; + + constructor(scene: Scene, camera: Camera); +} + +export default AnaglyphPassNode; + +export const anaglyphPass: (scene: Scene, camera: Camera) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/AnamorphicNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/AnamorphicNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..26c8fc804883ef7d3d943f21aff26aef8e7fd90d --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/AnamorphicNode.d.ts @@ -0,0 +1,32 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Node, TempNode, Vector2 } from "three/webgpu"; + +export default class AnamorphicNode extends TempNode { + textureNode: Node; + thresholdNode: Node; + scaleNode: Node; + samples: number; + resolutionScale: number; + + constructor(textureNode: Node, thresholdNode: Node, scaleNode: Node, samples: number); + + getTextureNode(): Node; + + setSize(width: number, height: number): void; + + /** + * @deprecated The "resolution" property has been renamed to "resolutionScale" and is now of type `number`. + */ + get resolution(): Vector2; + /** + * @deprecated The "resolution" property has been renamed to "resolutionScale" and is now of type `number`. + */ + set resolution(value: Vector2); +} + +export const anamorphic: ( + node: Node, + threshold?: Node, + scale?: Node, + samples?: Node | number, +) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/BleachBypass.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/BleachBypass.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..588a529f2ac90658ec4337444a308d6c6ba25580 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/BleachBypass.d.ts @@ -0,0 +1,4 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Node } from "three/webgpu"; + +export const bleach: (color: Node, opacity?: number) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/BloomNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/BloomNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..18fd8e53f9a8fc576238cc3b785a1643a1bfec89 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/BloomNode.d.ts @@ -0,0 +1,26 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Node, TempNode, TextureNode, UniformNode } from "three/webgpu"; + +declare class BloomNode extends TempNode { + inputNode: Node; + strength: UniformNode; + radius: UniformNode; + threshold: UniformNode; + + smoothWidth: UniformNode; + + constructor(inputNode: Node, strength?: number, radius?: number, threshold?: number); + + getTexture(): ShaderNodeObject; + + setSize(width: number, height: number): void; +} + +export const bloom: ( + node: Node, + strength?: number, + radius?: number, + threshold?: number, +) => ShaderNodeObject; + +export default BloomNode; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/ChromaticAberrationNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/ChromaticAberrationNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d55a7c263092e69060ed7bf34eb75f762c539613 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/ChromaticAberrationNode.d.ts @@ -0,0 +1,20 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Node, TempNode, Vector2 } from "three/webgpu"; + +declare class ChromaticAberrationNode extends TempNode { + textureNode: Node; + strengthNode: Node; + centerNode: Node; + scaleNode: Node; + + constructor(textureNode: Node, strengthNode: Node, centerNode: Node, scaleNode: Node); +} + +export default ChromaticAberrationNode; + +export const chromaticAberration: ( + node: Node, + strength?: Node, + center?: Node | Vector2 | null, + scale?: Node, +) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/DenoiseNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/DenoiseNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e8018c8f73943b113baf0ac1bfc5ea70252170ef --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/DenoiseNode.d.ts @@ -0,0 +1,27 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Camera, Node, TempNode, UniformNode } from "three/webgpu"; + +declare class DenoiseNode extends TempNode { + textureNode: Node; + depthNode: Node; + normalNode: Node; + + noiseNode: Node; + + lumaPhi: UniformNode; + depthPhi: UniformNode; + normalPhi: UniformNode; + radius: UniformNode; + index: UniformNode; + + constructor(textureNode: Node, depthNode: Node, normalNode: Node, noiseNode: Node, camera: Camera); +} + +export default DenoiseNode; + +export const denoise: ( + node: Node, + depthNode: Node, + normalNode: Node, + camera: Camera, +) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/DepthOfFieldNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/DepthOfFieldNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..80f9a065e4bea0f78c946fe1b1d810edc6bd8904 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/DepthOfFieldNode.d.ts @@ -0,0 +1,29 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Node, TempNode, TextureNode } from "three/webgpu"; + +declare class DepthOfFieldNode extends TempNode { + textureNode: TextureNode; + viewZNode: Node; + + focusDistanceNode: Node; + focalLengthNode: Node; + bokehScaleNode: Node; + + constructor( + textureNode: TextureNode, + viewZNode: Node, + focusDistanceNode: Node, + focalLengthNode: Node, + bokehScaleNode: Node, + ); +} + +export default DepthOfFieldNode; + +export const dof: ( + node: Node, + viewZNode: Node, + focusDistance?: Node | number, + focalLength?: Node | number, + bokehScale?: Node | number, +) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/DotScreenNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/DotScreenNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2a502d510671ae1d48c91c653edfa258ddac8f1a --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/DotScreenNode.d.ts @@ -0,0 +1,20 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Node, TempNode, UniformNode, Vector2 } from "three/webgpu"; + +declare class DotScreenNode extends TempNode { + inputNode: Node; + center: UniformNode; + angle: UniformNode; + scale: UniformNode; + + constructor(inputNode: Node, center?: Vector2, angle?: number, scale?: number); +} + +export default DotScreenNode; + +export const dotScreen: ( + node: Node, + center?: Vector2, + angle?: number, + scale?: number, +) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/FXAANode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/FXAANode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cc522e34dba1be4f1487151397a4a440cca5fe69 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/FXAANode.d.ts @@ -0,0 +1,12 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Node, TempNode, TextureNode } from "three/webgpu"; + +declare class FXAANode extends TempNode { + textureNode: TextureNode; + + constructor(textureNode: TextureNode); +} + +export default FXAANode; + +export const fxaa: (node: Node) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/FilmNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/FilmNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5a1a59dfa9294a8afbfe442bb3f015f1206e8f51 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/FilmNode.d.ts @@ -0,0 +1,18 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Node, TempNode } from "three/webgpu"; + +declare class FilmNode extends TempNode { + inputNode: Node; + intensityNode: Node | null; + uvNode: Node | null; + + constructor(inputNode: Node, intensityNode?: Node | null, uvNode?: Node | null); +} + +export default FilmNode; + +export const film: ( + inputNode: Node, + intensityNode?: Node | null, + uvNode?: Node | null, +) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/GTAONode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/GTAONode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6bb28dcd63f9412e37a2e20d9493ab5b5f9a7bbe --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/GTAONode.d.ts @@ -0,0 +1,31 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Camera, Node, TempNode, TextureNode, UniformNode, Vector2 } from "three/webgpu"; + +declare class GTAONode extends TempNode { + depthNode: Node; + normalNode: Node; + + resolutionScale: number; + + radius: ShaderNodeObject>; + resolution: ShaderNodeObject>; + thickness: ShaderNodeObject>; + distanceExponent: ShaderNodeObject>; + distanceFallOff: ShaderNodeObject>; + scale: ShaderNodeObject>; + samples: ShaderNodeObject>; + + constructor(depthNode: Node, normalNode: Node, camera: Camera); + + getTextureNode(): ShaderNodeObject; + + setSize(width: number, height: number): void; +} + +export default GTAONode; + +export const ao: ( + depthNode: Node, + normalNode: Node, + camera: Camera, +) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/GaussianBlurNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/GaussianBlurNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..39842fe2386ceffc0515ac5b0ac20bdba85c8551 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/GaussianBlurNode.d.ts @@ -0,0 +1,55 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Node, TempNode, TextureNode, Vector2 } from "three/webgpu"; + +export interface GaussianBlurNodeOptions { + premultipliedAlpha?: boolean | undefined; + resolution?: Vector2 | undefined; +} + +declare class GaussianBlurNode extends TempNode { + textureNode: TextureNode; + directionNode: Node | null; + sigma: number; + + resolutionScale: number; + + premultipliedAlpha: boolean; + + constructor( + textureNode: TextureNode, + directionNode?: Node | null, + sigma?: number, + options?: GaussianBlurNodeOptions, + ); + + setSize(width: number, height: number): void; + + getTextureNode(): TextureNode; + + /** + * @deprecated The "resolution" property has been renamed to "resolutionScale" and is now of type `number`. + */ + get resolution(): Vector2; + /** + * @deprecated The "resolution" property has been renamed to "resolutionScale" and is now of type `number`. + */ + set resolution(value: Vector2); +} + +export default GaussianBlurNode; + +export const gaussianBlur: ( + node: Node, + directionNode?: Node | number | null, + sigma?: number, + options?: GaussianBlurNodeOptions, +) => ShaderNodeObject; + +/** + * @deprecated "premultipliedGaussianBlur()" is deprecated. Use "gaussianBlur()" with "premultipliedAlpha: true" option instead. + */ +export const premultipliedGaussianBlur: ( + node: Node, + directionNode?: Node | number | null, + sigma?: number, +) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/LensflareNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/LensflareNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e298b2719adc113004f250c8f097b99461074df7 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/LensflareNode.d.ts @@ -0,0 +1,35 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Node, TempNode, TextureNode, UniformNode, Vector3 } from "three/webgpu"; + +interface LensflareNodeParams { + ghostTint?: Node | undefined; + threshold?: Node | undefined; + ghostSamples?: Node | undefined; + ghostSpacing?: Node | undefined; + ghostAttenuationFactor?: Node | undefined; + downSampleRatio?: number | undefined; +} + +declare class LensflareNode extends TempNode { + textureNode: TextureNode; + + ghostTintNode: ShaderNodeObject>; + thresholdNode: ShaderNodeObject>; + ghostSamplesNode: ShaderNodeObject>; + ghostSpacingNode: ShaderNodeObject>; + ghostAttenuationFactorNode: ShaderNodeObject>; + downSampleRatio: number; + + constructor(textureNode: TextureNode, params?: LensflareNodeParams); + + getTextureNode(): TextureNode; + + setSize(width: number, height: number): void; +} + +export default LensflareNode; + +export const lensflare: ( + inputNode: Node, + params?: LensflareNodeParams, +) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/Lut3DNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/Lut3DNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8e1d0342e6731eea1f693ca306c8a2e465bc597c --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/Lut3DNode.d.ts @@ -0,0 +1,20 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Data3DTexture, Node, TempNode, Texture3DNode, UniformNode } from "three/webgpu"; + +declare class Lut3DNode extends TempNode { + inputNode: Node; + lutNode: Texture3DNode; + size: ShaderNodeObject>; + intensityNode: UniformNode; + + constructor(inputNode: Node, lutNode: UniformNode, size: number, intensityNode: UniformNode); +} + +export default Lut3DNode; + +export const lut3D: ( + node: Node, + lut: Node, + size: number, + intensity: Node, +) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/MotionBlur.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/MotionBlur.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bf04eb51fcb8770d41d022ce6f6641ba146b4a15 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/MotionBlur.d.ts @@ -0,0 +1,8 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Node } from "three/webgpu"; + +export const motionBlur: ( + inputNode: Node, + velocity: Node, + numSamples?: Node, +) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/OutlineNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/OutlineNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2860824e2b45251d72c1b0e3fb25664164523972 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/OutlineNode.d.ts @@ -0,0 +1,32 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Camera, Node, Object3D, Scene, TempNode, TextureNode, UniformNode } from "three/webgpu"; + +export interface OutlineNodeParams { + selectedObjects?: Object3D[] | undefined; + edgeThickness?: Node | undefined; + edgeGlow?: Node | undefined; + downSampleRatio?: number | undefined; +} + +declare class OutlineNode extends TempNode { + scene: Scene; + camera: Camera; + selectedObjects: Object3D[]; + edgeThicknessNode: ShaderNodeObject>; + edgeGlowNode: ShaderNodeObject>; + downSampleRatio: number; + + constructor(scene: Scene, camera: Camera, params?: OutlineNodeParams); + + get visibleEdge(): ShaderNodeObject; + + get hiddenEdge(): ShaderNodeObject; + + getTextureNode(): ShaderNodeObject; + + setSize(width: number, height: number): void; +} + +export default OutlineNode; + +export const outline: (scene: Scene, camera: Camera, params?: OutlineNodeParams) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/ParallaxBarrierPassNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/ParallaxBarrierPassNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..92517d6866f4d6e5495791a3a9fa632fe56f86dc --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/ParallaxBarrierPassNode.d.ts @@ -0,0 +1,13 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Camera, Scene } from "three/webgpu"; +import StereoCompositePassNode from "./StereoCompositePassNode.js"; + +declare class ParallaxBarrierPassNode extends StereoCompositePassNode { + readonly isParallaxBarrierPassNode: true; + + constructor(scene: Scene, camera: Camera); +} + +export default ParallaxBarrierPassNode; + +export const parallaxBarrierPass: (scene: Scene, camera: Camera) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/PixelationPassNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/PixelationPassNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..225675c4efbff32bd4a1ea45f5f7538eedf40c10 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/PixelationPassNode.d.ts @@ -0,0 +1,28 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Camera, PassNode, Scene, UniformNode } from "three/webgpu"; + +declare class PixelationPassNode extends PassNode { + pixelSize: UniformNode; + normalEdgeStrength: UniformNode; + depthEdgeStrength: UniformNode; + + readonly isPixelationPassNode: true; + + constructor( + scene: Scene, + camera: Camera, + pixelSize: number, + normalEdgeStrength: number, + depthEdgeStrength: number, + ); +} + +export const pixelationPass: ( + scene: Scene, + camera: Camera, + pixelSize: UniformNode, + normalEdgeStrength: UniformNode, + depthEdgeStrength: UniformNode, +) => ShaderNodeObject; + +export default PixelationPassNode; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/RGBShiftNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/RGBShiftNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5570ed3a834d9fa13d85dbb619f9c138a09adc54 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/RGBShiftNode.d.ts @@ -0,0 +1,16 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Node, TempNode, TextureNode, UniformNode } from "three/webgpu"; + +export default class RGBShiftNode extends TempNode { + textureNode: TextureNode; + amount: UniformNode; + angle: UniformNode; + + constructor(textureNode: TextureNode, amount?: number, angle?: number); + + getTextureNode(): TextureNode; + + setSize(width: number, height: number): void; +} + +export const rgbShift: (node: Node, amount?: number, angle?: number) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/SMAANode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/SMAANode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d17edca57271d5af92b92253bc19e79112d2ac21 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/SMAANode.d.ts @@ -0,0 +1,18 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Node, TempNode, TextureNode } from "three/webgpu"; + +declare class SMAANode extends TempNode { + textureNode: TextureNode; + + constructor(textureNode: TextureNode); + + getTextureNode(): TextureNode; + + setSize(width: number, height: number): void; + + getAreaTexture(): string; + + getSearchTexture(): string; +} + +export const smaa: (node: Node) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/SSAAPassNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/SSAAPassNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..80dfebbf7922c78ef873f9940f21eef916512a57 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/SSAAPassNode.d.ts @@ -0,0 +1,21 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Camera, Color, PassNode, RenderTarget, Scene, UniformNode } from "three/webgpu"; + +declare class SSAAPassNode extends PassNode { + readonly isSSAAPassNode: boolean; + + sampleLevel: number; + unbiased: boolean; + clearColor: Color; + clearAlpha: number; + + sampleWeight: UniformNode; + + sampleRenderTarget: RenderTarget | null; + + constructor(scene: Scene, camera: Camera); +} + +export default SSAAPassNode; + +export const ssaaPass: (scene: Scene, camera: Camera) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/SSRNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/SSRNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dc10791d7332f0026b8205ad6cb3f254fdd4085d --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/SSRNode.d.ts @@ -0,0 +1,43 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Camera, Node, TempNode, TextureNode, UniformNode } from "three/webgpu"; + +declare class SSRNode extends TempNode { + colorNode: ShaderNodeObject; + depthNode: ShaderNodeObject; + normalNode: ShaderNodeObject; + metalnessNode: ShaderNodeObject; + roughnessNode: ShaderNodeObject | null; + camera: Camera | null; + + resolutionScale: number; + + maxDistance: UniformNode; + thickness: UniformNode; + opacity: UniformNode; + quality: UniformNode; + blurQuality: UniformNode; + + constructor( + colorNode: ShaderNodeObject, + depthNode: ShaderNodeObject, + normalNode: ShaderNodeObject, + metalnessNode: ShaderNodeObject, + roughnessNode?: ShaderNodeObject | null, + camera?: Camera | null, + ); + + getTextureNode(): ShaderNodeObject; + + setSize(width: number, height: number): void; +} + +export default SSRNode; + +export const ssr: ( + colorNode: Node, + depthNode: Node, + normalNode: Node, + metalnessNode: Node, + roughnessNode?: Node | null, + camera?: Camera | null, +) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/Sepia.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/Sepia.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d0e940ad78cf6984cee39915f8842995432ace5a --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/Sepia.d.ts @@ -0,0 +1,4 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Node } from "three/webgpu"; + +export const sepia: (color: Node) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/SobelOperatorNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/SobelOperatorNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c8aef432b86065440373aa12d90bcd1ef1c2e399 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/SobelOperatorNode.d.ts @@ -0,0 +1,12 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Node, TempNode, TextureNode } from "three/webgpu"; + +declare class SobelOperatorNode extends TempNode { + textureNode: TextureNode; + + constructor(textureNode: TextureNode); +} + +export default SobelOperatorNode; + +export const sobel: (node: Node) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/StereoCompositePassNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/StereoCompositePassNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3c4def779843db1368eef8bec7296742f7e8da43 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/StereoCompositePassNode.d.ts @@ -0,0 +1,13 @@ +import { Camera, CoordinateSystem, PassNode, Scene, StereoCamera } from "three/webgpu"; + +declare class StereoCompositePassNode extends PassNode { + readonly isStereoCompositePassNode: true; + + stereo: StereoCamera; + + constructor(scene: Scene, camera: Camera); + + updateStereoCamera(coordinateSystem: CoordinateSystem): void; +} + +export default StereoCompositePassNode; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/StereoPassNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/StereoPassNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b29f90f467181d10a2e88bf05438a3381094bfd8 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/StereoPassNode.d.ts @@ -0,0 +1,14 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Camera, PassNode, Scene, StereoCamera } from "three/webgpu"; + +declare class StereoPassNode extends PassNode { + readonly isStereoPassNode: true; + + stereo: StereoCamera; + + constructor(scene: Scene, camera: Camera); +} + +export default StereoPassNode; + +export const stereoPass: (scene: Scene, camera: Camera) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/TRAANode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/TRAANode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..97b18635631e393e71429683419fbf696c9842d6 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/TRAANode.d.ts @@ -0,0 +1,22 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Camera, Node, TempNode, TextureNode } from "three/webgpu"; + +declare class TRAANode extends TempNode { + readonly isTRAANode: true; + + beautyNode: TextureNode; + depthNode: TextureNode; + velocityNode: TextureNode; + camera: Camera; + + constructor(beautyNode: TextureNode, depthNode: TextureNode, velocityNode: TextureNode, camera: Camera); +} + +export default TRAANode; + +export const traa: ( + beautyNode: Node, + depthNode: TextureNode, + velocityNode: TextureNode, + camera: Camera, +) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/TransitionNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/TransitionNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..48ad52270029f11c7a0d38a105d7ccff829b3e74 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/TransitionNode.d.ts @@ -0,0 +1,32 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Node, TempNode, TextureNode, UniformNode } from "three/webgpu"; + +declare class TransitionNode extends TempNode { + textureNodeA: TextureNode; + textureNodeB: TextureNode; + mixTextureNode: TextureNode; + + mixRatioNode: Node; + thresholdNode: Node; + useTextureNode: Node; + + constructor( + textureNodeA: TextureNode, + textureNodeB: TextureNode, + mixTextureNode: TextureNode, + mixRatioNode: Node, + thresholdNode: Node, + useTextureNode: Node, + ); +} + +export default TransitionNode; + +export const transition: ( + node: Node, + nodeB: Node, + mixTexture: Node, + mixRatio: UniformNode, + threshold: UniformNode, + useTexture: UniformNode, +) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/boxBlur.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/boxBlur.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..aa57bc8e39bfff4826a1edad6f30a0c1a6fc416b --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/boxBlur.d.ts @@ -0,0 +1,11 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Node } from "three/webgpu"; + +export interface BoxBlurOptions { + size?: Node | undefined; + separation?: Node | undefined; + mask?: Node | null | undefined; + premultipliedAlpha?: boolean | undefined; +} + +export const boxBlur: (textureNode: Node, options?: BoxBlurOptions) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/hashBlur.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/hashBlur.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..461f0455f5a0c2ac5d1e8a4714e2122846324114 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/display/hashBlur.d.ts @@ -0,0 +1,14 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Node } from "three/webgpu"; + +interface HashBlurOptions { + size?: Node | undefined; + mask?: Node | null | undefined; + premultipliedAlpha?: boolean | undefined; +} + +export const hashBlur: ( + textureNode: Node, + bluramount?: Node | number, + options?: HashBlurOptions, +) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/lighting/TiledLightsNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/lighting/TiledLightsNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..118f1d0bbe9016e54b1920ce5e1dc004b87dc5c6 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/lighting/TiledLightsNode.d.ts @@ -0,0 +1,23 @@ +import { ShaderNodeObject } from "three/tsl"; +import { LightsNode, Node } from "three/webgpu"; + +export const circleIntersectsAABB: ( + circleCenter: Node, + radius: Node, + minBounds: Node, + maxBounds: Node, +) => ShaderNodeObject; + +declare class TiledLightsNode extends LightsNode { + constructor(maxLights?: number, tileSize?: number); + + updateLightsTexture(): void; + + getBlock(block?: number): ShaderNodeObject; + + setSize(width: number, height: number): this; +} + +export default TiledLightsNode; + +export const tiledLights: (maxLights?: number, tileSize?: number) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/math/Bayer.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/math/Bayer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dc4eda25406cb02bcad764a2dcbbf0ce3f88be6b --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/math/Bayer.d.ts @@ -0,0 +1,4 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Node } from "three/webgpu"; + +export const bayer16: (uv: Node) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/shadows/TileShadowNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/shadows/TileShadowNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fe0b6a9cbcb4405e564d6eb08f47cfd73ae92142 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/shadows/TileShadowNode.d.ts @@ -0,0 +1,14 @@ +import { Light, ShadowBaseNode } from "three/webgpu"; + +export interface TileShadeNodeConfig { + tilesX?: number | undefined; + tilesY?: number | undefined; + resolution?: { width: number; height: number }; + debug?: boolean | undefined; +} + +declare class TileShadowNode extends ShadowBaseNode { + constructor(light: Light, options?: TileShadeNodeConfig); +} + +export { TileShadowNode }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/shadows/TileShadowNodeHelper.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/shadows/TileShadowNodeHelper.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3f79053e6263925ece8ef46b92cfaa8905adb977 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/shadows/TileShadowNodeHelper.d.ts @@ -0,0 +1,14 @@ +import { Group } from "three/webgpu"; +import { TileShadowNode } from "./TileShadowNode.js"; + +declare class TileShadowNodeHelper extends Group { + constructor(tileShadowNode: TileShadowNode); + + init(): void; + + update(): void; + + dispose(): void; +} + +export { TileShadowNodeHelper }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/utils/Raymarching.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/utils/Raymarching.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..64927abde27433ce0a41881393f0f3621e1752b9 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/tsl/utils/Raymarching.d.ts @@ -0,0 +1,9 @@ +import { ShaderNodeObject } from "three/tsl"; +import { FunctionNode, Node } from "three/webgpu"; + +export const RaymarchingBox: ( + steps: number | Node, + callback: + | ((params: { positionRay: ShaderNodeObject }) => void) + | FunctionNode<{ positionRay: ShaderNodeObject }>, +) => void; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/BufferGeometryUtils.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/BufferGeometryUtils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..84ed0924a4fde8315a177f07711662508f6895bc --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/BufferGeometryUtils.d.ts @@ -0,0 +1,37 @@ +// https://threejs.org/docs/?q=buffergeome#examples/en/utils/BufferGeometryUtils + +import { + BufferAttribute, + BufferGeometry, + InterleavedBufferAttribute, + Line, + Mesh, + Points, + TrianglesDrawModes, +} from "three"; + +export function deepCloneAttribute(attribute: BufferAttribute): BufferAttribute; +export function mergeGeometries(geometries: BufferGeometry[], useGroups?: boolean): BufferGeometry; +export function mergeAttributes(attributes: BufferAttribute[]): BufferAttribute; +export function interleaveAttributes(attributes: BufferAttribute[]): InterleavedBufferAttribute; +export function estimateBytesUsed(geometry: BufferGeometry): number; +export function mergeVertices(geometry: BufferGeometry, tolerance?: number): BufferGeometry; +export function toTrianglesDrawMode(geometry: BufferGeometry, drawMode: TrianglesDrawModes): BufferGeometry; +export function computeMorphedAttributes(object: Mesh | Line | Points): object; +export function computeMikkTSpaceTangents( + geometry: BufferGeometry, + MikkTSpace: unknown, + negateSign?: boolean, +): BufferGeometry; +export function mergeGroups(geometry: BufferGeometry): BufferGeometry; +export function deinterleaveAttribute(geometry: BufferGeometry): void; +export function deinterleaveGeometry(geometry: BufferGeometry): void; + +/** + * Modifies the supplied geometry if it is non-indexed, otherwise creates a new, non-indexed geometry. Returns the + * geometry with smooth normals everywhere except faces that meet at an angle greater than the crease angle. + * + * @param geometry The input geometry. + * @param creaseAngle The crease angle in radians. + */ +export function toCreasedNormals(geometry: BufferGeometry, creaseAngle?: number): BufferGeometry; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/CameraUtils.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/CameraUtils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d42d02340a4f7c89ff22ef4794580f3087fc4fb0 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/CameraUtils.d.ts @@ -0,0 +1,9 @@ +import { PerspectiveCamera, Vector3 } from "three"; + +export function frameCorners( + camera: PerspectiveCamera, + bottomLeftCorner: Vector3, + bottomRightCorner: Vector3, + topLeftCorner: Vector3, + estimateViewFrustum?: boolean, +): void; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/GeometryCompressionUtils.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/GeometryCompressionUtils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f94c652cd3de6f877a6e22baab2f9635c14758a6 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/GeometryCompressionUtils.d.ts @@ -0,0 +1,21 @@ +import { BufferGeometry, Mesh } from "three"; + +/** + * Make the input geometry's normal attribute encoded and compressed by 3 different methods. + */ +declare function compressNormals( + geometry: BufferGeometry, + encodeMethod: "DEFAULT" | "OCT1Byte" | "OCT2Byte" | "ANGLES", +): void; + +/** + * Make the input geometry's position attribute encoded and compressed. + */ +declare function compressPositions(geometry: BufferGeometry): void; + +/** + * Make the input geometry's uv attribute encoded and compressed. + */ +declare function compressUvs(geometry: BufferGeometry): void; + +export { compressNormals, compressPositions, compressUvs }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/GeometryUtils.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/GeometryUtils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2195687e064eaff37e79479800e2c0727db0bbe1 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/GeometryUtils.d.ts @@ -0,0 +1,25 @@ +import { Vector3 } from "three"; + +export function hilbert2D( + center?: Vector3, + size?: number, + iterations?: number, + v0?: number, + v1?: number, + v2?: number, + v3?: number, +): Vector3[]; +export function hilbert3D( + center?: Vector3, + size?: number, + iterations?: number, + v0?: number, + v1?: number, + v2?: number, + v3?: number, + v4?: number, + v5?: number, + v6?: number, + v7?: number, +): Vector3[]; +export function gosper(size?: number): number[]; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/LDrawUtils.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/LDrawUtils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4753b0a05d012ff3ff97cf9ca845d5ed2af74107 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/LDrawUtils.d.ts @@ -0,0 +1,5 @@ +import { Group, Object3D } from "three"; + +export namespace LDrawUtils { + function mergeObject(object: Object3D): Group; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/SceneUtils.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/SceneUtils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..03e2be603e733fb51ab6afa5220067218b834343 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/SceneUtils.d.ts @@ -0,0 +1,57 @@ +import { BufferGeometry, Group, InstancedMesh, Material, Mesh, Object3D, Scene, Vector3 } from "three"; + +export function createMeshesFromInstancedMesh(instancedMesh: InstancedMesh): Group; +export function createMultiMaterialObject(geometry: BufferGeometry, materials: Material[]): Group; +/** + * @deprecated Use scene.attach( child ) instead. + */ +export function detach(child: Object3D, parent: Object3D, scene: Scene): void; +/** + * @deprecated Use parent.attach( child ) instead. + */ +export function attach(child: Object3D, scene: Scene, parent: Object3D): void; + +export function createMeshesFromMultiMaterialMesh(mesh: Mesh): Group; + +export function sortInstancedMesh(mesh: InstancedMesh, compareFn: (a: number, b: number) => number): void; + +/** + * Akin to Array.prototype.reduce(), but operating on the vertices of all the visible descendant objects, in world space. + * Additionally, it can operate as a transform-reduce, returning a different type T than the Vector3 input. + * This can be useful for e.g. fitting a viewing frustum to the scene. + * + * @param object - The object to traverse (uses traverseVisible internally). + * @param func - The binary function applied for the reduction. + * Must have the signature: (value: T, vertex: Vector3): T. + * @param initialValue - The value to initialize the reduction with. + * This is required as it also sets the reduction type, which is not required to be Vector3. + */ +export function reduceVertices( + object: Object3D, + func: (value: TValue, vertex: Vector3) => TValue, + initialValue: TValue, +): TValue; + +/** + * A generator based version of {@link Object3D.traverse}. + * + * @param object The 3D object to traverse. + * @yields Objects that passed the filter condition. + */ +export function traverseGenerator(object: Object3D): Generator; + +/** + * A generator based version of {@link Object3D.traverseVisible}. + * + * @param object The 3D object to traverse. + * @yields Objects that passed the filter condition. + */ +export function traverseVisibleGenerator(object: Object3D): Generator; + +/** + * A generator based version of {@link Object3D.traverseAncestors}. + * + * @param object The 3D object to traverse. + * @yields Objects that passed the filter condition. + */ +export function traverseAncestorsGenerator(object: Object3D): Generator; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/ShadowMapViewer.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/ShadowMapViewer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..76d40576111b6eed3b0f00cf5ed1abd22996dd61 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/ShadowMapViewer.d.ts @@ -0,0 +1,26 @@ +import { Light, WebGLRenderer } from "three"; + +export interface Size { + width: number; + height: number; + set: (width: number, height: number) => void; +} + +export interface Position { + x: number; + y: number; + set: (x: number, y: number) => void; +} + +declare class ShadowMapViewer { + enabled: boolean; + size: Size; + position: Position; + render: (renderer: WebGLRenderer) => void; + updateForWindowResize: () => void; + update: () => void; + + constructor(light: Light); +} + +export { ShadowMapViewer }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/ShadowMapViewerGPU.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/ShadowMapViewerGPU.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7907fd211e554d9e634838889f36e95bd282adc4 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/ShadowMapViewerGPU.d.ts @@ -0,0 +1,26 @@ +import { Light, WebGPURenderer } from "three/webgpu"; + +export interface Size { + width: number; + height: number; + set: (width: number, height: number) => void; +} + +export interface Position { + x: number; + y: number; + set: (x: number, y: number) => void; +} + +declare class ShadowMapViewer { + enabled: boolean; + size: Size; + position: Position; + render: (renderer: WebGPURenderer) => void; + updateForWindowResize: () => void; + update: () => void; + + constructor(light: Light); +} + +export { ShadowMapViewer }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/SkeletonUtils.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/SkeletonUtils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e84b0a298a6a0ea971f6db20dda0a458c9e3f322 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/SkeletonUtils.d.ts @@ -0,0 +1,32 @@ +import { AnimationClip, Bone, Object3D, Skeleton, Vector3 } from "three"; + +export interface RetargetOptions { + preserveBoneMatrix?: boolean | undefined; + preserveHipPosition?: boolean | undefined; + useTargetMatrix?: boolean | undefined; + hip?: string | undefined; + hipInfluence?: Vector3 | undefined; + scale?: number | undefined; + names?: { [boneName: string]: string } | undefined; + getBoneName?: ((bone: Bone) => string) | undefined; + hipPosition?: Vector3 | undefined; +} + +declare function retarget(target: Object3D | Skeleton, source: Object3D | Skeleton, options?: RetargetOptions): void; + +export interface RetargetClipOptions extends RetargetOptions { + useFirstFramePosition?: boolean | undefined; + fps?: number | undefined; + trim?: [number, number] | undefined; +} + +declare function retargetClip( + target: Skeleton | Object3D, + source: Skeleton | Object3D, + clip: AnimationClip, + options?: RetargetClipOptions, +): AnimationClip; + +declare function clone(source: Object3D): Object3D; + +export { clone, retarget, retargetClip }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/SortUtils.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/SortUtils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f8ceb81c23433ef224cf4b4f94f73f837982fe41 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/SortUtils.d.ts @@ -0,0 +1,7 @@ +export interface RadixSortOptions { + aux?: T[] | undefined; + get?: ((el: T) => number) | undefined; + reversed?: boolean | undefined; +} + +export const radixSort: (arr: T[], opt?: RadixSortOptions) => void; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/UVsDebug.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/UVsDebug.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..490e05d6c4732df47fb377b0d3056de2a1e93bb0 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/UVsDebug.d.ts @@ -0,0 +1,3 @@ +import { BufferGeometry } from "three"; + +export function UVsDebug(geometry: BufferGeometry, size?: number): HTMLCanvasElement; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/WebGLTextureUtils.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/WebGLTextureUtils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..768ead8a1f62e614b640cd9096846fe1f6b51901 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/WebGLTextureUtils.d.ts @@ -0,0 +1,3 @@ +import { Texture, WebGLRenderer } from "three"; + +export function decompress(texture: Texture, maxTextureSize?: number, renderer?: WebGLRenderer): Texture; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/WebGPUTextureUtils.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/WebGPUTextureUtils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3d383abfeaaedd25e295a1edd4173edd734ae10a --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/WebGPUTextureUtils.d.ts @@ -0,0 +1,3 @@ +import { Texture, WebGPURenderer } from "three/webgpu"; + +export function decompress(blitTexture: Texture, maxTextureSize?: number, renderer?: WebGPURenderer): Promise; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/WorkerPool.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/WorkerPool.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1e5c1e4f858c0b0e13ee407bdca710463ccfd7e2 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/utils/WorkerPool.d.ts @@ -0,0 +1,26 @@ +/** + * @author Deepkolos / https://github.com/deepkolos + */ + +export class WorkerPool { + pool: number; + quene: Array<{ + resolve: (e: any) => void; + msg: any; + transfer: Array; + }>; + workers: Array; + workersResolve: Array<(e: any) => void>; + workerStatus: number; + + constructor(pool?: number); + + _initWorker(workerId: number): void; + workerCreator(): Worker; + _getIdleWorker(): void; + _onMessage(workerId: number, msg: any): void; + setWorkerCreator(workerCreator: () => Worker): void; + setWorkerLimit(pool: number): void; + postMessage(msg: any, transfer?: Array): Promise; + dispose(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/ARButton.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/ARButton.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..09de293db5633530f2a14d960dd96d627cb006ee --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/ARButton.d.ts @@ -0,0 +1,9 @@ +import { WebGLRenderer } from "three"; + +export interface ARButtonSessionInit extends XRSessionInit { + domOverlay: { root: HTMLElement }; +} + +export namespace ARButton { + function createButton(renderer: WebGLRenderer, sessionInit?: Partial): HTMLElement; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/OculusHandModel.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/OculusHandModel.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..92ebf16dd28f0d3fc3b7546cf85885b91df1b23e --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/OculusHandModel.d.ts @@ -0,0 +1,23 @@ +import { Loader, Mesh, Object3D, Texture, Vector3 } from "three"; +import { GLTF } from "../loaders/GLTFLoader.js"; +import { XRHandMeshModel } from "./XRHandMeshModel.js"; + +export class OculusHandModel extends Object3D { + controller: Object3D; + motionController: XRHandMeshModel | null; + envMap: Texture | null; + loader: Loader | null; + onLoad?: ((object: Object3D) => void) | null; + + mesh: Mesh | null; + + constructor(controller: Object3D, loader?: Loader | null, onLoad?: ((object: Object3D) => void) | null); + + updateMatrixWorld(force?: boolean): void; + + getPointerPosition(): Vector3 | null; + + intersectBoxObject(boxObject: Object3D): boolean; + + checkButton(button: Object3D): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/OculusHandPointerModel.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/OculusHandPointerModel.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..920f043828d89dfde68ee0107b79502c556ad96c --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/OculusHandPointerModel.d.ts @@ -0,0 +1,67 @@ +import "webxr"; + +import { + BufferGeometry, + Intersection, + Mesh, + MeshBasicMaterial, + Object3D, + Raycaster, + SphereGeometry, + Texture, + Vector3, +} from "three"; + +import { XRHandMeshModel } from "./XRHandMeshModel.js"; + +export class OculusHandPointerModel extends Object3D { + hand: Object3D; + controller: Object3D; + motionController: XRHandMeshModel | null; + + envMap: Texture | null; + + mesh: Mesh | null; + + pointerGeometry: BufferGeometry | null; + pointerMesh: Mesh | null; + pointerObject: Object3D | null; + + pinched: boolean; + attached: boolean; + + cursorObject: Mesh | null; + + raycaster: Raycaster; + + visible: boolean; + xrInputSource: XRInputSource; + + constructor(hand: Object3D, controller: Object3D); + + private _drawVerticesRing(vertices: number[], baseVector: Vector3, ringIndex: number): void; + + private _updatePointerVertices(rearRadius: number): void; + + public createPointer(): void; + + private _updateRaycaster(): void; + + private _updatePointer(): void; + + public updateMatrixWorld(force?: boolean): void; + + public isPinched(): boolean; + + public setAttached(attached: boolean): void; + + public isAttached(): boolean; + + public intersectObject(object: Object3D, recursive?: boolean): Intersection[] | void; + + public intersectObjects(objects: Object3D[], recursive?: boolean): Intersection[] | void; + + public checkIntersections(objects: Object3D[], recursive?: boolean): void; + + public setCursor(distance: number): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/Text2D.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/Text2D.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..19973d147ee7db8229bef273d0a726300a12bafd --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/Text2D.d.ts @@ -0,0 +1,3 @@ +import { Mesh } from "three"; + +export function createText(message: string, height: number): Mesh; diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/VRButton.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/VRButton.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..54435bb75121f463c56b17c55161cfd28e708942 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/VRButton.d.ts @@ -0,0 +1,7 @@ +export interface VRButtonRenderer { + xr: { setSession: (value: XRSession) => Promise }; +} + +export class VRButton { + static createButton(renderer: VRButtonRenderer, sessionInit?: XRSessionInit): HTMLElement; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/XRButton.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/XRButton.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..93c41ba306db329895b97cba99a5f7fafb79d2c6 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/XRButton.d.ts @@ -0,0 +1,7 @@ +export interface XRButtonRenderer { + xr: { setSession(session: XRSession): Promise }; +} + +export class XRButton { + static createButton(renderer: XRButtonRenderer, sessionInit?: XRSessionInit): HTMLElement; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/XRControllerModelFactory.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/XRControllerModelFactory.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..31f7f71cb1bad4e5bd64bb8eff77cf7df5aec9c7 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/XRControllerModelFactory.d.ts @@ -0,0 +1,23 @@ +import { Group, Loader, Object3D, Texture } from "three"; +import { GLTF } from "../loaders/GLTFLoader.js"; + +export class XRControllerModel extends Object3D { + motionController: unknown; + envMap: Texture | null; + + constructor(); + + setEnvironmentMap(envMap: Texture): XRControllerModel; +} + +export class XRControllerModelFactory { + gltfLoader: Loader | null; + path: string; + onLoad: ((scene: Group) => void) | null; + + constructor(gltfLoader?: Loader | null, onLoad?: ((scene: Group) => void) | null); + + setPath(path: string): this; + + createControllerModel(controller: Group): XRControllerModel; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/XREstimatedLight.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/XREstimatedLight.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c6bb0394c49f6cdb07fba815643185c965f0a755 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/XREstimatedLight.d.ts @@ -0,0 +1,69 @@ +import { DirectionalLight, Group, LightProbe, Object3DEventMap, Texture, WebGLRenderer } from "three"; + +export class SessionLightProbe { + xrLight: XREstimatedLight; + renderer: WebGLRenderer; + lightProbe: LightProbe; + xrWebGLBinding: XRWebGLBinding | null; + estimationStartCallback: () => void; + frameCallback: (this: SessionLightProbe, time: number, xrFrame: XRFrame) => void; + + constructor( + xrLight: XREstimatedLight, + renderer: WebGLRenderer, + lightProbe: LightProbe, + environmentEstimation: boolean, + estimationStartCallback: () => void, + ); + + updateReflection: () => void; + + onXRFrame: XRFrameRequestCallback; + + dispose: () => void; +} + +export interface XREstimatedLightEventMap extends Object3DEventMap { + /** + * Fires when the estimated lighting values start being updated. + */ + estimationstart: {}; + /** + * Fires when the estimated lighting values stop being updated. + */ + estimationend: {}; +} + +/** + * XREstimatedLight uses WebXR's light estimation to create a light probe, a directional light, and (optionally) an + * environment map that model the user's real-world environment and lighting. + * As WebXR updates the light and environment estimation, XREstimatedLight automatically updates the light probe, + * directional light, and environment map. + * + * It's important to specify `light-estimation` as an optional or required feature when creating the WebXR session, + * otherwise the light estimation can't work. + * + * See {@link https://developer.mozilla.org/en-US/docs/Web/API/XRLightProbe#browser_compatibility here} for browser + * compatibility information, as this is still an experimental feature in WebXR. + * + * To use this, as with all files in the /examples directory, you will have to include the file separately in your HTML. + */ +export class XREstimatedLight extends Group { + lightProbe: LightProbe; + + directionalLight: DirectionalLight; + + /** + * The environment map estimated by WebXR. This is only available if environmentEstimation is `true`. + * + * It can be used as the {@link Scene.environment}, for {@link MeshStandardMaterial.envMap}, or as the + * {@link Scene.background}. + */ + environment: Texture; + + /** + * @param renderer The renderer used to render the Scene. Mainly used to interact with WebXRManager. + * @param environmentEstimation If `true`, use WebXR to estimate an environment map. + */ + constructor(renderer: WebGLRenderer, environmentEstimation?: boolean); +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/XRHandMeshModel.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/XRHandMeshModel.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..94d0c1432ebe44bf9b7f3d8f122955e38085b202 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/XRHandMeshModel.d.ts @@ -0,0 +1,19 @@ +import { Loader, Object3D } from "three"; +import { GLTF } from "../loaders/GLTFLoader.js"; + +export class XRHandMeshModel { + controller: Object3D; + handModel: Object3D; + bones: Object3D[]; + + constructor( + handModel: Object3D, + controller: Object3D, + path: string, + handedness: string, + loader?: Loader | null, + onLoad?: ((object: Object3D) => void) | null, + ); + + updateMesh(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/XRHandModelFactory.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/XRHandModelFactory.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..90aeb9e5d76fc4cf0ec92c15e8f167776fbc8306 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/XRHandModelFactory.d.ts @@ -0,0 +1,32 @@ +import { Group, Loader, Object3D } from "three"; + +import { GLTF } from "../loaders/GLTFLoader.js"; +import { XRHandMeshModel } from "./XRHandMeshModel.js"; +import { XRHandPrimitiveModel, XRHandPrimitiveModelOptions } from "./XRHandPrimitiveModel.js"; + +export type XRHandModelHandedness = "left" | "right"; + +export class XRHandModel extends Object3D { + motionController: XRHandPrimitiveModel | XRHandMeshModel; + + constructor(); +} + +export class XRHandModelFactory { + gltfLoader: Loader | null; + path: string | null; + onLoad?: ((object: Object3D) => void) | null; + + constructor( + gltfLoader?: Loader | null, + onLoad?: ((object: Object3D) => void) | null, + ); + + setPath(path: string | null): this; + + createHandModel( + controller: Group, + profile?: "spheres" | "boxes" | "mesh", + options?: XRHandPrimitiveModelOptions, + ): XRHandModel; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/XRHandPrimitiveModel.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/XRHandPrimitiveModel.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3400283c8d9692bd4262939392a08ac310178258 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/XRHandPrimitiveModel.d.ts @@ -0,0 +1,24 @@ +import { Group, Texture } from "three"; + +import { XRHandModel, XRHandModelHandedness } from "./XRHandModelFactory.js"; + +export interface XRHandPrimitiveModelOptions { + primitive?: "sphere" | "box" | undefined; +} + +export class XRHandPrimitiveModel { + controller: Group; + handModel: XRHandModel; + envMap: Texture | null; + handMesh: Group; + + constructor( + handModel: XRHandModel, + controller: Group, + path: string, + handedness: XRHandModelHandedness, + options: XRHandPrimitiveModelOptions, + ); + + updateMesh: () => void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/XRPlanes.d.ts b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/XRPlanes.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..63ff6d2084a49c644c15012684f9297b330b9c3d --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/examples/jsm/webxr/XRPlanes.d.ts @@ -0,0 +1,5 @@ +import { Object3D, WebGLRenderer } from "three"; + +export class XRPlanes extends Object3D { + constructor(renderer: WebGLRenderer); +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/index.d.ts b/astra_scene_test/X_03/node_modules/@types/three/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7e839d2250fcc54908a405be54a34fae35671585 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/index.d.ts @@ -0,0 +1,6 @@ +// To update three.js type definition, please make changes to the repository at: +// https://github.com/three-types/three-ts-types. +// Periodically, the updates from the repository are pushed to DefinitelyTyped +// and released in the @types/three npm package. + +export * from "./src/Three.js"; diff --git a/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/CHANGELOG.md b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..6e288d319905f641ca19236b012210af289dbea2 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/CHANGELOG.md @@ -0,0 +1,125 @@ +## 0.8.3 +- Fix buffer over-read for Zip64 extra fields +- Support sync flushes (`Z_SYNC_FLUSH` in zlib) + - Allows for immediate decompression of all pushed bytes + - Enables DEFLATE stream concatenation +- Fix `zip`/`zipSync` when using cross-realm `Uint8Array` +- Improve Zip64 support for streamed or undersized archives +- Update performance estimates in README +- Fix typings for TypeScript v5.7+ +- Reduce memory consumption after compression stream completion +## 0.8.2 +- Fixed broken UMD build +- Fixed edge-case causing skipped data during streaming compression +- Fixed bug in GZIP streaming on member boundary +- Improved streaming performance on inconsistent chunk sizes +- Improved `unzip` performance on undercompressed archives +- Added flushing support into streaming API +- Added backpressure support into async streaming API + - Use new `ondrain` handler and `queuedSize` +## 0.8.1 +- Fixed reallocating on pre-supplied buffer in `inflateSync` and `unzlibSync` +- Minor documentation fixes +## 0.8.0 +- BREAKING: synchronous decompression functions now take an options object rather than an output buffer as a second parameter + - `inflateSync(compressed, outBuf)` is now `inflateSync(compressed, { out: outBuf })` +- Support dictionaries in compression and decompression +- Support multi-member files in GZIP streaming decompression +- Dramatically improved streaming performance +- Fixed missing error on certain malformed GZIP files +## 0.7.3 +- Fix folder creation for certain operating system + - Create 0-length "files" for each directory specified with "object" syntax" + - Support empty folders + - Add options for folders +- Fix minification in SWC + - Remove instanceof, no-whitespace assumptions in async functions +## 0.7.2 +- Fixed TypeScript typing for errors when using `strictNullChecks` +- Fixed failure to compress files above 64kB with `{ level: 0 }` +- Fixed AMD module definition in UMD build +## 0.7.1 +- Removed requirement for `setTimeout` +- Added support for unzip file filters (thanks to [@manucorporat](https://github.com/manucorporat): #67) +- Fixed streaming gunzip and unzlib bug causing corruption +## 0.7.0 +- Improved errors + - Now errors are error objects instead of strings + - Check the error code to apply custom logic based on error type +- Made async operations always call callbacks asynchronously +- Fixed bug that caused errors to not appear in asynchronous operations in browsers +## 0.6.10 +- Fixed async operations on Node.js with native ESM +## 0.6.5 +- Fixed streams not recognizing final chunk +- Fixed streaming UTF-8 decoder bug +## 0.6.4 +- Made streaming inflate consume all data possible +- Optimized use of values near 32-bit boundary +## 0.6.3 +- Patch exports of async functions +- Fix streaming unzip +## 0.6.2 +- Replace Adler-32 implementation (used in Zlib compression) with one more optimized for V8 + - Advice from @SheetJSDev +- Add support for extra fields, file comments in ZIP files +- Work on Rust version +## 0.6.0 +- Revamped streaming unzip for compatibility and performance improvements +- Fixed streaming data bugs +- Fixed inflation errors +- Planned new tests +## 0.5.2 +- General bugfixes +## 0.5.0 +- Add streaming zip, unzip +- Fix import issues with certain environments + - If you had problems with `worker_threads` being included in your bundle, try updating! +## 0.4.8 +- Support strict Content Security Policy + - Remove `new Function` +## 0.4.7 +- Fix data streaming bugs +## 0.4.5 +- Zip64 support + - Still not possible to have above 4GB files +## 0.4.4 +- Files up to 4GB supported + - Hey, that's better than even Node.js `zlib`! +## 0.4.1 +- Fix ZIP failure bug +- Make ZIP options work better +- Improve docs +- Fix async inflate failure +- Work on Rust version +## 0.3.11 +- Fix docs +## 0.3.9 +- Fixed issue with unzipping +## 0.3.7 +- Patched streaming compression bugs +- Added demo page +## 0.3.6 +- Allowed true ESM imports +## 0.3.4 +- Fixed rare overflow bug causing corruption +- Added async stream termination +- Added UMD bundle +## 0.3.0 +- Added support for asynchronous and synchronous streaming +- Reduced bundle size by autogenerating worker code, even in minified environments +- Error detection rather than hanging +- Improved performance +## 0.2.3 +- Improved Zlib autodetection +## 0.2.2 +- Fixed Node Worker +## 0.2.1 +- Fixed ZIP bug +## 0.2.0 +- Added support for ZIP files (parallelized) +- Added ability to terminate running asynchronous operations +## 0.1.0 +- Rewrote API: added support for asynchronous (Worker) compression/decompression, fixed critical bug involving fixed Huffman trees +## 0.0.1 +- Created, works on basic input \ No newline at end of file diff --git a/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/LICENSE b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..bd36874f34b9ae537f2bbc383fdf6e320dfafe98 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Arjun Barrett + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/README.md b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/README.md new file mode 100644 index 0000000000000000000000000000000000000000..36e0654f28dafb8a121ed8880d6cd9e890898f4c --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/README.md @@ -0,0 +1,558 @@ +# fflate +High performance (de)compression in an 8kB package + +## Why fflate? +`fflate` (short for fast flate) is the **fastest, smallest, and most versatile** pure JavaScript compression and decompression library in existence, handily beating [`pako`](https://npmjs.com/package/pako), [`tiny-inflate`](https://npmjs.com/package/tiny-inflate), and [`UZIP.js`](https://github.com/photopea/UZIP.js) in performance benchmarks while being multiple times more lightweight. Its compression ratios are often better than even the original Zlib C library. It includes support for DEFLATE, GZIP, and Zlib data. Data compressed by `fflate` can be decompressed by other tools, and vice versa. + +In addition to the base decompression and compression APIs, `fflate` supports high-speed ZIP file archiving for an extra 3 kB. In fact, the compressor, in synchronous mode, compresses both more quickly and with a higher compression ratio than most compression software (even Info-ZIP, a C program), and in asynchronous mode it can utilize multiple threads to achieve over 3x the performance of virtually any other utility. + +| | `pako` | `tiny-inflate` | `UZIP.js` | `fflate` | +|-----------------------------|--------|------------------------|-----------------------|--------------------------------| +| Decompression performance | 1x | Up to 40% slower | **Up to 25% faster** | **Up to 25% faster** | +| Compression performance | 1x | N/A | Up to 25% faster | **Up to 50% faster** | +| Base bundle size (minified) | 45.6kB | **3kB (inflate only)** | 14.2kB | 8kB **(3kB for inflate only)** | +| Decompression support | ✅ | ✅ | ✅ | ✅ | +| Compression support | ✅ | ❌ | ✅ | ✅ | +| ZIP support | ❌ | ❌ | ✅ | ✅ | +| Streaming support | ✅ | ❌ | ❌ | ✅ | +| GZIP support | ✅ | ❌ | ❌ | ✅ | +| Supports files up to 4GB | ✅ | ❌ | ❌ | ✅ | +| Doesn't hang on error | ✅ | ❌ | ❌ | ✅ | +| Dictionary support | ✅ | ❌ | ❌ | ✅ | +| Multi-thread/Asynchronous | ❌ | ❌ | ❌ | ✅ | +| Streaming ZIP support | ❌ | ❌ | ❌ | ✅ | +| Uses ES Modules | ❌ | ❌ | ❌ | ✅ | + +## Demo +If you'd like to try `fflate` for yourself without installing it, you can take a look at the [browser demo](https://101arrowz.github.io/fflate). Since `fflate` is a pure JavaScript library, it works in both the browser and Node.js (see [Browser support](https://github.com/101arrowz/fflate/#browser-support) for more info). + +## Usage + +Install `fflate`: +```sh +npm i fflate # or yarn add fflate, or pnpm add fflate +``` + +Import: +```js +// I will assume that you use the following for the rest of this guide +import * as fflate from 'fflate'; + +// However, you should import ONLY what you need to minimize bloat. +// So, if you just need GZIP compression support: +import { gzipSync } from 'fflate'; +// Woo! You just saved 20 kB off your bundle with one line. +``` + +If your environment doesn't support ES Modules (e.g. Node.js): +```js +// Try to avoid this when using fflate in the browser, as it will import +// all of fflate's components, even those that you aren't using. +const fflate = require('fflate'); +``` + +If you want to load from a CDN in the browser: +```html + + + + + + + +``` + +If you are using Deno: +```js +// Don't use the ?dts Skypack flag; it isn't necessary for Deno support +// The @deno-types comment adds TypeScript typings + +// @deno-types="https://cdn.skypack.dev/fflate@0.8.3/lib/index.d.ts" +import * as fflate from 'https://cdn.skypack.dev/fflate@0.8.3?min'; +``` + + +If your environment doesn't support bundling: +```js +// Again, try to import just what you need + +// For the browser: +import * as fflate from 'fflate/esm/browser.js'; +// If the standard ESM import fails on Node (i.e. older version): +import * as fflate from 'fflate/esm'; +``` + +And use: +```js +// This is an ArrayBuffer of data +const massiveFileBuf = await fetch('/aMassiveFile').then( + res => res.arrayBuffer() +); +// To use fflate, you need a Uint8Array +const massiveFile = new Uint8Array(massiveFileBuf); +// Note that Node.js Buffers work just fine as well: +// const massiveFile = require('fs').readFileSync('aMassiveFile.txt'); + +// Higher level means lower performance but better compression +// The level ranges from 0 (no compression) to 9 (max compression) +// The default level is 6 +const notSoMassive = fflate.zlibSync(massiveFile, { level: 9 }); +const massiveAgain = fflate.unzlibSync(notSoMassive); +const gzipped = fflate.gzipSync(massiveFile, { + // GZIP-specific: the filename to use when decompressed + filename: 'aMassiveFile.txt', + // GZIP-specific: the modification time. Can be a Date, date string, + // or Unix timestamp + mtime: '9/1/16 2:00 PM' +}); +``` +`fflate` can autodetect a compressed file's format as well: +```js +const compressed = new Uint8Array( + await fetch('/GZIPorZLIBorDEFLATE').then(res => res.arrayBuffer()) +); +// Above example with Node.js Buffers: +// Buffer.from('H4sIAAAAAAAAE8tIzcnJBwCGphA2BQAAAA==', 'base64'); + +const decompressed = fflate.decompressSync(compressed); +``` + +Using strings is easy with `fflate`'s string conversion API: +```js +const buf = fflate.strToU8('Hello world!'); + +// The default compression method is gzip +// Increasing mem may increase performance at the cost of memory +// The mem ranges from 0 to 12, where 4 is the default +const compressed = fflate.compressSync(buf, { level: 6, mem: 8 }); + +// When you need to decompress: +const decompressed = fflate.decompressSync(compressed); +const origText = fflate.strFromU8(decompressed); +console.log(origText); // Hello world! +``` + +If you need to use an (albeit inefficient) binary string, you can set the second argument to `true`. +```js +const buf = fflate.strToU8('Hello world!'); + +// The second argument, latin1, is a boolean that indicates that the data +// is not Unicode but rather should be encoded and decoded as Latin-1. +// This is useful for creating a string from binary data that isn't +// necessarily valid UTF-8. However, binary strings are incredibly +// inefficient and tend to double file size, so they're not recommended. +const compressedString = fflate.strFromU8( + fflate.compressSync(buf), + true +); +const decompressed = fflate.decompressSync( + fflate.strToU8(compressedString, true) +); +const origText = fflate.strFromU8(decompressed); +console.log(origText); // Hello world! +``` + +You can use streams as well to incrementally add data to be compressed or decompressed: +```js +// This example uses synchronous streams, but for the best experience +// you'll definitely want to use asynchronous streams. + +let outStr = ''; +const gzipStream = new fflate.Gzip({ level: 9 }, (chunk, isLast) => { + // accumulate in an inefficient binary string (just an example) + outStr += fflate.strFromU8(chunk, true); +}); + +// You can also attach the data handler separately if you don't want to +// do so in the constructor. +gzipStream.ondata = (chunk, final) => { ... } + +// Since this is synchronous, all errors will be thrown by stream.push() +gzipStream.push(chunk1); +gzipStream.push(chunk2); + +... + +// You should mark the last chunk by using true in the second argument +// In addition to being necessary for the stream to work properly, this +// will also set the isLast parameter in the handler to true. +gzipStream.push(lastChunk, true); + +console.log(outStr); // The compressed binary string is now available + +// The options parameter for compression streams is optional; you can +// provide one parameter (the handler) or none at all if you set +// deflateStream.ondata later. +const deflateStream = new fflate.Deflate((chunk, final) => { + console.log(chunk, final); +}); + +// If you want to create a stream from strings, use EncodeUTF8 +const utfEncode = new fflate.EncodeUTF8((data, final) => { + // Chaining streams together is done by pushing to the + // next stream in the handler for the previous stream + deflateStream.push(data, final); +}); + +utfEncode.push('Hello'.repeat(1000)); +utfEncode.push(' '.repeat(100)); +utfEncode.push('world!'.repeat(10), true); + +// The deflateStream has logged the compressed data + +const inflateStream = new fflate.Inflate(); +inflateStream.ondata = (decompressedChunk, final) => { ... }; + +let stringData = ''; + +// Streaming UTF-8 decode is available too +const utfDecode = new fflate.DecodeUTF8((data, final) => { + stringData += data; +}); + +// Decompress streams auto-detect the compression method, as the +// non-streaming decompress() method does. +const dcmpStrm = new fflate.Decompress((chunk, final) => { + console.log(chunk, 'was encoded with GZIP, Zlib, or DEFLATE'); + utfDecode.push(chunk, final); +}); + +dcmpStrm.push(zlibJSONData1); +dcmpStrm.push(zlibJSONData2, true); + +// This succeeds; the UTF-8 decoder chained with the unknown compression format +// stream to reach a string as a sink. +console.log(JSON.parse(stringData)); +``` + +You can create multi-file ZIP archives easily as well. Note that by default, compression is enabled for all files, which is not useful when ZIPping many PNGs, JPEGs, PDFs, etc. because those formats are already compressed. You should either override the level on a per-file basis or globally to avoid wasting resources. +```js +// Note that the asynchronous version (see below) runs in parallel and +// is *much* (up to 3x) faster for larger archives. +const zipped = fflate.zipSync({ + // Directories can be nested structures, as in an actual filesystem + 'dir1': { + 'nested': { + // You can use Unicode in filenames + '你好.txt': fflate.strToU8('Hey there!') + }, + // You can also manually write out a directory path + 'other/tmp.txt': new Uint8Array([97, 98, 99, 100]) + }, + + // You can also provide compression options + 'massiveImage.bmp': [aMassiveFile, { + level: 9, + mem: 12 + }], + // PNG is pre-compressed; no need to waste time + 'superTinyFile.png': [aPNGFile, { level: 0 }], + + // Directories take options too + 'exec': [{ + 'hello.sh': [fflate.strToU8('echo hello world'), { + // ZIP only: Set the operating system to Unix + os: 3, + // ZIP only: Make this file executable on Unix + attrs: 0o755 << 16 + }] + }, { + // ZIP and GZIP support mtime (defaults to current time) + mtime: new Date('10/20/2020') + }] +}, { + // These options are the defaults for all files, but file-specific + // options take precedence. + level: 1, + // Obfuscate last modified time by default + mtime: new Date('1/1/1980') +}); + +// If you write the zipped data to myzip.zip and unzip, the folder +// structure will be outputted as: + +// myzip.zip (original file) +// dir1 +// |-> nested +// | |-> 你好.txt +// |-> other +// | |-> tmp.txt +// massiveImage.bmp +// superTinyFile.png + +// When decompressing, folders are not nested; all filepaths are fully +// written out in the keys. For example, the return value may be: +// { 'nested/directory/structure.txt': Uint8Array(2) [97, 97] } +const decompressed = fflate.unzipSync(zipped, { + // You may optionally supply a filter for files. By default, all files in a + // ZIP archive are extracted, but a filter can save resources by telling + // the library not to decompress certain files + filter(file) { + // Don't decompress the massive image or any files larger than 10 MiB + return file.name != 'massiveImage.bmp' && file.originalSize <= 10_000_000; + } +}); +``` + +If you need extremely high performance or custom ZIP compression formats, you can use the highly-extensible ZIP streams. They take streams as both input and output. You can even use custom compression/decompression algorithms from other libraries, as long as they [are defined in the ZIP spec](https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT) (see section 4.4.5). If you'd like more info on using custom compressors, [feel free to ask](https://github.com/101arrowz/fflate/discussions). +```js +// ZIP object +// Can also specify zip.ondata outside of the constructor +const zip = new fflate.Zip((err, dat, final) => { + if (!err) { + // output of the streams + console.log(dat, final); + } +}); + +const helloTxt = new fflate.ZipDeflate('hello.txt', { + level: 9 +}); + +// Always add streams to ZIP archives before pushing to those streams +zip.add(helloTxt); + +helloTxt.push(chunk1); +// Last chunk +helloTxt.push(chunk2, true); + +// ZipPassThrough is like ZipDeflate with level 0, but allows for tree shaking +const nonStreamingFile = new fflate.ZipPassThrough('test.png'); +zip.add(nonStreamingFile); +// If you have data already loaded, just .push(data, true) +nonStreamingFile.push(pngData, true); + +// You need to call .end() after finishing +// This ensures the ZIP is valid +zip.end(); + +// Unzip object +const unzipper = new fflate.Unzip(); + +// This function will almost always have to be called. It is used to support +// compression algorithms such as BZIP2 or LZMA in ZIP files if just DEFLATE +// is not enough (though it almost always is). +// If your ZIP files are not compressed, this line is not needed. +unzipper.register(fflate.UnzipInflate); + +const neededFiles = ['file1.txt', 'example.json']; + +// Can specify handler in constructor too +unzipper.onfile = file => { + // file.name is a string, file is a stream + if (neededFiles.includes(file.name)) { + file.ondata = (err, dat, final) => { + // Stream output here + console.log(dat, final); + }; + + console.log('Reading:', file.name); + + // File sizes are sometimes not set if the ZIP file did not encode + // them, so you may want to check that file.size != undefined + console.log('Compressed size', file.size); + console.log('Decompressed size', file.originalSize); + + // You should only start the stream if you plan to use it to improve + // performance. Only after starting the stream will ondata be called. + // This method will throw if the compression method hasn't been registered + file.start(); + } +}; + +// Try to keep under 5,000 files per chunk to avoid stack limit errors +// For example, if all files are a few kB, multi-megabyte chunks are OK +// If files are mostly under 100 bytes, 64kB chunks are the limit +unzipper.push(zipChunk1); +unzipper.push(zipChunk2); +unzipper.push(zipChunk3, true); +``` + +As you may have guessed, there is an asynchronous version of every method as well. Unlike most libraries, this will cause the compression or decompression run in a separate thread entirely and automatically by using Web (or Node) Workers. This means that the processing will not block the main thread at all. + +Note that there is a significant initial overhead to using workers of about 50ms for each asynchronous function. For instance, if you call `unzip` ten times, the overhead only applies for the first call, but if you call `unzip` and `zlib`, they will each cause the 50ms delay. For small (under about 50kB) payloads, the asynchronous APIs will be much slower. However, if you're compressing larger files/multiple files at once, or if the synchronous API causes the main thread to hang for too long, the callback APIs are an order of magnitude better. +```js +import { + gzip, zlib, AsyncGzip, zip, unzip, strFromU8, + Zip, AsyncZipDeflate, Unzip, AsyncUnzipInflate +} from 'fflate'; + +// Workers will work in almost any browser (even IE11!) +// All of the async APIs use a node-style callback as so: +const terminate = gzip(aMassiveFile, (err, data) => { + if (err) { + // The compressed data was likely corrupt, so we have to handle + // the error. + return; + } + // Use data however you like + console.log(data.length); +}); + +if (needToCancel) { + // The return value of any of the asynchronous APIs is a function that, + // when called, will immediately cancel the operation. The callback + // will not be called. + terminate(); +} + +// If you wish to provide options, use the second argument. + +// The consume option will render the data inside aMassiveFile unusable, +// but can improve performance and dramatically reduce memory usage. +zlib(aMassiveFile, { consume: true, level: 9 }, (err, data) => { + // Use the data +}); + +// Asynchronous streams are similar to synchronous streams, but the +// handler has the error that occurred (if any) as the first parameter, +// and they don't block the main thread. + +// Additionally, any buffers that are pushed in will be consumed and +// rendered unusable; if you need to use a buffer you push in, you +// should clone it first. +const gzs = new AsyncGzip({ level: 9, mem: 12, filename: 'hello.txt' }); +let wasCallbackCalled = false; +gzs.ondata = (err, chunk, final) => { + // Note the new err parameter + if (err) { + // Note that after this occurs, the stream becomes corrupt and must + // be discarded. You can't continue pushing chunks and expect it to + // work. + console.error(err); + return; + } + wasCallbackCalled = true; +} +gzs.push(chunk); + +// Since the stream is asynchronous, the callback will not be called +// immediately. If such behavior is absolutely necessary (it shouldn't +// be), use synchronous streams. +console.log(wasCallbackCalled) // false + +// To terminate an asynchronous stream's internal worker, call +// stream.terminate(). +gzs.terminate(); + +// This is way faster than zipSync because the compression of multiple +// files runs in parallel. In fact, the fact that it's parallelized +// makes it faster than most standalone ZIP CLIs. The effect is most +// significant for multiple large files; less so for many small ones. +zip({ f1: aMassiveFile, 'f2.txt': anotherMassiveFile }, { + // The options object is still optional, you can still do just + // zip(archive, callback) + level: 6 +}, (err, data) => { + // Save the ZIP file +}); + +// unzip is the only async function without support for consume option +// It is parallelized, so unzip is also often much faster than unzipSync +unzip(aMassiveZIPFile, (err, unzipped) => { + // If the archive has data.xml, log it here + console.log(unzipped['data.xml']); + // Conversion to string + console.log(strFromU8(unzipped['data.xml'])) +}); + +// Streaming ZIP archives can accept asynchronous streams. This automatically +// uses multicore compression. +const zip = new Zip(); +zip.ondata = (err, chunk, final) => { ... }; +// The JSON and BMP are compressed in parallel +const exampleFile = new AsyncZipDeflate('example.json'); +zip.add(exampleFile); +exampleFile.push(JSON.stringify({ large: 'object' }), true); +const exampleFile2 = new AsyncZipDeflate('example2.bmp', { level: 9 }); +zip.add(exampleFile2); +exampleFile2.push(ec2a); +exampleFile2.push(ec2b); +exampleFile2.push(ec2c); +... +exampleFile2.push(ec2Final, true); +zip.end(); + +// Streaming Unzip should register the asynchronous inflation algorithm +// for parallel processing. +const unzip = new Unzip(stream => { + if (stream.name.endsWith('.json')) { + stream.ondata = (err, chunk, final) => { ... }; + stream.start(); + + if (needToCancel) { + // To cancel these streams, call .terminate() + stream.terminate(); + } + } +}); +unzip.register(AsyncUnzipInflate); +unzip.push(data, true); +``` + +See the [documentation](https://github.com/101arrowz/fflate/blob/master/docs/README.md) for more detailed information about the API. + +## Bundle size estimates + +The bundle size measurements for `fflate` on sites like Bundlephobia include every feature of the library and should be seen as an upper bound. As long as you are using tree shaking or dead code elimination, this table should give you a general idea of `fflate`'s bundle size for the features you need. + +The maximum bundle size that is possible with `fflate` is about 33kB (12.5kB gzipped) if you use every single feature, but feature parity with `pako` is only around 10kB (as opposed to 45kB from `pako`). If your bundle size increases dramatically after adding `fflate`, please [create an issue](https://github.com/101arrowz/fflate/issues/new). + +| Feature | Bundle size (minified) | Nearest competitor | +|-------------------------|--------------------------------|-------------------------| +| Decompression | 3kB | `tiny-inflate` | +| Compression | 5kB | `UZIP.js`, 2.84x larger | +| Async decompression | 4kB (1kB + raw decompression) | N/A | +| Async compression | 6kB (1kB + raw compression) | N/A | +| ZIP decompression | 5kB (2kB + raw decompression) | `UZIP.js`, 2.84x larger | +| ZIP compression | 7kB (2kB + raw compression) | `UZIP.js`, 2.03x larger | +| GZIP/Zlib decompression | 4kB (1kB + raw decompression) | `pako`, 11.4x larger | +| GZIP/Zlib compression | 5kB (1kB + raw compression) | `pako`, 9.12x larger | +| Streaming decompression | 4kB (1kB + raw decompression) | `pako`, 11.4x larger | +| Streaming compression | 5kB (1kB + raw compression) | `pako`, 9.12x larger | + +## What makes `fflate` so fast? +Many JavaScript compression/decompression libraries exist. However, the most popular one, [`pako`](https://npmjs.com/package/pako), is merely a clone of Zlib rewritten nearly line-for-line in JavaScript. Although it is by no means poorly made, `pako` doesn't recognize the many differences between JavaScript and C, and therefore is suboptimal for performance. Moreover, even when minified, the library is 45 kB; it may not seem like much, but for anyone concerned with optimizing bundle size (especially library authors), it's more weight than necessary. + +Note that there exist some small libraries like [`tiny-inflate`](https://npmjs.com/package/tiny-inflate) for solely decompression, and with a minified size of 3 kB, it can be appealing; however, its performance is lackluster, typically 40% worse than `pako` in my tests. + +[`UZIP.js`](https://github.com/photopea/UZIP.js) is both faster (by up to 25%) and smaller (14 kB minified) than `pako`, and it contains a variety of innovations that make it excellent for both performance and compression ratio. However, the developer made a variety of tiny mistakes and inefficient design choices that make it imperfect. Moreover, it does not support GZIP or Zlib data directly; one must remove the headers manually to use `UZIP.js`. + +So what makes `fflate` different? It takes the brilliant innovations of `UZIP.js` and optimizes them while adding direct support for GZIP and Zlib data. And unlike all of the above libraries, it uses ES Modules to allow for partial builds through tree shaking, meaning that it can rival even `tiny-inflate` in size while maintaining excellent performance. The end result is a library that, in total, weighs 8kB minified for the core build (3kB for decompression only and 5kB for compression only), is about 25% faster than `UZIP.js` or up to 50% faster than `pako`, and achieves the same or better compression ratio than the rest. + +Before you decide that `fflate` is the end-all compression library, you should note that JavaScript simply cannot rival the performance of a native program. If you're only using Node.js, it's probably better to use the [native Zlib bindings](https://nodejs.org/api/zlib.html), which tend to offer the best performance. Though note that even against Zlib, `fflate` is only around 30% slower in decompression and 10% slower in compression, and can still achieve better compression ratios! + +## What about `CompressionStream`? +Like `fflate`, the [Compression Streams API](https://developer.mozilla.org/en-US/docs/Web/API/Compression_Streams_API) provides DEFLATE, GZIP, and Zlib compression and decompression support. It's a good option if you'd like to compress or decompress data without installing any third-party libraries, and it wraps native Zlib bindings to achieve better performance than what most JavaScript programs can achieve. + +However, browsers do not offer any native non-streaming compression API, and `CompressionStream` has surprisingly poor performance on data already loaded into memory; `fflate` tends to be faster even for files that are dozens of megabytes large. Similarly, `fflate` is much faster for files under a megabyte because it avoids marshalling overheads. Even when streaming hundreds of megabytes of data, the native API usually performs between 30% faster and 10% slower than `fflate`. And Compression Streams have many other disadvantages - no ability to control compression level, poor support for older browsers, no ZIP support, etc. + +If you'd still prefer to depend upon a native browser API but want to support older browsers, you can use an `fflate`-based [Compression Streams ponyfill](https://github.com/101arrowz/compression-streams-polyfill). + +## Browser support +`fflate` makes heavy use of typed arrays (`Uint8Array`, `Uint16Array`, etc.). Typed arrays can be polyfilled at the cost of performance, but the most recent browser that doesn't support them [is from 2011](https://caniuse.com/typedarrays), so I wouldn't bother. + +The asynchronous APIs also use `Worker`, which is not supported in a few browsers (however, the vast majority of browsers that support typed arrays support `Worker`). + +Other than that, `fflate` is completely ES3, meaning you probably won't even need a bundler to use it. + +## Testing +You can validate the performance of `fflate` with `npm test`. It validates that the module is working as expected, ensures the outputs are no more than 5% larger than competitors at max compression, and outputs performance metrics to `test/results`. + +Note that the time it takes for the CLI to show the completion of each test is not representative of the time each package took, so please check the JSON output if you want accurate measurements. + +## License + +This software is [MIT Licensed](./LICENSE), with special exemptions for projects +and organizations as noted below: + +- [SheetJS](https://github.com/SheetJS/) is exempt from MIT licensing and may + license any source code from this software under the BSD Zero Clause License diff --git a/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/esm/browser.d.ts b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/esm/browser.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d430faf2b555c978d66c89f46155b72c2c45a971 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/esm/browser.d.ts @@ -0,0 +1,1539 @@ +/** + * Codes for errors generated within this library + */ +export declare const FlateErrorCode: { + readonly UnexpectedEOF: 0; + readonly InvalidBlockType: 1; + readonly InvalidLengthLiteral: 2; + readonly InvalidDistance: 3; + readonly StreamFinished: 4; + readonly NoStreamHandler: 5; + readonly InvalidHeader: 6; + readonly NoCallback: 7; + readonly InvalidUTF8: 8; + readonly ExtraFieldTooLong: 9; + readonly InvalidDate: 10; + readonly FilenameTooLong: 11; + readonly StreamFinishing: 12; + readonly InvalidZipData: 13; + readonly UnknownCompressionMethod: 14; +}; +/** + * An error generated within this library + */ +export interface FlateError extends Error { + /** + * The code associated with this error + */ + code: number; +} +/** + * Options for decompressing a DEFLATE stream + */ +export interface InflateStreamOptions { + /** + * The dictionary used to compress the original data. If no dictionary was used during compression, this option has no effect. + * + * Supplying the wrong dictionary during decompression usually yields corrupt output or causes an invalid distance error. + */ + dictionary?: Uint8Array; +} +/** + * Options for decompressing DEFLATE data + */ +export interface InflateOptions extends InflateStreamOptions { + /** + * The buffer into which to write the decompressed data. Saves memory if you know the decompressed size in advance. + * + * Note that if the decompression result is larger than the size of this buffer, it will be truncated to fit. + */ + out?: Uint8Array; +} +/** + * Options for decompressing a GZIP stream + */ +export interface GunzipStreamOptions extends InflateStreamOptions { +} +/** + * Options for decompressing GZIP data + */ +export interface GunzipOptions extends InflateStreamOptions { + /** + * The buffer into which to write the decompressed data. GZIP already encodes the output size, so providing this doesn't save memory. + * + * Note that if the decompression result is larger than the size of this buffer, it will be truncated to fit. + */ + out?: Uint8Array; +} +/** + * Options for decompressing a Zlib stream + */ +export interface UnzlibStreamOptions extends InflateStreamOptions { +} +/** + * Options for decompressing Zlib data + */ +export interface UnzlibOptions extends InflateOptions { +} +/** + * Options for compressing data into a DEFLATE format + */ +export interface DeflateOptions { + /** + * The level of compression to use, ranging from 0-9. + * + * 0 will store the data without compression. + * 1 is fastest but compresses the worst, 9 is slowest but compresses the best. + * The default level is 6. + * + * Typically, binary data benefits much more from higher values than text data. + * In both cases, higher values usually take disproportionately longer than the reduction in final size that results. + * + * For example, a 1 MB text file could: + * - become 1.01 MB with level 0 in 1ms + * - become 400 kB with level 1 in 10ms + * - become 320 kB with level 9 in 100ms + */ + level?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; + /** + * The memory level to use, ranging from 0-12. Increasing this increases speed and compression ratio at the cost of memory. + * + * Note that this is exponential: while level 0 uses 8 kB, level 4 uses 128 kB, level 8 uses 2 MB, and level 12 uses 32 MB. + * It is recommended not to lower the value below 4, since that tends to hurt performance. + * In addition, values above 8 tend to help very little on most data and can even hurt performance. + * + * The default value is automatically determined based on the size of the input data. + */ + mem?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12; + /** + * A buffer containing common byte sequences in the input data that can be used to significantly improve compression ratios. + * + * Dictionaries should be 32kB or smaller and include strings or byte sequences likely to appear in the input. + * The decompressor must supply the same dictionary as the compressor to extract the original data. + * + * Dictionaries only improve aggregate compression ratio when reused across multiple small inputs. They should typically not be used otherwise. + * + * Avoid using dictionaries with GZIP and ZIP to maximize software compatibility. + */ + dictionary?: Uint8Array; +} +/** + * Options for compressing data into a GZIP format + */ +export interface GzipOptions extends DeflateOptions { + /** + * When the file was last modified. Defaults to the current time. + * Set this to 0 to avoid revealing a modification date entirely. + */ + mtime?: Date | string | number; + /** + * The filename of the data. If the `gunzip` command is used to decompress the data, it will output a file + * with this name instead of the name of the compressed file. + */ + filename?: string; +} +/** + * Options for compressing data into a Zlib format + */ +export interface ZlibOptions extends DeflateOptions { +} +/** + * Handler for data (de)compression streams + * @param data The data output from the stream processor + * @param final Whether this is the final block + */ +export type FlateStreamHandler = (data: Uint8Array, final: boolean) => void; +/** + * Handler for asynchronous data (de)compression streams + * @param err Any error that occurred + * @param data The data output from the stream processor + * @param final Whether this is the final block + */ +export type AsyncFlateStreamHandler = (err: FlateError | null, data: Uint8Array, final: boolean) => void; +/** + * Handler for the asynchronous completion of (de)compression for a data chunk + * @param size The number of bytes that were processed. This is measured in terms of the input + * (i.e. compressed bytes for decompression, uncompressed bytes for compression.) + */ +export type AsyncFlateDrainHandler = (size: number) => void; +/** + * Callback for asynchronous (de)compression methods + * @param err Any error that occurred + * @param data The resulting data. Only present if `err` is null + */ +export type FlateCallback = (err: FlateError | null, data: Uint8Array) => void; +interface AsyncOptions { + /** + * Whether or not to "consume" the source data. This will make the typed array/buffer you pass in + * unusable but will increase performance and reduce memory usage. + */ + consume?: boolean; +} +/** + * Options for compressing data asynchronously into a DEFLATE format + */ +export interface AsyncDeflateOptions extends DeflateOptions, AsyncOptions { +} +/** + * Options for decompressing DEFLATE data asynchronously + */ +export interface AsyncInflateOptions extends AsyncOptions, InflateStreamOptions { + /** + * The original size of the data. Currently, the asynchronous API disallows + * writing into a buffer you provide; the best you can do is provide the + * size in bytes and be given back a new typed array. + */ + size?: number; +} +/** + * Options for compressing data asynchronously into a GZIP format + */ +export interface AsyncGzipOptions extends GzipOptions, AsyncOptions { +} +/** + * Options for decompressing GZIP data asynchronously + */ +export interface AsyncGunzipOptions extends AsyncOptions, InflateStreamOptions { +} +/** + * Options for compressing data asynchronously into a Zlib format + */ +export interface AsyncZlibOptions extends ZlibOptions, AsyncOptions { +} +/** + * Options for decompressing Zlib data asynchronously + */ +export interface AsyncUnzlibOptions extends AsyncInflateOptions { +} +/** + * A terminable compression/decompression process + */ +export interface AsyncTerminable { + /** + * Terminates the worker thread immediately. The callback will not be called. + */ + (): void; +} +/** + * Streaming DEFLATE compression + */ +export declare class Deflate { + /** + * Creates a DEFLATE stream + * @param opts The compression options + * @param cb The callback to call whenever data is deflated + */ + constructor(opts: DeflateOptions, cb?: FlateStreamHandler); + /** + * Creates a DEFLATE stream + * @param cb The callback to call whenever data is deflated + */ + constructor(cb?: FlateStreamHandler); + private b; + private s; + private o; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + private p; + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * deflated output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. A separate DEFLATE stream may be concatenated + * with the current output after a sync flush. + */ + flush(sync?: boolean): void; +} +/** + * Asynchronous streaming DEFLATE compression + */ +export declare class AsyncDeflate { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of uncompressed bytes buffered in the stream + */ + queuedSize: number; + /** + * Creates an asynchronous DEFLATE stream + * @param opts The compression options + * @param cb The callback to call whenever data is deflated + */ + constructor(opts: DeflateOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous DEFLATE stream + * @param cb The callback to call whenever data is deflated + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * deflated output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. A separate DEFLATE stream may be concatenated + * with the current output after a sync flush. + */ + flush(sync?: boolean): void; + /** + * A method to terminate the stream's internal worker. Subsequent calls to + * push() will silently fail. + */ + terminate: AsyncTerminable; +} +/** + * Asynchronously compresses data with DEFLATE without any wrapper + * @param data The data to compress + * @param opts The compression options + * @param cb The function to be called upon compression completion + * @returns A function that can be used to immediately terminate the compression + */ +export declare function deflate(data: Uint8Array, opts: AsyncDeflateOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously compresses data with DEFLATE without any wrapper + * @param data The data to compress + * @param cb The function to be called upon compression completion + */ +export declare function deflate(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Compresses data with DEFLATE without any wrapper + * @param data The data to compress + * @param opts The compression options + * @returns The deflated version of the data + */ +export declare function deflateSync(data: Uint8Array, opts?: DeflateOptions): Uint8Array; +/** + * Streaming DEFLATE decompression + */ +export declare class Inflate { + private s; + private o; + private p; + private d; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + /** + * Creates a DEFLATE decompression stream + * @param opts The decompression options + * @param cb The callback to call whenever data is inflated + */ + constructor(opts: InflateStreamOptions, cb?: FlateStreamHandler); + /** + * Creates a DEFLATE decompression stream + * @param cb The callback to call whenever data is inflated + */ + constructor(cb?: FlateStreamHandler); + private e; + private c; + /** + * Pushes a chunk to be inflated + * @param chunk The chunk to push + * @param final Whether this is the final chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Asynchronous streaming DEFLATE decompression + */ +export declare class AsyncInflate { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of compressed bytes buffered in the stream + */ + queuedSize: number; + /** + * Creates an asynchronous DEFLATE decompression stream + * @param opts The decompression options + * @param cb The callback to call whenever data is inflated + */ + constructor(opts: InflateStreamOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous DEFLATE decompression stream + * @param cb The callback to call whenever data is inflated + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Pushes a chunk to be inflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * A method to terminate the stream's internal worker. Subsequent calls to + * push() will silently fail. + */ + terminate: AsyncTerminable; +} +/** + * Asynchronously expands DEFLATE data with no wrapper + * @param data The data to decompress + * @param opts The decompression options + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function inflate(data: Uint8Array, opts: AsyncInflateOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously expands DEFLATE data with no wrapper + * @param data The data to decompress + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function inflate(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Expands DEFLATE data with no wrapper + * @param data The data to decompress + * @returns The decompressed version of the data + */ +export declare function inflateSync(data: Uint8Array): Uint8Array; +/** + * Expands DEFLATE data with no wrapper + * @param data The data to decompress + * @param opts The decompression options + * @returns The decompressed version of the data + */ +export declare function inflateSync(data: Uint8Array, opts?: InflateOptions): Uint8Array; +/** + * Streaming GZIP compression + */ +export declare class Gzip { + private c; + private l; + private v; + private o; + private s; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + /** + * Creates a GZIP stream + * @param opts The compression options + * @param cb The callback to call whenever data is deflated + */ + constructor(opts: GzipOptions, cb?: FlateStreamHandler); + /** + * Creates a GZIP stream + * @param cb The callback to call whenever data is deflated + */ + constructor(cb?: FlateStreamHandler); + /** + * Pushes a chunk to be GZIPped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + private p; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * GZIPped output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. + */ + flush(sync?: boolean): void; +} +/** + * Asynchronous streaming GZIP compression + */ +export declare class AsyncGzip { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of uncompressed bytes buffered in the stream + */ + queuedSize: number; + /** + * Creates an asynchronous GZIP stream + * @param opts The compression options + * @param cb The callback to call whenever data is deflated + */ + constructor(opts: GzipOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous GZIP stream + * @param cb The callback to call whenever data is deflated + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Pushes a chunk to be GZIPped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * GZIPped output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. + */ + flush(sync?: boolean): void; + /** + * A method to terminate the stream's internal worker. Subsequent calls to + * push() will silently fail. + */ + terminate: AsyncTerminable; +} +/** + * Asynchronously compresses data with GZIP + * @param data The data to compress + * @param opts The compression options + * @param cb The function to be called upon compression completion + * @returns A function that can be used to immediately terminate the compression + */ +export declare function gzip(data: Uint8Array, opts: AsyncGzipOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously compresses data with GZIP + * @param data The data to compress + * @param cb The function to be called upon compression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function gzip(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Compresses data with GZIP + * @param data The data to compress + * @param opts The compression options + * @returns The gzipped version of the data + */ +export declare function gzipSync(data: Uint8Array, opts?: GzipOptions): Uint8Array; +/** + * Handler for new GZIP members in concatenated GZIP streams. Useful for building indices used to perform random-access reads on compressed files. + * @param offset The offset of the new member relative to the start of the stream + */ +export type GunzipMemberHandler = (offset: number) => void; +/** + * Streaming single or multi-member GZIP decompression + */ +export declare class Gunzip { + private v; + private r; + private o; + private p; + private s; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + /** + * The handler to call whenever a new GZIP member is found + */ + onmember?: GunzipMemberHandler; + /** + * Creates a GUNZIP stream + * @param opts The decompression options + * @param cb The callback to call whenever data is inflated + */ + constructor(opts: GunzipStreamOptions, cb?: FlateStreamHandler); + /** + * Creates a GUNZIP stream + * @param cb The callback to call whenever data is inflated + */ + constructor(cb?: FlateStreamHandler); + /** + * Pushes a chunk to be GUNZIPped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Asynchronous streaming single or multi-member GZIP decompression + */ +export declare class AsyncGunzip { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of compressed bytes buffered in the stream + */ + queuedSize: number; + /** + * The handler to call whenever a new GZIP member is found + */ + onmember?: GunzipMemberHandler; + /** + * Creates an asynchronous GUNZIP stream + * @param opts The decompression options + * @param cb The callback to call whenever data is inflated + */ + constructor(opts: GunzipStreamOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous GUNZIP stream + * @param cb The callback to call whenever data is inflated + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Pushes a chunk to be GUNZIPped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * A method to terminate the stream's internal worker. Subsequent calls to + * push() will silently fail. + */ + terminate: AsyncTerminable; +} +/** + * Asynchronously expands GZIP data + * @param data The data to decompress + * @param opts The decompression options + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function gunzip(data: Uint8Array, opts: AsyncGunzipOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously expands GZIP data + * @param data The data to decompress + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function gunzip(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Expands GZIP data + * @param data The data to decompress + * @returns The decompressed version of the data + */ +export declare function gunzipSync(data: Uint8Array): Uint8Array; +/** + * Expands GZIP data + * @param data The data to decompress + * @param opts The decompression options + * @returns The decompressed version of the data + */ +export declare function gunzipSync(data: Uint8Array, opts?: GunzipOptions): Uint8Array; +/** + * Streaming Zlib compression + */ +export declare class Zlib { + private c; + private v; + private o; + private s; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + /** + * Creates a Zlib stream + * @param opts The compression options + * @param cb The callback to call whenever data is deflated + */ + constructor(opts: ZlibOptions, cb?: FlateStreamHandler); + /** + * Creates a Zlib stream + * @param cb The callback to call whenever data is deflated + */ + constructor(cb?: FlateStreamHandler); + /** + * Pushes a chunk to be zlibbed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + private p; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * zlibbed output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. + */ + flush(sync?: boolean): void; +} +/** + * Asynchronous streaming Zlib compression + */ +export declare class AsyncZlib { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of uncompressed bytes buffered in the stream + */ + queuedSize: number; + /** + * Creates an asynchronous Zlib stream + * @param opts The compression options + * @param cb The callback to call whenever data is deflated + */ + constructor(opts: ZlibOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous Zlib stream + * @param cb The callback to call whenever data is deflated + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * zlibbed output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. + */ + flush(sync?: boolean): void; + /** + * A method to terminate the stream's internal worker. Subsequent calls to + * push() will silently fail. + */ + terminate: AsyncTerminable; +} +/** + * Asynchronously compresses data with Zlib + * @param data The data to compress + * @param opts The compression options + * @param cb The function to be called upon compression completion + */ +export declare function zlib(data: Uint8Array, opts: AsyncZlibOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously compresses data with Zlib + * @param data The data to compress + * @param cb The function to be called upon compression completion + * @returns A function that can be used to immediately terminate the compression + */ +export declare function zlib(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Compress data with Zlib + * @param data The data to compress + * @param opts The compression options + * @returns The zlib-compressed version of the data + */ +export declare function zlibSync(data: Uint8Array, opts?: ZlibOptions): Uint8Array; +/** + * Streaming Zlib decompression + */ +export declare class Unzlib { + private v; + private p; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + /** + * Creates a Zlib decompression stream + * @param opts The decompression options + * @param cb The callback to call whenever data is inflated + */ + constructor(opts: UnzlibStreamOptions, cb?: FlateStreamHandler); + /** + * Creates a Zlib decompression stream + * @param cb The callback to call whenever data is inflated + */ + constructor(cb?: FlateStreamHandler); + /** + * Pushes a chunk to be unzlibbed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Asynchronous streaming Zlib decompression + */ +export declare class AsyncUnzlib { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of compressed bytes buffered in the stream + */ + queuedSize: number; + /** + * Creates an asynchronous Zlib decompression stream + * @param opts The decompression options + * @param cb The callback to call whenever data is inflated + */ + constructor(opts: UnzlibStreamOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous Zlib decompression stream + * @param cb The callback to call whenever data is inflated + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Pushes a chunk to be decompressed from Zlib + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * A method to terminate the stream's internal worker. Subsequent calls to + * push() will silently fail. + */ + terminate: AsyncTerminable; +} +/** + * Asynchronously expands Zlib data + * @param data The data to decompress + * @param opts The decompression options + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function unzlib(data: Uint8Array, opts: AsyncUnzlibOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously expands Zlib data + * @param data The data to decompress + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function unzlib(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Expands Zlib data + * @param data The data to decompress + * @returns The decompressed version of the data + */ +export declare function unzlibSync(data: Uint8Array): Uint8Array; +/** + * Expands Zlib data + * @param data The data to decompress + * @param opts The decompression options + * @returns The decompressed version of the data + */ +export declare function unzlibSync(data: Uint8Array, opts?: UnzlibOptions): Uint8Array; +export { gzip as compress, AsyncGzip as AsyncCompress }; +export { gzipSync as compressSync, Gzip as Compress }; +/** + * Streaming GZIP, Zlib, or raw DEFLATE decompression + */ +export declare class Decompress { + private G; + private I; + private Z; + private o; + private s; + private p; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + /** + * Creates a decompression stream + * @param opts The decompression options + * @param cb The callback to call whenever data is decompressed + */ + constructor(opts: InflateStreamOptions, cb?: FlateStreamHandler); + /** + * Creates a decompression stream + * @param cb The callback to call whenever data is decompressed + */ + constructor(cb?: FlateStreamHandler); + private i; + /** + * Pushes a chunk to be decompressed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression + */ +export declare class AsyncDecompress { + private G; + private I; + private Z; + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of compressed bytes buffered in the stream + */ + queuedSize: number; + /** + * Creates an asynchronous decompression stream + * @param opts The decompression options + * @param cb The callback to call whenever data is decompressed + */ + constructor(opts: InflateStreamOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous decompression stream + * @param cb The callback to call whenever data is decompressed + */ + constructor(cb?: AsyncFlateStreamHandler); + private i; + /** + * Pushes a chunk to be decompressed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Asynchrononously expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format + * @param data The data to decompress + * @param opts The decompression options + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function decompress(data: Uint8Array, opts: AsyncInflateOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchrononously expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format + * @param data The data to decompress + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function decompress(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format + * @param data The data to decompress + * @param opts The decompression options + * @returns The decompressed version of the data + */ +export declare function decompressSync(data: Uint8Array, opts?: InflateOptions): Uint8Array; +/** + * Attributes for files added to a ZIP archive object + */ +export interface ZipAttributes { + /** + * The operating system of origin for this file. The value is defined + * by PKZIP's APPNOTE.txt, section 4.4.2.2. For example, 0 (the default) + * is MS/DOS, 3 is Unix, 19 is macOS. + */ + os?: number; + /** + * The file's attributes. These are traditionally somewhat complicated + * and platform-dependent, so using them is scarcely necessary. However, + * here is a representation of what this is, bit by bit: + * + * `TTTTugtrwxrwxrwx0000000000ADVSHR` + * + * TTTT = file type (rarely useful) + * + * u = setuid, g = setgid, t = sticky + * + * rwx = user permissions, rwx = group permissions, rwx = other permissions + * + * 0000000000 = unused + * + * A = archive, D = directory, V = volume label, S = system file, H = hidden, R = read-only + * + * If you want to set the Unix permissions, for instance, just bit shift by 16, e.g. 0o644 << 16. + * Note that attributes usually only work in conjunction with the `os` setting: you must use + * `os` = 3 (Unix) if you want to set Unix permissions + */ + attrs?: number; + /** + * Extra metadata to add to the file. This field is defined by PKZIP's APPNOTE.txt, + * section 4.4.28. At most 65,535 bytes may be used in each ID. The ID must be an + * integer between 0 and 65,535, inclusive. + * + * This field is incredibly rare and almost never needed except for compliance with + * proprietary standards and software. + */ + extra?: Record; + /** + * The comment to attach to the file. This field is defined by PKZIP's APPNOTE.txt, + * section 4.4.26. The comment must be at most 65,535 bytes long UTF-8 encoded. This + * field is not read by consumer software. + */ + comment?: string; + /** + * When the file was last modified. Defaults to the current time. + */ + mtime?: GzipOptions['mtime']; +} +/** + * Options for creating a ZIP archive + */ +export interface ZipOptions extends DeflateOptions, ZipAttributes { +} +/** + * Options for expanding a ZIP archive + */ +export interface UnzipOptions { + /** + * A filter function to extract only certain files from a ZIP archive + */ + filter?: UnzipFileFilter; +} +/** + * Options for asynchronously creating a ZIP archive + */ +export interface AsyncZipOptions extends AsyncDeflateOptions, ZipAttributes { +} +/** + * Options for asynchronously expanding a ZIP archive + */ +export interface AsyncUnzipOptions extends UnzipOptions { +} +/** + * A file that can be used to create a ZIP archive + */ +export type ZippableFile = Uint8Array | Zippable | [Uint8Array | Zippable, ZipOptions]; +/** + * A file that can be used to asynchronously create a ZIP archive + */ +export type AsyncZippableFile = Uint8Array | AsyncZippable | [Uint8Array | AsyncZippable, AsyncZipOptions]; +/** + * The complete directory structure of a ZIPpable archive + */ +export interface Zippable { + [path: string]: ZippableFile; +} +/** + * The complete directory structure of an asynchronously ZIPpable archive + */ +export interface AsyncZippable { + [path: string]: AsyncZippableFile; +} +/** + * An unzipped archive. The full path of each file is used as the key, + * and the file is the value + */ +export interface Unzipped { + [path: string]: Uint8Array; +} +/** + * Handler for string generation streams + * @param data The string output from the stream processor + * @param final Whether this is the final block + */ +export type StringStreamHandler = (data: string, final: boolean) => void; +/** + * Callback for asynchronous ZIP decompression + * @param err Any error that occurred + * @param data The decompressed ZIP archive + */ +export type UnzipCallback = (err: FlateError | null, data: Unzipped) => void; +/** + * Handler for streaming ZIP decompression + * @param file The file that was found in the archive + */ +export type UnzipFileHandler = (file: UnzipFile) => void; +/** + * Streaming UTF-8 decoding + */ +export declare class DecodeUTF8 { + private p; + private t; + /** + * Creates a UTF-8 decoding stream + * @param cb The callback to call whenever data is decoded + */ + constructor(cb?: StringStreamHandler); + /** + * Pushes a chunk to be decoded from UTF-8 binary + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * The handler to call whenever data is available + */ + ondata: StringStreamHandler; +} +/** + * Streaming UTF-8 encoding + */ +export declare class EncodeUTF8 { + private d; + /** + * Creates a UTF-8 decoding stream + * @param cb The callback to call whenever data is encoded + */ + constructor(cb?: FlateStreamHandler); + /** + * Pushes a chunk to be encoded to UTF-8 + * @param chunk The string data to push + * @param final Whether this is the last chunk + */ + push(chunk: string, final?: boolean): void; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; +} +/** + * Converts a string into a Uint8Array for use with compression/decompression methods + * @param str The string to encode + * @param latin1 Whether or not to interpret the data as Latin-1. This should + * not need to be true unless decoding a binary string. + * @returns The string encoded in UTF-8/Latin-1 binary + */ +export declare function strToU8(str: string, latin1?: boolean): Uint8Array; +/** + * Converts a Uint8Array to a string + * @param dat The data to decode to string + * @param latin1 Whether or not to interpret the data as Latin-1. This should + * not need to be true unless encoding to binary string. + * @returns The original UTF-8/Latin-1 string + */ +export declare function strFromU8(dat: Uint8Array, latin1?: boolean): string; +/** + * A stream that can be used to create a file in a ZIP archive + */ +export interface ZipInputFile extends ZipAttributes { + /** + * The filename to associate with the data provided to this stream. If you + * want a file in a subdirectory, use forward slashes as a separator (e.g. + * `directory/filename.ext`). This will still work on Windows. + */ + filename: string; + /** + * The size of the file in bytes. This attribute may be invalid after + * the file is added to the ZIP archive; it must be correct only before the + * stream completes. + * + * If you don't want to have to compute this yourself, consider extending the + * ZipPassThrough class and overriding its process() method, or using one of + * ZipDeflate or AsyncZipDeflate. + */ + size: number; + /** + * A CRC of the original file contents. This attribute may be invalid after + * the file is added to the ZIP archive; it must be correct only before the + * stream completes. + * + * If you don't want to have to generate this yourself, consider extending the + * ZipPassThrough class and overriding its process() method, or using one of + * ZipDeflate or AsyncZipDeflate. + */ + crc: number; + /** + * The compression format for the data stream. This number is determined by + * the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no + * compression, 8 = deflate, 14 = LZMA + */ + compression: number; + /** + * Bits 1 and 2 of the general purpose bit flag, specified in PKZIP's + * APPNOTE.txt, section 4.4.4. Should be between 0 and 3. This is unlikely + * to be necessary. + */ + flag?: number; + /** + * The handler to be called when data is added. After passing this stream to + * the ZIP file object, this handler will always be defined. To call it: + * + * `stream.ondata(error, chunk, final)` + * + * error = any error that occurred (null if there was no error) + * + * chunk = a Uint8Array of the data that was added (null if there was an + * error) + * + * final = boolean, whether this is the final chunk in the stream + */ + ondata?: AsyncFlateStreamHandler; + /** + * A method called when the stream is no longer needed, for clean-up + * purposes. This will not always be called after the stream completes, + * so you may wish to call this.terminate() after the final chunk is + * processed if you have clean-up logic. + */ + terminate?: AsyncTerminable; +} +/** + * A pass-through stream to keep data uncompressed in a ZIP archive. + */ +export declare class ZipPassThrough implements ZipInputFile { + filename: string; + crc: number; + size: number; + compression: number; + os?: number; + attrs?: number; + comment?: string; + extra?: Record; + mtime?: GzipOptions['mtime']; + ondata: AsyncFlateStreamHandler; + private c; + /** + * Creates a pass-through stream that can be added to ZIP archives + * @param filename The filename to associate with this data stream + */ + constructor(filename: string); + /** + * Processes a chunk and pushes to the output stream. You can override this + * method in a subclass for custom behavior, but by default this passes + * the data through. You must call this.ondata(err, chunk, final) at some + * point in this method. + * @param chunk The chunk to process + * @param final Whether this is the last chunk + */ + protected process(chunk: Uint8Array, final: boolean): void; + /** + * Pushes a chunk to be added. If you are subclassing this with a custom + * compression algorithm, note that you must push data from the source + * file only, pre-compression. + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate + * for better performance + */ +export declare class ZipDeflate implements ZipInputFile { + filename: string; + crc: number; + size: number; + compression: number; + flag: 0 | 1 | 2 | 3; + os?: number; + attrs?: number; + comment?: string; + extra?: Record; + mtime?: GzipOptions['mtime']; + ondata: AsyncFlateStreamHandler; + private d; + /** + * Creates a DEFLATE stream that can be added to ZIP archives + * @param filename The filename to associate with this data stream + * @param opts The compression options + */ + constructor(filename: string, opts?: DeflateOptions); + private process; + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Asynchronous streaming DEFLATE compression for ZIP archives + */ +export declare class AsyncZipDeflate implements ZipInputFile { + filename: string; + crc: number; + size: number; + compression: number; + flag: 0 | 1 | 2 | 3; + os?: number; + attrs?: number; + comment?: string; + extra?: Record; + mtime?: GzipOptions['mtime']; + ondata: AsyncFlateStreamHandler; + private d; + terminate: AsyncTerminable; + /** + * Creates an asynchronous DEFLATE stream that can be added to ZIP archives + * @param filename The filename to associate with this data stream + * @param opts The compression options + */ + constructor(filename: string, opts?: DeflateOptions); + private process; + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * A zippable archive to which files can incrementally be added + */ +export declare class Zip { + private u; + private d; + /** + * Creates an empty ZIP archive to which files can be added + * @param cb The callback to call whenever data for the generated ZIP archive + * is available + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Adds a file to the ZIP archive + * @param file The file stream to add + */ + add(file: ZipInputFile): void; + /** + * Ends the process of adding files and prepares to emit the final chunks. + * This *must* be called after adding all desired files for the resulting + * ZIP file to work properly. + */ + end(): void; + private e; + /** + * A method to terminate any internal workers used by the stream. Subsequent + * calls to add() will fail. + */ + terminate(): void; + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; +} +/** + * Asynchronously creates a ZIP file + * @param data The directory structure for the ZIP archive + * @param opts The main options, merged with per-file options + * @param cb The callback to call with the generated ZIP archive + * @returns A function that can be used to immediately terminate the compression + */ +export declare function zip(data: AsyncZippable, opts: AsyncZipOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously creates a ZIP file + * @param data The directory structure for the ZIP archive + * @param cb The callback to call with the generated ZIP archive + * @returns A function that can be used to immediately terminate the compression + */ +export declare function zip(data: AsyncZippable, cb: FlateCallback): AsyncTerminable; +/** + * Synchronously creates a ZIP file. Prefer using `zip` for better performance + * with more than one file. + * @param data The directory structure for the ZIP archive + * @param opts The main options, merged with per-file options + * @returns The generated ZIP archive + */ +export declare function zipSync(data: Zippable, opts?: ZipOptions): Uint8Array; +/** + * A decoder for files in ZIP streams + */ +export interface UnzipDecoder { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * Pushes a chunk to be decompressed + * @param chunk The data in this chunk. Do not consume (detach) this buffer. + * @param final Whether this is the last chunk in the data stream + */ + push(chunk: Uint8Array, final: boolean): void; + /** + * A method to terminate any internal workers used by the stream. Subsequent + * calls to push() should silently fail. + */ + terminate?: AsyncTerminable; +} +/** + * A constructor for a decoder for unzip streams + */ +export interface UnzipDecoderConstructor { + /** + * Creates an instance of the decoder + * @param filename The name of the file + * @param size The compressed size of the file + * @param originalSize The original size of the file + */ + new (filename: string, size?: number, originalSize?: number): UnzipDecoder; + /** + * The compression format for the data stream. This number is determined by + * the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no + * compression, 8 = deflate, 14 = LZMA + */ + compression: number; +} +/** + * Information about a file to be extracted from a ZIP archive + */ +export interface UnzipFileInfo { + /** + * The name of the file + */ + name: string; + /** + * The compressed size of the file + */ + size: number; + /** + * The original size of the file + */ + originalSize: number; + /** + * The compression format for the data stream. This number is determined by + * the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no + * compression, 8 = deflate, 14 = LZMA. If the filter function returns true + * but this value is not 8, the unzip function will throw. + */ + compression: number; +} +/** + * A filter for files to be extracted during the unzipping process + * @param file The info for the current file being processed + * @returns Whether or not to extract the current file + */ +export type UnzipFileFilter = (file: UnzipFileInfo) => boolean; +/** + * Streaming file extraction from ZIP archives + */ +export interface UnzipFile { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The name of the file + */ + name: string; + /** + * The compression format for the data stream. This number is determined by + * the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no + * compression, 8 = deflate, 14 = LZMA. If start() is called but there is no + * decompression stream available for this method, start() will throw. + */ + compression: number; + /** + * The compressed size of the file. Will not be present for archives created + * in a streaming fashion. + */ + size?: number; + /** + * The original size of the file. Will not be present for archives created + * in a streaming fashion. + */ + originalSize?: number; + /** + * Starts reading from the stream. Calling this function will always enable + * this stream, but ocassionally the stream will be enabled even without + * this being called. + */ + start(): void; + /** + * A method to terminate any internal workers used by the stream. ondata + * will not be called any further. + */ + terminate: AsyncTerminable; +} +/** + * Streaming pass-through decompression for ZIP archives + */ +export declare class UnzipPassThrough implements UnzipDecoder { + static compression: number; + ondata: AsyncFlateStreamHandler; + push(chunk: Uint8Array, final: boolean): void; +} +/** + * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for + * better performance. + */ +export declare class UnzipInflate implements UnzipDecoder { + static compression: number; + private i; + ondata: AsyncFlateStreamHandler; + /** + * Creates a DEFLATE decompression that can be used in ZIP archives + */ + constructor(); + push(chunk: Uint8Array, final: boolean): void; +} +/** + * Asynchronous streaming DEFLATE decompression for ZIP archives + */ +export declare class AsyncUnzipInflate implements UnzipDecoder { + static compression: number; + private i; + ondata: AsyncFlateStreamHandler; + terminate: AsyncTerminable; + /** + * Creates a DEFLATE decompression that can be used in ZIP archives + */ + constructor(_: string, sz?: number); + push(chunk: Uint8Array, final: boolean): void; +} +/** + * A ZIP archive decompression stream that emits files as they are discovered + */ +export declare class Unzip { + private d; + private c; + private p; + private k; + private o; + /** + * Creates a ZIP decompression stream + * @param cb The callback to call whenever a file in the ZIP archive is found + */ + constructor(cb?: UnzipFileHandler); + /** + * Pushes a chunk to be unzipped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * Registers a decoder with the stream, allowing for files compressed with + * the compression type provided to be expanded correctly + * @param decoder The decoder constructor + */ + register(decoder: UnzipDecoderConstructor): void; + /** + * The handler to call whenever a file is discovered + */ + onfile: UnzipFileHandler; +} +/** + * Asynchronously decompresses a ZIP archive + * @param data The raw compressed ZIP file + * @param opts The ZIP extraction options + * @param cb The callback to call with the decompressed files + * @returns A function that can be used to immediately terminate the unzipping + */ +export declare function unzip(data: Uint8Array, opts: AsyncUnzipOptions, cb: UnzipCallback): AsyncTerminable; +/** + * Asynchronously decompresses a ZIP archive + * @param data The raw compressed ZIP file + * @param cb The callback to call with the decompressed files + * @returns A function that can be used to immediately terminate the unzipping + */ +export declare function unzip(data: Uint8Array, cb: UnzipCallback): AsyncTerminable; +/** + * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better + * performance with more than one file. + * @param data The raw compressed ZIP file + * @param opts The ZIP extraction options + * @returns The decompressed files + */ +export declare function unzipSync(data: Uint8Array, opts?: UnzipOptions): Unzipped; diff --git a/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/esm/browser.js b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/esm/browser.js new file mode 100644 index 0000000000000000000000000000000000000000..82af0fdb655f00655d2da3354c4533744edcde6e --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/esm/browser.js @@ -0,0 +1,2692 @@ +// DEFLATE is a complex format; to read this code, you should probably check the RFC first: +// https://tools.ietf.org/html/rfc1951 +// You may also wish to take a look at the guide I made about this program: +// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad +// Some of the following code is similar to that of UZIP.js: +// https://github.com/photopea/UZIP.js +// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size. +// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint +// is better for memory in most engines (I *think*). +var ch2 = {}; +var wk = (function (c, id, msg, transfer, cb) { + var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([ + c + ';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})' + ], { type: 'text/javascript' })))); + w.onmessage = function (e) { + var d = e.data, ed = d.$e$; + if (ed) { + var err = new Error(ed[0]); + err['code'] = ed[1]; + err.stack = ed[2]; + cb(err, null); + } + else + cb(null, d); + }; + w.postMessage(msg, transfer); + return w; +}); + +// aliases for shorter compressed code (most minifers don't do this) +var u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array; +// fixed length extra bits +var fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]); +// fixed distance extra bits +var fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, /* unused */ 0, 0]); +// code length index map +var clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]); +// get base, reverse index map from extra bits +var freb = function (eb, start) { + var b = new u16(31); + for (var i = 0; i < 31; ++i) { + b[i] = start += 1 << eb[i - 1]; + } + // numbers here are at max 18 bits + var r = new i32(b[30]); + for (var i = 1; i < 30; ++i) { + for (var j = b[i]; j < b[i + 1]; ++j) { + r[j] = ((j - b[i]) << 5) | i; + } + } + return { b: b, r: r }; +}; +var _a = freb(fleb, 2), fl = _a.b, revfl = _a.r; +// we can ignore the fact that the other numbers are wrong; they never happen anyway +fl[28] = 258, revfl[258] = 28; +var _b = freb(fdeb, 0), fd = _b.b, revfd = _b.r; +// map of value to reverse (assuming 16 bits) +var rev = new u16(32768); +for (var i = 0; i < 32768; ++i) { + // reverse table algorithm from SO + var x = ((i & 0xAAAA) >> 1) | ((i & 0x5555) << 1); + x = ((x & 0xCCCC) >> 2) | ((x & 0x3333) << 2); + x = ((x & 0xF0F0) >> 4) | ((x & 0x0F0F) << 4); + rev[i] = (((x & 0xFF00) >> 8) | ((x & 0x00FF) << 8)) >> 1; +} +// create huffman tree from u8 "map": index -> code length for code index +// mb (max bits) must be at most 15 +// TODO: optimize/split up? +var hMap = (function (cd, mb, r) { + var s = cd.length; + // index + var i = 0; + // u16 "map": index -> # of codes with bit length = index + var l = new u16(mb); + // length of cd must be 288 (total # of codes) + for (; i < s; ++i) { + if (cd[i]) + ++l[cd[i] - 1]; + } + // u16 "map": index -> minimum code for bit length = index + var le = new u16(mb); + for (i = 1; i < mb; ++i) { + le[i] = (le[i - 1] + l[i - 1]) << 1; + } + var co; + if (r) { + // u16 "map": index -> number of actual bits, symbol for code + co = new u16(1 << mb); + // bits to remove for reverser + var rvb = 15 - mb; + for (i = 0; i < s; ++i) { + // ignore 0 lengths + if (cd[i]) { + // num encoding both symbol and bits read + var sv = (i << 4) | cd[i]; + // free bits + var r_1 = mb - cd[i]; + // start value + var v = le[cd[i] - 1]++ << r_1; + // m is end value + for (var m = v | ((1 << r_1) - 1); v <= m; ++v) { + // every 16 bit value starting with the code yields the same result + co[rev[v] >> rvb] = sv; + } + } + } + } + else { + co = new u16(s); + for (i = 0; i < s; ++i) { + if (cd[i]) { + co[i] = rev[le[cd[i] - 1]++] >> (15 - cd[i]); + } + } + } + return co; +}); +// fixed length tree +var flt = new u8(288); +for (var i = 0; i < 144; ++i) + flt[i] = 8; +for (var i = 144; i < 256; ++i) + flt[i] = 9; +for (var i = 256; i < 280; ++i) + flt[i] = 7; +for (var i = 280; i < 288; ++i) + flt[i] = 8; +// fixed distance tree +var fdt = new u8(32); +for (var i = 0; i < 32; ++i) + fdt[i] = 5; +// fixed length map +var flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1); +// fixed distance map +var fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1); +// find max of array +var max = function (a) { + var m = a[0]; + for (var i = 1; i < a.length; ++i) { + if (a[i] > m) + m = a[i]; + } + return m; +}; +// read d, starting at bit p and mask with m +var bits = function (d, p, m) { + var o = (p / 8) | 0; + return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m; +}; +// read d, starting at bit p continuing for at least 16 bits +var bits16 = function (d, p) { + var o = (p / 8) | 0; + return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7)); +}; +// get end of byte +var shft = function (p) { return ((p + 7) / 8) | 0; }; +// typed array slice - allows garbage collector to free original reference, +// while being more compatible than .slice +var slc = function (v, s, e) { + if (s == null || s < 0) + s = 0; + if (e == null || e > v.length) + e = v.length; + // can't use .constructor in case user-supplied + return new u8(v.subarray(s, e)); +}; +/** + * Codes for errors generated within this library + */ +export var FlateErrorCode = { + UnexpectedEOF: 0, + InvalidBlockType: 1, + InvalidLengthLiteral: 2, + InvalidDistance: 3, + StreamFinished: 4, + NoStreamHandler: 5, + InvalidHeader: 6, + NoCallback: 7, + InvalidUTF8: 8, + ExtraFieldTooLong: 9, + InvalidDate: 10, + FilenameTooLong: 11, + StreamFinishing: 12, + InvalidZipData: 13, + UnknownCompressionMethod: 14 +}; +// error codes +var ec = [ + 'unexpected EOF', + 'invalid block type', + 'invalid length/literal', + 'invalid distance', + 'stream finished', + 'no stream handler', + , // determined by compression function + 'no callback', + 'invalid UTF-8 data', + 'extra field too long', + 'date not in range 1980-2099', + 'filename too long', + 'stream finishing', + 'invalid zip data' + // determined by unknown compression method +]; +; +var err = function (ind, msg, nt) { + var e = new Error(msg || ec[ind]); + e.code = ind; + if (Error.captureStackTrace) + Error.captureStackTrace(e, err); + if (!nt) + throw e; + return e; +}; +// expands raw DEFLATE data +var inflt = function (dat, st, buf, dict) { + // source length dict length + var sl = dat.length, dl = dict ? dict.length : 0; + if (!sl || st.f && !st.l) + return buf || new u8(0); + var noBuf = !buf; + // have to estimate size + var resize = noBuf || st.i != 2; + // no state + var noSt = st.i; + // Assumes roughly 33% compression ratio average + if (noBuf) + buf = new u8(sl * 3); + // ensure buffer can fit at least l elements + var cbuf = function (l) { + var bl = buf.length; + // need to increase size to fit + if (l > bl) { + // Double or set to necessary, whichever is greater + var nbuf = new u8(Math.max(bl * 2, l)); + nbuf.set(buf); + buf = nbuf; + } + }; + // last chunk bitpos bytes + var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n; + // total bits + var tbts = sl * 8; + do { + if (!lm) { + // BFINAL - this is only 1 when last chunk is next + final = bits(dat, pos, 1); + // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman + var type = bits(dat, pos + 1, 3); + pos += 3; + if (!type) { + // go to end of byte boundary + var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l; + if (t > sl) { + if (noSt) + err(0); + break; + } + // ensure size + if (resize) + cbuf(bt + l); + // Copy over uncompressed data + buf.set(dat.subarray(s, t), bt); + // Get new bitpos, update byte count + st.b = bt += l, st.p = pos = t * 8, st.f = final; + continue; + } + else if (type == 1) + lm = flrm, dm = fdrm, lbt = 9, dbt = 5; + else if (type == 2) { + // literal lengths + var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4; + var tl = hLit + bits(dat, pos + 5, 31) + 1; + pos += 14; + // length+distance tree + var ldt = new u8(tl); + // code length tree + var clt = new u8(19); + for (var i = 0; i < hcLen; ++i) { + // use index map to get real code + clt[clim[i]] = bits(dat, pos + i * 3, 7); + } + pos += hcLen * 3; + // code lengths bits + var clb = max(clt), clbmsk = (1 << clb) - 1; + // code lengths map + var clm = hMap(clt, clb, 1); + for (var i = 0; i < tl;) { + var r = clm[bits(dat, pos, clbmsk)]; + // bits read + pos += r & 15; + // symbol + var s = r >> 4; + // code length to copy + if (s < 16) { + ldt[i++] = s; + } + else { + // copy count + var c = 0, n = 0; + if (s == 16) + n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1]; + else if (s == 17) + n = 3 + bits(dat, pos, 7), pos += 3; + else if (s == 18) + n = 11 + bits(dat, pos, 127), pos += 7; + while (n--) + ldt[i++] = c; + } + } + // length tree distance tree + var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit); + // max length bits + lbt = max(lt); + // max dist bits + dbt = max(dt); + lm = hMap(lt, lbt, 1); + dm = hMap(dt, dbt, 1); + } + else + err(1); + if (pos > tbts) { + if (noSt) + err(0); + break; + } + } + // Make sure the buffer can hold this + the largest possible addition + // Maximum chunk size (practically, theoretically infinite) is 2^17 + if (resize) + cbuf(bt + 131072); + var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1; + var lpos = pos; + for (;; lpos = pos) { + // bits read, code + var c = lm[bits16(dat, pos) & lms], sym = c >> 4; + pos += c & 15; + if (pos > tbts) { + if (noSt) + err(0); + break; + } + if (!c) + err(2); + if (sym < 256) + buf[bt++] = sym; + else if (sym == 256) { + lpos = pos, lm = null; + break; + } + else { + var add = sym - 254; + // no extra bits needed if less + if (sym > 264) { + // index + var i = sym - 257, b = fleb[i]; + add = bits(dat, pos, (1 << b) - 1) + fl[i]; + pos += b; + } + // dist + var d = dm[bits16(dat, pos) & dms], dsym = d >> 4; + if (!d) + err(3); + pos += d & 15; + var dt = fd[dsym]; + if (dsym > 3) { + var b = fdeb[dsym]; + dt += bits16(dat, pos) & (1 << b) - 1, pos += b; + } + if (pos > tbts) { + if (noSt) + err(0); + break; + } + if (resize) + cbuf(bt + 131072); + var end = bt + add; + if (bt < dt) { + var shift = dl - dt, dend = Math.min(dt, end); + if (shift + bt < 0) + err(3); + for (; bt < dend; ++bt) + buf[bt] = dict[shift + bt]; + } + for (; bt < end; ++bt) + buf[bt] = buf[bt - dt]; + } + } + st.l = lm, st.p = lpos, st.b = bt, st.f = final; + if (lm) + final = 1, st.m = lbt, st.d = dm, st.n = dbt; + } while (!final); + // don't reallocate for streams or user buffers + return bt != buf.length && noBuf ? slc(buf, 0, bt) : buf.subarray(0, bt); +}; +// starting at p, write the minimum number of bits that can hold v to d +var wbits = function (d, p, v) { + v <<= p & 7; + var o = (p / 8) | 0; + d[o] |= v; + d[o + 1] |= v >> 8; +}; +// starting at p, write the minimum number of bits (>8) that can hold v to d +var wbits16 = function (d, p, v) { + v <<= p & 7; + var o = (p / 8) | 0; + d[o] |= v; + d[o + 1] |= v >> 8; + d[o + 2] |= v >> 16; +}; +// creates code lengths from a frequency table +var hTree = function (d, mb) { + // Need extra info to make a tree + var t = []; + for (var i = 0; i < d.length; ++i) { + if (d[i]) + t.push({ s: i, f: d[i] }); + } + var s = t.length; + var t2 = t.slice(); + if (!s) + return { t: et, l: 0 }; + if (s == 1) { + var v = new u8(t[0].s + 1); + v[t[0].s] = 1; + return { t: v, l: 1 }; + } + t.sort(function (a, b) { return a.f - b.f; }); + // after i2 reaches last ind, will be stopped + // freq must be greater than largest possible number of symbols + t.push({ s: -1, f: 25001 }); + var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2; + t[0] = { s: -1, f: l.f + r.f, l: l, r: r }; + // efficient algorithm from UZIP.js + // i0 is lookbehind, i2 is lookahead - after processing two low-freq + // symbols that combined have high freq, will start processing i2 (high-freq, + // non-composite) symbols instead + // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/ + while (i1 != s - 1) { + l = t[t[i0].f < t[i2].f ? i0++ : i2++]; + r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++]; + t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r }; + } + var maxSym = t2[0].s; + for (var i = 1; i < s; ++i) { + if (t2[i].s > maxSym) + maxSym = t2[i].s; + } + // code lengths + var tr = new u16(maxSym + 1); + // max bits in tree + var mbt = ln(t[i1 - 1], tr, 0); + if (mbt > mb) { + // more algorithms from UZIP.js + // TODO: find out how this code works (debt) + // ind debt + var i = 0, dt = 0; + // left cost + var lft = mbt - mb, cst = 1 << lft; + t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; }); + for (; i < s; ++i) { + var i2_1 = t2[i].s; + if (tr[i2_1] > mb) { + dt += cst - (1 << (mbt - tr[i2_1])); + tr[i2_1] = mb; + } + else + break; + } + dt >>= lft; + while (dt > 0) { + var i2_2 = t2[i].s; + if (tr[i2_2] < mb) + dt -= 1 << (mb - tr[i2_2]++ - 1); + else + ++i; + } + for (; i >= 0 && dt; --i) { + var i2_3 = t2[i].s; + if (tr[i2_3] == mb) { + --tr[i2_3]; + ++dt; + } + } + mbt = mb; + } + return { t: new u8(tr), l: mbt }; +}; +// get the max length and assign length codes +var ln = function (n, l, d) { + return n.s == -1 + ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1)) + : (l[n.s] = d); +}; +// length codes generation +var lc = function (c) { + var s = c.length; + // Note that the semicolon was intentional + while (s && !c[--s]) + ; + var cl = new u16(++s); + // ind num streak + var cli = 0, cln = c[0], cls = 1; + var w = function (v) { cl[cli++] = v; }; + for (var i = 1; i <= s; ++i) { + if (c[i] == cln && i != s) + ++cls; + else { + if (!cln && cls > 2) { + for (; cls > 138; cls -= 138) + w(32754); + if (cls > 2) { + w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305); + cls = 0; + } + } + else if (cls > 3) { + w(cln), --cls; + for (; cls > 6; cls -= 6) + w(8304); + if (cls > 2) + w(((cls - 3) << 5) | 8208), cls = 0; + } + while (cls--) + w(cln); + cls = 1; + cln = c[i]; + } + } + return { c: cl.subarray(0, cli), n: s }; +}; +// calculate the length of output from tree, code lengths +var clen = function (cf, cl) { + var l = 0; + for (var i = 0; i < cl.length; ++i) + l += cf[i] * cl[i]; + return l; +}; +// writes a fixed block +// returns the new bit pos +var wfblk = function (out, pos, dat) { + // no need to write 00 as type: TypedArray defaults to 0 + var s = dat.length; + var o = shft(pos + 2); + out[o] = s & 255; + out[o + 1] = s >> 8; + out[o + 2] = out[o] ^ 255; + out[o + 3] = out[o + 1] ^ 255; + for (var i = 0; i < s; ++i) + out[o + i + 4] = dat[i]; + return (o + 4 + s) * 8; +}; +// writes a block +var wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) { + wbits(out, p++, final); + ++lf[256]; + var _a = hTree(lf, 15), dlt = _a.t, mlb = _a.l; + var _b = hTree(df, 15), ddt = _b.t, mdb = _b.l; + var _c = lc(dlt), lclt = _c.c, nlc = _c.n; + var _d = lc(ddt), lcdt = _d.c, ndc = _d.n; + var lcfreq = new u16(19); + for (var i = 0; i < lclt.length; ++i) + ++lcfreq[lclt[i] & 31]; + for (var i = 0; i < lcdt.length; ++i) + ++lcfreq[lcdt[i] & 31]; + var _e = hTree(lcfreq, 7), lct = _e.t, mlcb = _e.l; + var nlcc = 19; + for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc) + ; + var flen = (bl + 5) << 3; + var ftlen = clen(lf, flt) + clen(df, fdt) + eb; + var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + 2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]; + if (bs >= 0 && flen <= ftlen && flen <= dtlen) + return wfblk(out, p, dat.subarray(bs, bs + bl)); + var lm, ll, dm, dl; + wbits(out, p, 1 + (dtlen < ftlen)), p += 2; + if (dtlen < ftlen) { + lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt; + var llm = hMap(lct, mlcb, 0); + wbits(out, p, nlc - 257); + wbits(out, p + 5, ndc - 1); + wbits(out, p + 10, nlcc - 4); + p += 14; + for (var i = 0; i < nlcc; ++i) + wbits(out, p + 3 * i, lct[clim[i]]); + p += 3 * nlcc; + var lcts = [lclt, lcdt]; + for (var it = 0; it < 2; ++it) { + var clct = lcts[it]; + for (var i = 0; i < clct.length; ++i) { + var len = clct[i] & 31; + wbits(out, p, llm[len]), p += lct[len]; + if (len > 15) + wbits(out, p, (clct[i] >> 5) & 127), p += clct[i] >> 12; + } + } + } + else { + lm = flm, ll = flt, dm = fdm, dl = fdt; + } + for (var i = 0; i < li; ++i) { + var sym = syms[i]; + if (sym > 255) { + var len = (sym >> 18) & 31; + wbits16(out, p, lm[len + 257]), p += ll[len + 257]; + if (len > 7) + wbits(out, p, (sym >> 23) & 31), p += fleb[len]; + var dst = sym & 31; + wbits16(out, p, dm[dst]), p += dl[dst]; + if (dst > 3) + wbits16(out, p, (sym >> 5) & 8191), p += fdeb[dst]; + } + else { + wbits16(out, p, lm[sym]), p += ll[sym]; + } + } + wbits16(out, p, lm[256]); + return p + ll[256]; +}; +// deflate options (nice << 13) | chain +var deo = /*#__PURE__*/ new i32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]); +// empty +var et = /*#__PURE__*/ new u8(0); +// compresses data into a raw DEFLATE buffer +var dflt = function (dat, lvl, plvl, pre, post, st) { + var s = st.z || dat.length; + var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post); + // writing to this writes to the output buffer + var w = o.subarray(pre, o.length - post); + var lst = st.l; + var pos = (st.r || 0) & 7; + if (lvl) { + if (pos) + w[0] = st.r >> 3; + var opt = deo[lvl - 1]; + var n = opt >> 13, c = opt & 8191; + var msk_1 = (1 << plvl) - 1; + // prev 2-byte val map curr 2-byte val map + var prev = st.p || new u16(32768), head = st.h || new u16(msk_1 + 1); + var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1; + var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; }; + // 24576 is an arbitrary number of maximum symbols per block + // 424 buffer for last block + var syms = new i32(25000); + // length/literal freq distance freq + var lf = new u16(288), df = new u16(32); + // l/lcnt exbits index l/lind waitdx blkpos + var lc_1 = 0, eb = 0, i = st.i || 0, li = 0, wi = st.w || 0, bs = 0; + for (; i + 2 < s; ++i) { + // hash value + var hv = hsh(i); + // index mod 32768 previous index mod + var imod = i & 32767, pimod = head[hv]; + prev[imod] = pimod; + head[hv] = imod; + // We always should modify head and prev, but only add symbols if + // this data is not yet processed ("wait" for wait index) + if (wi <= i) { + // bytes remaining + var rem = s - i; + if ((lc_1 > 7000 || li > 24576) && (rem > 423 || !lst)) { + pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos); + li = lc_1 = eb = 0, bs = i; + for (var j = 0; j < 286; ++j) + lf[j] = 0; + for (var j = 0; j < 30; ++j) + df[j] = 0; + } + // len dist chain + var l = 2, d = 0, ch_1 = c, dif = imod - pimod & 32767; + if (rem > 2 && hv == hsh(i - dif)) { + var maxn = Math.min(n, rem) - 1; + var maxd = Math.min(32767, i); + // max possible length + // not capped at dif because decompressors implement "rolling" index population + var ml = Math.min(258, rem); + while (dif <= maxd && --ch_1 && imod != pimod) { + if (dat[i + l] == dat[i + l - dif]) { + var nl = 0; + for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl) + ; + if (nl > l) { + l = nl, d = dif; + // break out early when we reach "nice" (we are satisfied enough) + if (nl > maxn) + break; + // now, find the rarest 2-byte sequence within this + // length of literals and search for that instead. + // Much faster than just using the start + var mmd = Math.min(dif, nl - 2); + var md = 0; + for (var j = 0; j < mmd; ++j) { + var ti = i - dif + j & 32767; + var pti = prev[ti]; + var cd = ti - pti & 32767; + if (cd > md) + md = cd, pimod = ti; + } + } + } + // check the previous match + imod = pimod, pimod = prev[imod]; + dif += imod - pimod & 32767; + } + } + // d will be nonzero only when a match was found + if (d) { + // store both dist and len data in one int32 + // Make sure this is recognized as a len/dist with 28th bit (2^28) + syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d]; + var lin = revfl[l] & 31, din = revfd[d] & 31; + eb += fleb[lin] + fdeb[din]; + ++lf[257 + lin]; + ++df[din]; + wi = i + l; + ++lc_1; + } + else { + syms[li++] = dat[i]; + ++lf[dat[i]]; + } + } + } + for (i = Math.max(i, wi); i < s; ++i) { + syms[li++] = dat[i]; + ++lf[dat[i]]; + } + pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos); + if (!lst) { + st.r = (pos & 7) | w[(pos / 8) | 0] << 3; + // shft(pos) now 1 less if pos & 7 != 0 + pos -= 7; + st.h = head, st.p = prev, st.i = i, st.w = wi; + } + } + else { + for (var i = st.w || 0; i < s + lst; i += 65535) { + // end + var e = i + 65535; + if (e >= s) { + // write final block + w[(pos / 8) | 0] = lst; + e = s; + } + pos = wfblk(w, pos + 1, dat.subarray(i, e)); + } + st.i = s; + } + return slc(o, 0, pre + shft(pos) + post); +}; +// CRC32 table +var crct = /*#__PURE__*/ (function () { + var t = new Int32Array(256); + for (var i = 0; i < 256; ++i) { + var c = i, k = 9; + while (--k) + c = ((c & 1) && -306674912) ^ (c >>> 1); + t[i] = c; + } + return t; +})(); +// CRC32 +var crc = function () { + var c = -1; + return { + p: function (d) { + // closures have awful performance + var cr = c; + for (var i = 0; i < d.length; ++i) + cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8); + c = cr; + }, + d: function () { return ~c; } + }; +}; +// Adler32 +var adler = function () { + var a = 1, b = 0; + return { + p: function (d) { + // closures have awful performance + var n = a, m = b; + var l = d.length | 0; + for (var i = 0; i != l;) { + var e = Math.min(i + 2655, l); + for (; i < e; ++i) + m += n += d[i]; + n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16); + } + a = n, b = m; + }, + d: function () { + a %= 65521, b %= 65521; + return (a & 255) << 24 | (a & 0xFF00) << 8 | (b & 255) << 8 | (b >> 8); + } + }; +}; +; +// deflate with opts +var dopt = function (dat, opt, pre, post, st) { + if (!st) { + st = { l: 1 }; + if (opt.dictionary) { + var dict = opt.dictionary.subarray(-32768); + var newDat = new u8(dict.length + dat.length); + newDat.set(dict); + newDat.set(dat, dict.length); + dat = newDat; + st.w = dict.length; + } + } + return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? (st.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : 20) : (12 + opt.mem), pre, post, st); +}; +// Walmart object spread +var mrg = function (a, b) { + var o = {}; + for (var k in a) + o[k] = a[k]; + for (var k in b) + o[k] = b[k]; + return o; +}; +// worker clone +// This is possibly the craziest part of the entire codebase, despite how simple it may seem. +// The only parameter to this function is a closure that returns an array of variables outside of the function scope. +// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization. +// We will return an object mapping of true variable name to value (basically, the current scope as a JS object). +// The reason we can't just use the original variable names is minifiers mangling the toplevel scope. +// This took me three weeks to figure out how to do. +var wcln = function (fn, fnStr, td) { + var dt = fn(); + var st = fn.toString(); + var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/\s+/g, '').split(','); + for (var i = 0; i < dt.length; ++i) { + var v = dt[i], k = ks[i]; + if (typeof v == 'function') { + fnStr += ';' + k + '='; + var st_1 = v.toString(); + if (v.prototype) { + // for global objects + if (st_1.indexOf('[native code]') != -1) { + var spInd = st_1.indexOf(' ', 8) + 1; + fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd)); + } + else { + fnStr += st_1; + for (var t in v.prototype) + fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString(); + } + } + else + fnStr += st_1; + } + else + td[k] = v; + } + return fnStr; +}; +var ch = []; +// clone bufs +var cbfs = function (v) { + var tl = []; + for (var k in v) { + if (v[k].buffer) { + tl.push((v[k] = new v[k].constructor(v[k])).buffer); + } + } + return tl; +}; +// use a worker to execute code +var wrkr = function (fns, init, id, cb) { + if (!ch[id]) { + var fnStr = '', td_1 = {}, m = fns.length - 1; + for (var i = 0; i < m; ++i) + fnStr = wcln(fns[i], fnStr, td_1); + ch[id] = { c: wcln(fns[m], fnStr, td_1), e: td_1 }; + } + var td = mrg({}, ch[id].e); + return wk(ch[id].c + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb); +}; +// base async inflate fn +var bInflt = function () { return [u8, u16, i32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gopt]; }; +var bDflt = function () { return [u8, u16, i32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; }; +// gzip extra +var gze = function () { return [gzh, gzhl, wbytes, crc, crct]; }; +// gunzip extra +var guze = function () { return [gzs, gzl]; }; +// zlib extra +var zle = function () { return [zlh, wbytes, adler]; }; +// unzlib extra +var zule = function () { return [zls]; }; +// post buf +var pbf = function (msg) { return postMessage(msg, [msg.buffer]); }; +// get opts +var gopt = function (o) { return o && { + out: o.size && new u8(o.size), + dictionary: o.dictionary +}; }; +// async helper +var cbify = function (dat, opts, fns, init, id, cb) { + var w = wrkr(fns, init, id, function (err, dat) { + w.terminate(); + cb(err, dat); + }); + w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []); + return function () { w.terminate(); }; +}; +// auto stream +var astrm = function (strm) { + strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); }; + return function (ev) { + if (ev.data[0]) { + strm.push(ev.data[0], ev.data[1]); + postMessage([ev.data[0].length]); + } + else + strm.flush(ev.data[1]); + }; +}; +// async stream attach +var astrmify = function (fns, strm, opts, init, id, flush, ext) { + var t; + var w = wrkr(fns, init, id, function (err, dat) { + if (err) + w.terminate(), strm.ondata.call(strm, err); + else if (!Array.isArray(dat)) + ext(dat); + else if (dat.length == 1) { + strm.queuedSize -= dat[0]; + if (strm.ondrain) + strm.ondrain(dat[0]); + } + else { + if (dat[1]) + w.terminate(); + strm.ondata.call(strm, err, dat[0], dat[1]); + } + }); + w.postMessage(opts); + strm.queuedSize = 0; + strm.push = function (d, f) { + if (!strm.ondata) + err(5); + if (t) + strm.ondata(err(4, 0, 1), null, !!f); + strm.queuedSize += d.length; + // can fail for cross-realm Uint8Array, but ok - only a small performance penalty + w.postMessage([d, t = f], d.buffer instanceof ArrayBuffer ? [d.buffer] : []); + }; + strm.terminate = function () { w.terminate(); }; + if (flush) { + strm.flush = function (sync) { w.postMessage([0, sync]); }; + } +}; +// read 2 bytes +var b2 = function (d, b) { return d[b] | (d[b + 1] << 8); }; +// read 4 bytes +var b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; }; +// read 8 bytes +var b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); }; +// write bytes +var wbytes = function (d, b, v) { + for (; v; ++b) + d[b] = v, v >>>= 8; +}; +// gzip header +var gzh = function (c, o) { + var fn = o.filename; + c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix + if (o.mtime != 0) + wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000)); + if (fn) { + c[3] = 8; + for (var i = 0; i <= fn.length; ++i) + c[i + 10] = fn.charCodeAt(i); + } +}; +// gzip footer: -8 to -4 = CRC, -4 to -0 is length +// gzip start +var gzs = function (d) { + if (d[0] != 31 || d[1] != 139 || d[2] != 8) + err(6, 'invalid gzip data'); + var flg = d[3]; + var st = 10; + if (flg & 4) + st += (d[10] | d[11] << 8) + 2; + for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++]) + ; + return st + (flg & 2); +}; +// gzip length +var gzl = function (d) { + var l = d.length; + return (d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16 | d[l - 1] << 24) >>> 0; +}; +// gzip header length +var gzhl = function (o) { return 10 + (o.filename ? o.filename.length + 1 : 0); }; +// zlib header +var zlh = function (c, o) { + var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2; + c[0] = 120, c[1] = (fl << 6) | (o.dictionary && 32); + c[1] |= 31 - ((c[0] << 8) | c[1]) % 31; + if (o.dictionary) { + var h = adler(); + h.p(o.dictionary); + wbytes(c, 2, h.d()); + } +}; +// zlib start +var zls = function (d, dict) { + if ((d[0] & 15) != 8 || (d[0] >> 4) > 7 || ((d[0] << 8 | d[1]) % 31)) + err(6, 'invalid zlib data'); + if ((d[1] >> 5 & 1) == +!dict) + err(6, 'invalid zlib data: ' + (d[1] & 32 ? 'need' : 'unexpected') + ' dictionary'); + return (d[1] >> 3 & 4) + 2; +}; +function StrmOpt(opts, cb) { + if (typeof opts == 'function') + cb = opts, opts = {}; + this.ondata = cb; + return opts; +} +/** + * Streaming DEFLATE compression + */ +var Deflate = /*#__PURE__*/ (function () { + function Deflate(opts, cb) { + if (typeof opts == 'function') + cb = opts, opts = {}; + this.ondata = cb; + this.o = opts || {}; + this.s = { l: 0, i: 32768, w: 32768, z: 32768 }; + // Buffer length must always be 0 mod 32768 for index calculations to be correct when modifying head and prev + // 98304 = 32768 (lookback) + 65536 (common chunk size) + this.b = new u8(98304); + if (this.o.dictionary) { + var dict = this.o.dictionary.subarray(-32768); + this.b.set(dict, 32768 - dict.length); + this.s.i = 32768 - dict.length; + } + } + Deflate.prototype.p = function (c, f) { + this.ondata(dopt(c, this.o, 0, 0, this.s), f); + }; + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Deflate.prototype.push = function (chunk, final) { + if (!this.ondata) + err(5); + if (this.s.l) + err(4); + var endLen = chunk.length + this.s.z; + if (endLen > this.b.length) { + if (endLen > 2 * this.b.length - 32768) { + var newBuf = new u8(endLen & -32768); + newBuf.set(this.b.subarray(0, this.s.z)); + this.b = newBuf; + } + var split = this.b.length - this.s.z; + this.b.set(chunk.subarray(0, split), this.s.z); + this.s.z = this.b.length; + this.p(this.b, false); + this.b.set(this.b.subarray(-32768)); + this.b.set(chunk.subarray(split), 32768); + this.s.z = chunk.length - split + 32768; + this.s.i = 32766, this.s.w = 32768; + } + else { + this.b.set(chunk, this.s.z); + this.s.z += chunk.length; + } + this.s.l = final & 1; + if (this.s.z > this.s.w + 8191 || final) { + this.p(this.b, final || false); + this.s.w = this.s.i, this.s.i -= 2; + } + if (final) { + // cleanup unneeded buffers/state to reduce memory usage + this.s = this.o = {}; + this.b = et; + } + }; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * deflated output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. A separate DEFLATE stream may be concatenated + * with the current output after a sync flush. + */ + Deflate.prototype.flush = function (sync) { + if (!this.ondata) + err(5); + if (this.s.l) + err(4); + this.p(this.b, false); + this.s.w = this.s.i, this.s.i -= 2; + // could technically skip writing the type-0 block for (this.s.r & 7) == 0, + // but the deterministic trailer (00 00 FF FF) is useful in some situations + if (sync) { + var c = new u8(6); + c[0] = this.s.r >> 3; + // write empty, non-final type-0 block + var ep = wfblk(c, this.s.r, et); + this.s.r = 0; + this.ondata(c.subarray(0, ep >> 3), false); + } + }; + return Deflate; +}()); +export { Deflate }; +/** + * Asynchronous streaming DEFLATE compression + */ +var AsyncDeflate = /*#__PURE__*/ (function () { + function AsyncDeflate(opts, cb) { + astrmify([ + bDflt, + function () { return [astrm, Deflate]; } + ], this, StrmOpt.call(this, opts, cb), function (ev) { + var strm = new Deflate(ev.data); + onmessage = astrm(strm); + }, 6, 1); + } + return AsyncDeflate; +}()); +export { AsyncDeflate }; +export function deflate(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return cbify(data, opts, [ + bDflt, + ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb); +} +/** + * Compresses data with DEFLATE without any wrapper + * @param data The data to compress + * @param opts The compression options + * @returns The deflated version of the data + */ +export function deflateSync(data, opts) { + return dopt(data, opts || {}, 0, 0); +} +/** + * Streaming DEFLATE decompression + */ +var Inflate = /*#__PURE__*/ (function () { + function Inflate(opts, cb) { + // no StrmOpt here to avoid adding to workerizer + if (typeof opts == 'function') + cb = opts, opts = {}; + this.ondata = cb; + var dict = opts && opts.dictionary && opts.dictionary.subarray(-32768); + this.s = { i: 0, b: dict ? dict.length : 0 }; + this.o = new u8(32768); + this.p = new u8(0); + if (dict) + this.o.set(dict); + } + Inflate.prototype.e = function (c) { + if (!this.ondata) + err(5); + if (this.d) + err(4); + if (!this.p.length) + this.p = c; + else if (c.length) { + var n = new u8(this.p.length + c.length); + n.set(this.p), n.set(c, this.p.length), this.p = n; + } + }; + Inflate.prototype.c = function (final) { + this.s.i = +(this.d = final || false); + var bts = this.s.b; + var dt = inflt(this.p, this.s, this.o); + this.ondata(slc(dt, bts, this.s.b), this.d); + this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length; + this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7; + }; + /** + * Pushes a chunk to be inflated + * @param chunk The chunk to push + * @param final Whether this is the final chunk + */ + Inflate.prototype.push = function (chunk, final) { + this.e(chunk), this.c(final); + }; + return Inflate; +}()); +export { Inflate }; +/** + * Asynchronous streaming DEFLATE decompression + */ +var AsyncInflate = /*#__PURE__*/ (function () { + function AsyncInflate(opts, cb) { + astrmify([ + bInflt, + function () { return [astrm, Inflate]; } + ], this, StrmOpt.call(this, opts, cb), function (ev) { + var strm = new Inflate(ev.data); + onmessage = astrm(strm); + }, 7, 0); + } + return AsyncInflate; +}()); +export { AsyncInflate }; +export function inflate(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return cbify(data, opts, [ + bInflt + ], function (ev) { return pbf(inflateSync(ev.data[0], gopt(ev.data[1]))); }, 1, cb); +} +export function inflateSync(data, opts) { + return inflt(data, { i: 2 }, opts && opts.out, opts && opts.dictionary); +} +// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize. +/** + * Streaming GZIP compression + */ +var Gzip = /*#__PURE__*/ (function () { + function Gzip(opts, cb) { + this.c = crc(); + this.l = 0; + this.v = 1; + Deflate.call(this, opts, cb); + } + /** + * Pushes a chunk to be GZIPped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Gzip.prototype.push = function (chunk, final) { + this.c.p(chunk); + this.l += chunk.length; + Deflate.prototype.push.call(this, chunk, final); + }; + Gzip.prototype.p = function (c, f) { + var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, this.s); + if (this.v) + gzh(raw, this.o), this.v = 0; + if (f) + wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l); + this.ondata(raw, f); + }; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * GZIPped output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. + */ + Gzip.prototype.flush = function (sync) { + Deflate.prototype.flush.call(this, sync); + }; + return Gzip; +}()); +export { Gzip }; +/** + * Asynchronous streaming GZIP compression + */ +var AsyncGzip = /*#__PURE__*/ (function () { + function AsyncGzip(opts, cb) { + astrmify([ + bDflt, + gze, + function () { return [astrm, Deflate, Gzip]; } + ], this, StrmOpt.call(this, opts, cb), function (ev) { + var strm = new Gzip(ev.data); + onmessage = astrm(strm); + }, 8, 1); + } + return AsyncGzip; +}()); +export { AsyncGzip }; +export function gzip(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return cbify(data, opts, [ + bDflt, + gze, + function () { return [gzipSync]; } + ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb); +} +/** + * Compresses data with GZIP + * @param data The data to compress + * @param opts The compression options + * @returns The gzipped version of the data + */ +export function gzipSync(data, opts) { + if (!opts) + opts = {}; + var c = crc(), l = data.length; + c.p(data); + var d = dopt(data, opts, gzhl(opts), 8), s = d.length; + return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d; +} +/** + * Streaming single or multi-member GZIP decompression + */ +var Gunzip = /*#__PURE__*/ (function () { + function Gunzip(opts, cb) { + this.v = 1; + this.r = 0; + Inflate.call(this, opts, cb); + } + /** + * Pushes a chunk to be GUNZIPped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Gunzip.prototype.push = function (chunk, final) { + Inflate.prototype.e.call(this, chunk); + this.r += chunk.length; + if (this.v) { + var p = this.p.subarray(this.v - 1); + var s = p.length > 3 ? gzs(p) : 4; + if (s > p.length) { + if (!final) + return; + } + else if (this.v > 1 && this.onmember) { + this.onmember(this.r - p.length); + } + this.p = p.subarray(s), this.v = 0; + } + // necessary to prevent TS from using the closure value + // This allows for workerization to function correctly + Inflate.prototype.c.call(this, 0); + // process concatenated GZIP + if (this.s.f && !this.s.l) { + this.v = shft(this.s.p) + 9; + this.s = { i: 0 }; + this.o = new u8(0); + this.push(new u8(0), final); + } + else if (final) { + Inflate.prototype.c.call(this, final); + } + }; + return Gunzip; +}()); +export { Gunzip }; +/** + * Asynchronous streaming single or multi-member GZIP decompression + */ +var AsyncGunzip = /*#__PURE__*/ (function () { + function AsyncGunzip(opts, cb) { + var _this = this; + astrmify([ + bInflt, + guze, + function () { return [astrm, Inflate, Gunzip]; } + ], this, StrmOpt.call(this, opts, cb), function (ev) { + var strm = new Gunzip(ev.data); + strm.onmember = function (offset) { return postMessage(offset); }; + onmessage = astrm(strm); + }, 9, 0, function (offset) { return _this.onmember && _this.onmember(offset); }); + } + return AsyncGunzip; +}()); +export { AsyncGunzip }; +export function gunzip(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return cbify(data, opts, [ + bInflt, + guze, + function () { return [gunzipSync]; } + ], function (ev) { return pbf(gunzipSync(ev.data[0], ev.data[1])); }, 3, cb); +} +export function gunzipSync(data, opts) { + var st = gzs(data); + if (st + 8 > data.length) + err(6, 'invalid gzip data'); + return inflt(data.subarray(st, -8), { i: 2 }, opts && opts.out || new u8(gzl(data)), opts && opts.dictionary); +} +/** + * Streaming Zlib compression + */ +var Zlib = /*#__PURE__*/ (function () { + function Zlib(opts, cb) { + this.c = adler(); + this.v = 1; + Deflate.call(this, opts, cb); + } + /** + * Pushes a chunk to be zlibbed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Zlib.prototype.push = function (chunk, final) { + this.c.p(chunk); + Deflate.prototype.push.call(this, chunk, final); + }; + Zlib.prototype.p = function (c, f) { + var raw = dopt(c, this.o, this.v && (this.o.dictionary ? 6 : 2), f && 4, this.s); + if (this.v) + zlh(raw, this.o), this.v = 0; + if (f) + wbytes(raw, raw.length - 4, this.c.d()); + this.ondata(raw, f); + }; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * zlibbed output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. + */ + Zlib.prototype.flush = function (sync) { + Deflate.prototype.flush.call(this, sync); + }; + return Zlib; +}()); +export { Zlib }; +/** + * Asynchronous streaming Zlib compression + */ +var AsyncZlib = /*#__PURE__*/ (function () { + function AsyncZlib(opts, cb) { + astrmify([ + bDflt, + zle, + function () { return [astrm, Deflate, Zlib]; } + ], this, StrmOpt.call(this, opts, cb), function (ev) { + var strm = new Zlib(ev.data); + onmessage = astrm(strm); + }, 10, 1); + } + return AsyncZlib; +}()); +export { AsyncZlib }; +export function zlib(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return cbify(data, opts, [ + bDflt, + zle, + function () { return [zlibSync]; } + ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb); +} +/** + * Compress data with Zlib + * @param data The data to compress + * @param opts The compression options + * @returns The zlib-compressed version of the data + */ +export function zlibSync(data, opts) { + if (!opts) + opts = {}; + var a = adler(); + a.p(data); + var d = dopt(data, opts, opts.dictionary ? 6 : 2, 4); + return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d; +} +/** + * Streaming Zlib decompression + */ +var Unzlib = /*#__PURE__*/ (function () { + function Unzlib(opts, cb) { + Inflate.call(this, opts, cb); + this.v = opts && opts.dictionary ? 2 : 1; + } + /** + * Pushes a chunk to be unzlibbed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Unzlib.prototype.push = function (chunk, final) { + Inflate.prototype.e.call(this, chunk); + if (this.v) { + if (this.p.length < 6 && !final) + return; + this.p = this.p.subarray(zls(this.p, this.v - 1)), this.v = 0; + } + if (final) { + if (this.p.length < 4) + err(6, 'invalid zlib data'); + this.p = this.p.subarray(0, -4); + } + // necessary to prevent TS from using the closure value + // This allows for workerization to function correctly + Inflate.prototype.c.call(this, final); + }; + return Unzlib; +}()); +export { Unzlib }; +/** + * Asynchronous streaming Zlib decompression + */ +var AsyncUnzlib = /*#__PURE__*/ (function () { + function AsyncUnzlib(opts, cb) { + astrmify([ + bInflt, + zule, + function () { return [astrm, Inflate, Unzlib]; } + ], this, StrmOpt.call(this, opts, cb), function (ev) { + var strm = new Unzlib(ev.data); + onmessage = astrm(strm); + }, 11, 0); + } + return AsyncUnzlib; +}()); +export { AsyncUnzlib }; +export function unzlib(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return cbify(data, opts, [ + bInflt, + zule, + function () { return [unzlibSync]; } + ], function (ev) { return pbf(unzlibSync(ev.data[0], gopt(ev.data[1]))); }, 5, cb); +} +export function unzlibSync(data, opts) { + return inflt(data.subarray(zls(data, opts && opts.dictionary), -4), { i: 2 }, opts && opts.out, opts && opts.dictionary); +} +// Default algorithm for compression (used because having a known output size allows faster decompression) +export { gzip as compress, AsyncGzip as AsyncCompress }; +export { gzipSync as compressSync, Gzip as Compress }; +/** + * Streaming GZIP, Zlib, or raw DEFLATE decompression + */ +var Decompress = /*#__PURE__*/ (function () { + function Decompress(opts, cb) { + this.o = StrmOpt.call(this, opts, cb) || {}; + this.G = Gunzip; + this.I = Inflate; + this.Z = Unzlib; + } + // init substream + // overriden by AsyncDecompress + Decompress.prototype.i = function () { + var _this = this; + this.s.ondata = function (dat, final) { + _this.ondata(dat, final); + }; + }; + /** + * Pushes a chunk to be decompressed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Decompress.prototype.push = function (chunk, final) { + if (!this.ondata) + err(5); + if (!this.s) { + if (this.p && this.p.length) { + var n = new u8(this.p.length + chunk.length); + n.set(this.p), n.set(chunk, this.p.length); + } + else + this.p = chunk; + if (this.p.length > 2) { + this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8) + ? new this.G(this.o) + : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31)) + ? new this.I(this.o) + : new this.Z(this.o); + this.i(); + this.s.push(this.p, final); + this.p = null; + } + } + else + this.s.push(chunk, final); + }; + return Decompress; +}()); +export { Decompress }; +/** + * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression + */ +var AsyncDecompress = /*#__PURE__*/ (function () { + function AsyncDecompress(opts, cb) { + Decompress.call(this, opts, cb); + this.queuedSize = 0; + this.G = AsyncGunzip; + this.I = AsyncInflate; + this.Z = AsyncUnzlib; + } + AsyncDecompress.prototype.i = function () { + var _this = this; + this.s.ondata = function (err, dat, final) { + _this.ondata(err, dat, final); + }; + this.s.ondrain = function (size) { + _this.queuedSize -= size; + if (_this.ondrain) + _this.ondrain(size); + }; + }; + /** + * Pushes a chunk to be decompressed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + AsyncDecompress.prototype.push = function (chunk, final) { + this.queuedSize += chunk.length; + Decompress.prototype.push.call(this, chunk, final); + }; + return AsyncDecompress; +}()); +export { AsyncDecompress }; +export function decompress(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return (data[0] == 31 && data[1] == 139 && data[2] == 8) + ? gunzip(data, opts, cb) + : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31)) + ? inflate(data, opts, cb) + : unzlib(data, opts, cb); +} +/** + * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format + * @param data The data to decompress + * @param opts The decompression options + * @returns The decompressed version of the data + */ +export function decompressSync(data, opts) { + return (data[0] == 31 && data[1] == 139 && data[2] == 8) + ? gunzipSync(data, opts) + : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31)) + ? inflateSync(data, opts) + : unzlibSync(data, opts); +} +// flatten a directory structure +var fltn = function (d, p, t, o) { + for (var k in d) { + var val = d[k], n = p + k, op = o; + if (Array.isArray(val)) + op = mrg(o, val[1]), val = val[0]; + if (ArrayBuffer.isView(val)) + t[n] = [val, op]; + else { + t[n += '/'] = [new u8(0), op]; + fltn(val, n, t, o); + } + } +}; +// text encoder +var te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder(); +// text decoder +var td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder(); +// text decoder stream +var tds = 0; +try { + td.decode(et, { stream: true }); + tds = 1; +} +catch (e) { } +// decode UTF8 +var dutf8 = function (d) { + for (var r = '', i = 0;;) { + var c = d[i++]; + var eb = (c > 127) + (c > 223) + (c > 239); + if (i + eb > d.length) + return { s: r, r: slc(d, i - 1) }; + if (!eb) + r += String.fromCharCode(c); + else if (eb == 3) { + c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536, + r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023)); + } + else if (eb & 1) + r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63)); + else + r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)); + } +}; +/** + * Streaming UTF-8 decoding + */ +var DecodeUTF8 = /*#__PURE__*/ (function () { + /** + * Creates a UTF-8 decoding stream + * @param cb The callback to call whenever data is decoded + */ + function DecodeUTF8(cb) { + this.ondata = cb; + if (tds) + this.t = new TextDecoder(); + else + this.p = et; + } + /** + * Pushes a chunk to be decoded from UTF-8 binary + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + DecodeUTF8.prototype.push = function (chunk, final) { + if (!this.ondata) + err(5); + final = !!final; + if (this.t) { + this.ondata(this.t.decode(chunk, { stream: true }), final); + if (final) { + if (this.t.decode().length) + err(8); + this.t = null; + } + return; + } + if (!this.p) + err(4); + var dat = new u8(this.p.length + chunk.length); + dat.set(this.p); + dat.set(chunk, this.p.length); + var _a = dutf8(dat), s = _a.s, r = _a.r; + if (final) { + if (r.length) + err(8); + this.p = null; + } + else + this.p = r; + this.ondata(s, final); + }; + return DecodeUTF8; +}()); +export { DecodeUTF8 }; +/** + * Streaming UTF-8 encoding + */ +var EncodeUTF8 = /*#__PURE__*/ (function () { + /** + * Creates a UTF-8 decoding stream + * @param cb The callback to call whenever data is encoded + */ + function EncodeUTF8(cb) { + this.ondata = cb; + } + /** + * Pushes a chunk to be encoded to UTF-8 + * @param chunk The string data to push + * @param final Whether this is the last chunk + */ + EncodeUTF8.prototype.push = function (chunk, final) { + if (!this.ondata) + err(5); + if (this.d) + err(4); + this.ondata(strToU8(chunk), this.d = final || false); + }; + return EncodeUTF8; +}()); +export { EncodeUTF8 }; +/** + * Converts a string into a Uint8Array for use with compression/decompression methods + * @param str The string to encode + * @param latin1 Whether or not to interpret the data as Latin-1. This should + * not need to be true unless decoding a binary string. + * @returns The string encoded in UTF-8/Latin-1 binary + */ +export function strToU8(str, latin1) { + if (latin1) { + var ar_1 = new u8(str.length); + for (var i = 0; i < str.length; ++i) + ar_1[i] = str.charCodeAt(i); + return ar_1; + } + if (te) + return te.encode(str); + var l = str.length; + var ar = new u8(str.length + (str.length >> 1)); + var ai = 0; + var w = function (v) { ar[ai++] = v; }; + for (var i = 0; i < l; ++i) { + if (ai + 5 > ar.length) { + var n = new u8(ai + 8 + ((l - i) << 1)); + n.set(ar); + ar = n; + } + var c = str.charCodeAt(i); + if (c < 128 || latin1) + w(c); + else if (c < 2048) + w(192 | (c >> 6)), w(128 | (c & 63)); + else if (c > 55295 && c < 57344) + c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023), + w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63)); + else + w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63)); + } + return slc(ar, 0, ai); +} +/** + * Converts a Uint8Array to a string + * @param dat The data to decode to string + * @param latin1 Whether or not to interpret the data as Latin-1. This should + * not need to be true unless encoding to binary string. + * @returns The original UTF-8/Latin-1 string + */ +export function strFromU8(dat, latin1) { + if (latin1) { + var r = ''; + for (var i = 0; i < dat.length; i += 16384) + r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384)); + return r; + } + else if (td) { + return td.decode(dat); + } + else { + var _a = dutf8(dat), s = _a.s, r = _a.r; + if (r.length) + err(8); + return s; + } +} +; +// deflate bit flag +var dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; }; +// skip local zip header +var slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); }; +// read zip header +var zh = function (d, b, z) { + var fnl = b2(d, b + 28), efl = b2(d, b + 30), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl; + var _a = z64hs(d, es, efl, z, b4(d, b + 20), b4(d, b + 24), b4(d, b + 42)), sc = _a[0], su = _a[1], off = _a[2]; + return [b2(d, b + 10), sc, su, fn, es + efl + b2(d, b + 32), off]; +}; +// read zip64 header sizes +var z64hs = function (d, b, l, z, sc, su, off) { + var nsc = sc == 4294967295, nsu = su == 4294967295, noff = off == 4294967295, e = b + l; + var nf = nsc + nsu + noff; + if (z && nf) { + for (; b + 4 < e; b += 4 + b2(d, b + 2)) { + if (b2(d, b) == 1) { + return [ + nsc ? b8(d, b + 4 + 8 * nsu) : sc, + nsu ? b8(d, b + 4) : su, + noff ? b8(d, b + 4 + 8 * (nsu + nsc)) : off, + 1 + ]; + } + } + // z == 2 for unknown whether or not zip64 + if (z < 2) + err(13); + } + return [sc, su, off, 0]; +}; +// extra field length +var exfl = function (ex) { + var le = 0; + if (ex) { + for (var k in ex) { + var l = ex[k].length; + if (l > 65535) + err(9); + le += l + 4; + } + } + return le; +}; +// write zip header +var wzh = function (d, b, f, fn, u, c, ce, co) { + var fl = fn.length, ex = f.extra, col = co && co.length; + var exl = exfl(ex); + wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4; + if (ce != null) + d[b++] = 20, d[b++] = f.os; + d[b] = 20, b += 2; // spec compliance? what's that? + d[b++] = (f.flag << 1) | (c < 0 && 8), d[b++] = u && 8; + d[b++] = f.compression & 255, d[b++] = f.compression >> 8; + var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980; + if (y < 0 || y > 119) + err(10); + wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >> 1)), b += 4; + if (c != -1) { + wbytes(d, b, f.crc); + wbytes(d, b + 4, c < 0 ? -c - 2 : c); + wbytes(d, b + 8, f.size); + } + wbytes(d, b + 12, fl); + wbytes(d, b + 14, exl), b += 16; + if (ce != null) { + wbytes(d, b, col); + wbytes(d, b + 6, f.attrs); + wbytes(d, b + 10, ce), b += 14; + } + d.set(fn, b); + b += fl; + if (exl) { + for (var k in ex) { + var exf = ex[k], l = exf.length; + wbytes(d, b, +k); + wbytes(d, b + 2, l); + d.set(exf, b + 4), b += 4 + l; + } + } + if (col) + d.set(co, b), b += col; + return b; +}; +// write zip footer (end of central directory) +var wzf = function (o, b, c, d, e) { + wbytes(o, b, 0x6054B50); // skip disk + wbytes(o, b + 8, c); + wbytes(o, b + 10, c); + wbytes(o, b + 12, d); + wbytes(o, b + 16, e); +}; +/** + * A pass-through stream to keep data uncompressed in a ZIP archive. + */ +var ZipPassThrough = /*#__PURE__*/ (function () { + /** + * Creates a pass-through stream that can be added to ZIP archives + * @param filename The filename to associate with this data stream + */ + function ZipPassThrough(filename) { + this.filename = filename; + this.c = crc(); + this.size = 0; + this.compression = 0; + } + /** + * Processes a chunk and pushes to the output stream. You can override this + * method in a subclass for custom behavior, but by default this passes + * the data through. You must call this.ondata(err, chunk, final) at some + * point in this method. + * @param chunk The chunk to process + * @param final Whether this is the last chunk + */ + ZipPassThrough.prototype.process = function (chunk, final) { + this.ondata(null, chunk, final); + }; + /** + * Pushes a chunk to be added. If you are subclassing this with a custom + * compression algorithm, note that you must push data from the source + * file only, pre-compression. + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + ZipPassThrough.prototype.push = function (chunk, final) { + if (!this.ondata) + err(5); + this.c.p(chunk); + this.size += chunk.length; + if (final) + this.crc = this.c.d(); + // we shouldn't really do this cast, but properly handling ArrayBufferLike + // makes the API unergonomic with Buffer + this.process(chunk, final || false); + }; + return ZipPassThrough; +}()); +export { ZipPassThrough }; +// I don't extend because TypeScript extension adds 1kB of runtime bloat +/** + * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate + * for better performance + */ +var ZipDeflate = /*#__PURE__*/ (function () { + /** + * Creates a DEFLATE stream that can be added to ZIP archives + * @param filename The filename to associate with this data stream + * @param opts The compression options + */ + function ZipDeflate(filename, opts) { + var _this = this; + if (!opts) + opts = {}; + ZipPassThrough.call(this, filename); + this.d = new Deflate(opts, function (dat, final) { + _this.ondata(null, dat, final); + }); + this.compression = 8; + this.flag = dbf(opts.level); + } + ZipDeflate.prototype.process = function (chunk, final) { + try { + this.d.push(chunk, final); + } + catch (e) { + this.ondata(e, null, final); + } + }; + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + ZipDeflate.prototype.push = function (chunk, final) { + ZipPassThrough.prototype.push.call(this, chunk, final); + }; + return ZipDeflate; +}()); +export { ZipDeflate }; +/** + * Asynchronous streaming DEFLATE compression for ZIP archives + */ +var AsyncZipDeflate = /*#__PURE__*/ (function () { + /** + * Creates an asynchronous DEFLATE stream that can be added to ZIP archives + * @param filename The filename to associate with this data stream + * @param opts The compression options + */ + function AsyncZipDeflate(filename, opts) { + var _this = this; + if (!opts) + opts = {}; + ZipPassThrough.call(this, filename); + this.d = new AsyncDeflate(opts, function (err, dat, final) { + _this.ondata(err, dat, final); + }); + this.compression = 8; + this.flag = dbf(opts.level); + this.terminate = this.d.terminate; + } + AsyncZipDeflate.prototype.process = function (chunk, final) { + this.d.push(chunk, final); + }; + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + AsyncZipDeflate.prototype.push = function (chunk, final) { + ZipPassThrough.prototype.push.call(this, chunk, final); + }; + return AsyncZipDeflate; +}()); +export { AsyncZipDeflate }; +// TODO: Better tree shaking +/** + * A zippable archive to which files can incrementally be added + */ +var Zip = /*#__PURE__*/ (function () { + /** + * Creates an empty ZIP archive to which files can be added + * @param cb The callback to call whenever data for the generated ZIP archive + * is available + */ + function Zip(cb) { + this.ondata = cb; + this.u = []; + this.d = 1; + } + /** + * Adds a file to the ZIP archive + * @param file The file stream to add + */ + Zip.prototype.add = function (file) { + var _this = this; + if (!this.ondata) + err(5); + // finishing or finished + if (this.d & 2) + this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false); + else { + var f = strToU8(file.filename), fl_1 = f.length; + var com = file.comment, o = com && strToU8(com); + var u = fl_1 != file.filename.length || (o && (com.length != o.length)); + var hl_1 = fl_1 + exfl(file.extra) + 30; + if (fl_1 > 65535) + this.ondata(err(11, 0, 1), null, false); + var header = new u8(hl_1); + wzh(header, 0, file, f, u, -1); + var chks_1 = [header]; + var pAll_1 = function () { + for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) { + var chk = chks_2[_i]; + _this.ondata(null, chk, false); + } + chks_1 = []; + }; + var tr_1 = this.d; + this.d = 0; + var ind_1 = this.u.length; + var uf_1 = mrg(file, { + f: f, + u: u, + o: o, + t: function () { + if (file.terminate) + file.terminate(); + }, + r: function () { + pAll_1(); + if (tr_1) { + var nxt = _this.u[ind_1 + 1]; + if (nxt) + nxt.r(); + else + _this.d = 1; + } + tr_1 = 1; + } + }); + var cl_1 = 0; + file.ondata = function (err, dat, final) { + if (err) { + _this.ondata(err, dat, final); + _this.terminate(); + } + else { + cl_1 += dat.length; + chks_1.push(dat); + if (final) { + var dd = new u8(16); + wbytes(dd, 0, 0x8074B50); + wbytes(dd, 4, file.crc); + wbytes(dd, 8, cl_1); + wbytes(dd, 12, file.size); + chks_1.push(dd); + uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size; + if (tr_1) + uf_1.r(); + tr_1 = 1; + } + else if (tr_1) + pAll_1(); + } + }; + this.u.push(uf_1); + } + }; + /** + * Ends the process of adding files and prepares to emit the final chunks. + * This *must* be called after adding all desired files for the resulting + * ZIP file to work properly. + */ + Zip.prototype.end = function () { + var _this = this; + if (this.d & 2) { + this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true); + return; + } + if (this.d) + this.e(); + else + this.u.push({ + r: function () { + if (!(_this.d & 1)) + return; + _this.u.splice(-1, 1); + _this.e(); + }, + t: function () { } + }); + this.d = 3; + }; + Zip.prototype.e = function () { + var bt = 0, l = 0, tl = 0; + for (var _i = 0, _a = this.u; _i < _a.length; _i++) { + var f = _a[_i]; + tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0); + } + var out = new u8(tl + 22); + for (var _b = 0, _c = this.u; _b < _c.length; _b++) { + var f = _c[_b]; + wzh(out, bt, f, f.f, f.u, -f.c - 2, l, f.o); + bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b; + } + wzf(out, bt, this.u.length, tl, l); + this.ondata(null, out, true); + this.d = 2; + }; + /** + * A method to terminate any internal workers used by the stream. Subsequent + * calls to add() will fail. + */ + Zip.prototype.terminate = function () { + for (var _i = 0, _a = this.u; _i < _a.length; _i++) { + var f = _a[_i]; + f.t(); + } + this.d = 2; + }; + return Zip; +}()); +export { Zip }; +export function zip(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + var r = {}; + fltn(data, '', r, opts); + var k = Object.keys(r); + var lft = k.length, o = 0, tot = 0; + var slft = lft, files = new Array(lft); + var term = []; + var tAll = function () { + for (var i = 0; i < term.length; ++i) + term[i](); + }; + var cbd = function (a, b) { + mt(function () { cb(a, b); }); + }; + mt(function () { cbd = cb; }); + var cbf = function () { + var out = new u8(tot + 22), oe = o, cdl = tot - o; + tot = 0; + for (var i = 0; i < slft; ++i) { + var f = files[i]; + try { + var l = f.c.length; + wzh(out, tot, f, f.f, f.u, l); + var badd = 30 + f.f.length + exfl(f.extra); + var loc = tot + badd; + out.set(f.c, loc); + wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l; + } + catch (e) { + return cbd(e, null); + } + } + wzf(out, o, files.length, cdl, oe); + cbd(null, out); + }; + if (!lft) + cbf(); + var _loop_1 = function (i) { + var fn = k[i]; + var _a = r[fn], file = _a[0], p = _a[1]; + var c = crc(), size = file.length; + c.p(file); + var f = strToU8(fn), s = f.length; + var com = p.comment, m = com && strToU8(com), ms = m && m.length; + var exl = exfl(p.extra); + var compression = p.level == 0 ? 0 : 8; + var cbl = function (e, d) { + if (e) { + tAll(); + cbd(e, null); + } + else { + var l = d.length; + files[i] = mrg(p, { + size: size, + crc: c.d(), + c: d, + f: f, + m: m, + u: s != fn.length || (m && (com.length != ms)), + compression: compression + }); + o += 30 + s + exl + l; + tot += 76 + 2 * (s + exl) + (ms || 0) + l; + if (!--lft) + cbf(); + } + }; + if (s > 65535) + cbl(err(11, 0, 1), null); + if (!compression) + cbl(null, file); + else if (size < 160000) { + try { + cbl(null, deflateSync(file, p)); + } + catch (e) { + cbl(e, null); + } + } + else + term.push(deflate(file, p, cbl)); + }; + // Cannot use lft because it can decrease + for (var i = 0; i < slft; ++i) { + _loop_1(i); + } + return tAll; +} +/** + * Synchronously creates a ZIP file. Prefer using `zip` for better performance + * with more than one file. + * @param data The directory structure for the ZIP archive + * @param opts The main options, merged with per-file options + * @returns The generated ZIP archive + */ +export function zipSync(data, opts) { + if (!opts) + opts = {}; + var r = {}; + var files = []; + fltn(data, '', r, opts); + var o = 0; + var tot = 0; + for (var fn in r) { + var _a = r[fn], file = _a[0], p = _a[1]; + var compression = p.level == 0 ? 0 : 8; + var f = strToU8(fn), s = f.length; + var com = p.comment, m = com && strToU8(com), ms = m && m.length; + var exl = exfl(p.extra); + if (s > 65535) + err(11); + var d = compression ? deflateSync(file, p) : file, l = d.length; + var c = crc(); + c.p(file); + files.push(mrg(p, { + size: file.length, + crc: c.d(), + c: d, + f: f, + m: m, + u: s != fn.length || (m && (com.length != ms)), + o: o, + compression: compression + })); + o += 30 + s + exl + l; + tot += 76 + 2 * (s + exl) + (ms || 0) + l; + } + var out = new u8(tot + 22), oe = o, cdl = tot - o; + for (var i = 0; i < files.length; ++i) { + var f = files[i]; + wzh(out, f.o, f, f.f, f.u, f.c.length); + var badd = 30 + f.f.length + exfl(f.extra); + out.set(f.c, f.o + badd); + wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0); + } + wzf(out, o, files.length, cdl, oe); + return out; +} +/** + * Streaming pass-through decompression for ZIP archives + */ +var UnzipPassThrough = /*#__PURE__*/ (function () { + function UnzipPassThrough() { + } + UnzipPassThrough.prototype.push = function (chunk, final) { + // same as ZipPassThrough: cast to retain Buffer ergonomics + this.ondata(null, chunk, final); + }; + UnzipPassThrough.compression = 0; + return UnzipPassThrough; +}()); +export { UnzipPassThrough }; +/** + * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for + * better performance. + */ +var UnzipInflate = /*#__PURE__*/ (function () { + /** + * Creates a DEFLATE decompression that can be used in ZIP archives + */ + function UnzipInflate() { + var _this = this; + this.i = new Inflate(function (dat, final) { + _this.ondata(null, dat, final); + }); + } + UnzipInflate.prototype.push = function (chunk, final) { + try { + this.i.push(chunk, final); + } + catch (e) { + this.ondata(e, null, final); + } + }; + UnzipInflate.compression = 8; + return UnzipInflate; +}()); +export { UnzipInflate }; +/** + * Asynchronous streaming DEFLATE decompression for ZIP archives + */ +var AsyncUnzipInflate = /*#__PURE__*/ (function () { + /** + * Creates a DEFLATE decompression that can be used in ZIP archives + */ + function AsyncUnzipInflate(_, sz) { + var _this = this; + if (sz < 320000) { + this.i = new Inflate(function (dat, final) { + _this.ondata(null, dat, final); + }); + } + else { + this.i = new AsyncInflate(function (err, dat, final) { + _this.ondata(err, dat, final); + }); + this.terminate = this.i.terminate; + } + } + AsyncUnzipInflate.prototype.push = function (chunk, final) { + if (this.i.terminate) + chunk = slc(chunk, 0); + this.i.push(chunk, final); + }; + AsyncUnzipInflate.compression = 8; + return AsyncUnzipInflate; +}()); +export { AsyncUnzipInflate }; +/** + * A ZIP archive decompression stream that emits files as they are discovered + */ +var Unzip = /*#__PURE__*/ (function () { + /** + * Creates a ZIP decompression stream + * @param cb The callback to call whenever a file in the ZIP archive is found + */ + function Unzip(cb) { + this.onfile = cb; + this.k = []; + this.o = { + 0: UnzipPassThrough + }; + this.p = et; + } + /** + * Pushes a chunk to be unzipped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Unzip.prototype.push = function (chunk, final) { + var _this = this; + if (!this.onfile) + err(5); + if (!this.p) + err(4); + if (this.c > 0) { + var len = Math.min(this.c, chunk.length); + var toAdd = chunk.subarray(0, len); + this.c -= len; + if (this.d) + this.d.push(toAdd, !this.c); + else + this.k[0].push(toAdd); + chunk = chunk.subarray(len); + if (chunk.length) + return this.push(chunk, final); + } + else { + var f = 0, i = 0, is = void 0, buf = void 0; + if (!this.p.length) + buf = chunk; + else if (!chunk.length) + buf = this.p; + else { + buf = new u8(this.p.length + chunk.length); + buf.set(this.p), buf.set(chunk, this.p.length); + } + var l = buf.length, oc = this.c, add = oc && this.d; + var _loop_2 = function () { + var sig = b4(buf, i); + if (sig == 0x4034B50) { + f = 1, is = i; + this_1.d = null; + this_1.c = 0; + var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28); + if (l > i + 30 + fnl + es) { + var chks_3 = []; + this_1.k.unshift(chks_3); + f = 2; + var lsc = b4(buf, i + 18), lsu = b4(buf, i + 22); + var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u); + var _a = z64hs(buf, i, es, 2, lsc, lsu, 0), sc_1 = _a[0], su_1 = _a[1], z64 = _a[3]; + if (dd) + sc_1 = -1 - z64; + i += es; + this_1.c = sc_1; + var d_1; + var file_1 = { + name: fn_1, + compression: cmp_1, + start: function () { + if (!file_1.ondata) + err(5); + if (!sc_1) + file_1.ondata(null, et, true); + else { + var ctr = _this.o[cmp_1]; + if (!ctr) + file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false); + d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1); + d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); }; + for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) { + var dat = chks_4[_i]; + d_1.push(dat, false); + } + if (_this.k[0] == chks_3 && _this.c) + _this.d = d_1; + else + d_1.push(et, true); + } + }, + terminate: function () { + if (d_1 && d_1.terminate) + d_1.terminate(); + } + }; + if (sc_1 >= 0) + file_1.size = sc_1, file_1.originalSize = su_1; + this_1.onfile(file_1); + } + return "break"; + } + else if (oc) { + if (sig == 0x8074B50) { + is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0; + return "break"; + } + else if (sig == 0x2014B50) { + is = i -= 4, f = 3, this_1.c = 0; + return "break"; + } + } + }; + var this_1 = this; + for (; i < l - 4; ++i) { + var state_1 = _loop_2(); + if (state_1 === "break") + break; + } + this.p = et; + if (oc < 0) { + var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i); + if (add) + add.push(dat, !!f); + else + this.k[+(f == 2)].push(dat); + } + if (f & 2) + return this.push(buf.subarray(i), final); + this.p = buf.subarray(i); + } + if (final) { + if (this.c) + err(13); + this.p = null; + } + }; + /** + * Registers a decoder with the stream, allowing for files compressed with + * the compression type provided to be expanded correctly + * @param decoder The decoder constructor + */ + Unzip.prototype.register = function (decoder) { + this.o[decoder.compression] = decoder; + }; + return Unzip; +}()); +export { Unzip }; +var mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); }; +export function unzip(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + var term = []; + var tAll = function () { + for (var i = 0; i < term.length; ++i) + term[i](); + }; + var files = {}; + var cbd = function (a, b) { + mt(function () { cb(a, b); }); + }; + mt(function () { cbd = cb; }); + var e = data.length - 22; + for (; b4(data, e) != 0x6054B50; --e) { + if (!e || data.length - e > 65558) { + cbd(err(13, 0, 1), null); + return tAll; + } + } + ; + var lft = b2(data, e + 8); + if (lft) { + var c = lft; + var o = b4(data, e + 16); + var z = b4(data, e - 20) == 0x7064B50; + if (z) { + var ze = b4(data, e - 12); + z = b4(data, ze) == 0x6064B50; + if (z) { + c = lft = b4(data, ze + 32); + o = b4(data, ze + 48); + } + } + var fltr = opts && opts.filter; + var _loop_3 = function (i) { + var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off); + o = no; + var cbl = function (e, d) { + if (e) { + tAll(); + cbd(e, null); + } + else { + if (d) + files[fn] = d; + if (!--lft) + cbd(null, files); + } + }; + if (!fltr || fltr({ + name: fn, + size: sc, + originalSize: su, + compression: c_1 + })) { + if (!c_1) + cbl(null, slc(data, b, b + sc)); + else if (c_1 == 8) { + var infl = data.subarray(b, b + sc); + // Synchronously decompress under 512KB, or barely-compressed data + if (su < 524288 || sc > 0.8 * su) { + try { + cbl(null, inflateSync(infl, { out: new u8(su) })); + } + catch (e) { + cbl(e, null); + } + } + else + term.push(inflate(infl, { size: su }, cbl)); + } + else + cbl(err(14, 'unknown compression type ' + c_1, 1), null); + } + else + cbl(null, null); + }; + for (var i = 0; i < c; ++i) { + _loop_3(i); + } + } + else + cbd(null, {}); + return tAll; +} +/** + * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better + * performance with more than one file. + * @param data The raw compressed ZIP file + * @param opts The ZIP extraction options + * @returns The decompressed files + */ +export function unzipSync(data, opts) { + var files = {}; + var e = data.length - 22; + for (; b4(data, e) != 0x6054B50; --e) { + if (!e || data.length - e > 65558) + err(13); + } + ; + var c = b2(data, e + 8); + if (!c) + return {}; + var o = b4(data, e + 16); + var z = b4(data, e - 20) == 0x7064B50; + if (z) { + var ze = b4(data, e - 12); + z = b4(data, ze) == 0x6064B50; + if (z) { + c = b4(data, ze + 32); + o = b4(data, ze + 48); + } + } + var fltr = opts && opts.filter; + for (var i = 0; i < c; ++i) { + var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off); + o = no; + if (!fltr || fltr({ + name: fn, + size: sc, + originalSize: su, + compression: c_2 + })) { + if (!c_2) + files[fn] = slc(data, b, b + sc); + else if (c_2 == 8) + files[fn] = inflateSync(data.subarray(b, b + sc), { out: new u8(su) }); + else + err(14, 'unknown compression type ' + c_2); + } + } + return files; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/esm/index.d.mts b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/esm/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..d430faf2b555c978d66c89f46155b72c2c45a971 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/esm/index.d.mts @@ -0,0 +1,1539 @@ +/** + * Codes for errors generated within this library + */ +export declare const FlateErrorCode: { + readonly UnexpectedEOF: 0; + readonly InvalidBlockType: 1; + readonly InvalidLengthLiteral: 2; + readonly InvalidDistance: 3; + readonly StreamFinished: 4; + readonly NoStreamHandler: 5; + readonly InvalidHeader: 6; + readonly NoCallback: 7; + readonly InvalidUTF8: 8; + readonly ExtraFieldTooLong: 9; + readonly InvalidDate: 10; + readonly FilenameTooLong: 11; + readonly StreamFinishing: 12; + readonly InvalidZipData: 13; + readonly UnknownCompressionMethod: 14; +}; +/** + * An error generated within this library + */ +export interface FlateError extends Error { + /** + * The code associated with this error + */ + code: number; +} +/** + * Options for decompressing a DEFLATE stream + */ +export interface InflateStreamOptions { + /** + * The dictionary used to compress the original data. If no dictionary was used during compression, this option has no effect. + * + * Supplying the wrong dictionary during decompression usually yields corrupt output or causes an invalid distance error. + */ + dictionary?: Uint8Array; +} +/** + * Options for decompressing DEFLATE data + */ +export interface InflateOptions extends InflateStreamOptions { + /** + * The buffer into which to write the decompressed data. Saves memory if you know the decompressed size in advance. + * + * Note that if the decompression result is larger than the size of this buffer, it will be truncated to fit. + */ + out?: Uint8Array; +} +/** + * Options for decompressing a GZIP stream + */ +export interface GunzipStreamOptions extends InflateStreamOptions { +} +/** + * Options for decompressing GZIP data + */ +export interface GunzipOptions extends InflateStreamOptions { + /** + * The buffer into which to write the decompressed data. GZIP already encodes the output size, so providing this doesn't save memory. + * + * Note that if the decompression result is larger than the size of this buffer, it will be truncated to fit. + */ + out?: Uint8Array; +} +/** + * Options for decompressing a Zlib stream + */ +export interface UnzlibStreamOptions extends InflateStreamOptions { +} +/** + * Options for decompressing Zlib data + */ +export interface UnzlibOptions extends InflateOptions { +} +/** + * Options for compressing data into a DEFLATE format + */ +export interface DeflateOptions { + /** + * The level of compression to use, ranging from 0-9. + * + * 0 will store the data without compression. + * 1 is fastest but compresses the worst, 9 is slowest but compresses the best. + * The default level is 6. + * + * Typically, binary data benefits much more from higher values than text data. + * In both cases, higher values usually take disproportionately longer than the reduction in final size that results. + * + * For example, a 1 MB text file could: + * - become 1.01 MB with level 0 in 1ms + * - become 400 kB with level 1 in 10ms + * - become 320 kB with level 9 in 100ms + */ + level?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; + /** + * The memory level to use, ranging from 0-12. Increasing this increases speed and compression ratio at the cost of memory. + * + * Note that this is exponential: while level 0 uses 8 kB, level 4 uses 128 kB, level 8 uses 2 MB, and level 12 uses 32 MB. + * It is recommended not to lower the value below 4, since that tends to hurt performance. + * In addition, values above 8 tend to help very little on most data and can even hurt performance. + * + * The default value is automatically determined based on the size of the input data. + */ + mem?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12; + /** + * A buffer containing common byte sequences in the input data that can be used to significantly improve compression ratios. + * + * Dictionaries should be 32kB or smaller and include strings or byte sequences likely to appear in the input. + * The decompressor must supply the same dictionary as the compressor to extract the original data. + * + * Dictionaries only improve aggregate compression ratio when reused across multiple small inputs. They should typically not be used otherwise. + * + * Avoid using dictionaries with GZIP and ZIP to maximize software compatibility. + */ + dictionary?: Uint8Array; +} +/** + * Options for compressing data into a GZIP format + */ +export interface GzipOptions extends DeflateOptions { + /** + * When the file was last modified. Defaults to the current time. + * Set this to 0 to avoid revealing a modification date entirely. + */ + mtime?: Date | string | number; + /** + * The filename of the data. If the `gunzip` command is used to decompress the data, it will output a file + * with this name instead of the name of the compressed file. + */ + filename?: string; +} +/** + * Options for compressing data into a Zlib format + */ +export interface ZlibOptions extends DeflateOptions { +} +/** + * Handler for data (de)compression streams + * @param data The data output from the stream processor + * @param final Whether this is the final block + */ +export type FlateStreamHandler = (data: Uint8Array, final: boolean) => void; +/** + * Handler for asynchronous data (de)compression streams + * @param err Any error that occurred + * @param data The data output from the stream processor + * @param final Whether this is the final block + */ +export type AsyncFlateStreamHandler = (err: FlateError | null, data: Uint8Array, final: boolean) => void; +/** + * Handler for the asynchronous completion of (de)compression for a data chunk + * @param size The number of bytes that were processed. This is measured in terms of the input + * (i.e. compressed bytes for decompression, uncompressed bytes for compression.) + */ +export type AsyncFlateDrainHandler = (size: number) => void; +/** + * Callback for asynchronous (de)compression methods + * @param err Any error that occurred + * @param data The resulting data. Only present if `err` is null + */ +export type FlateCallback = (err: FlateError | null, data: Uint8Array) => void; +interface AsyncOptions { + /** + * Whether or not to "consume" the source data. This will make the typed array/buffer you pass in + * unusable but will increase performance and reduce memory usage. + */ + consume?: boolean; +} +/** + * Options for compressing data asynchronously into a DEFLATE format + */ +export interface AsyncDeflateOptions extends DeflateOptions, AsyncOptions { +} +/** + * Options for decompressing DEFLATE data asynchronously + */ +export interface AsyncInflateOptions extends AsyncOptions, InflateStreamOptions { + /** + * The original size of the data. Currently, the asynchronous API disallows + * writing into a buffer you provide; the best you can do is provide the + * size in bytes and be given back a new typed array. + */ + size?: number; +} +/** + * Options for compressing data asynchronously into a GZIP format + */ +export interface AsyncGzipOptions extends GzipOptions, AsyncOptions { +} +/** + * Options for decompressing GZIP data asynchronously + */ +export interface AsyncGunzipOptions extends AsyncOptions, InflateStreamOptions { +} +/** + * Options for compressing data asynchronously into a Zlib format + */ +export interface AsyncZlibOptions extends ZlibOptions, AsyncOptions { +} +/** + * Options for decompressing Zlib data asynchronously + */ +export interface AsyncUnzlibOptions extends AsyncInflateOptions { +} +/** + * A terminable compression/decompression process + */ +export interface AsyncTerminable { + /** + * Terminates the worker thread immediately. The callback will not be called. + */ + (): void; +} +/** + * Streaming DEFLATE compression + */ +export declare class Deflate { + /** + * Creates a DEFLATE stream + * @param opts The compression options + * @param cb The callback to call whenever data is deflated + */ + constructor(opts: DeflateOptions, cb?: FlateStreamHandler); + /** + * Creates a DEFLATE stream + * @param cb The callback to call whenever data is deflated + */ + constructor(cb?: FlateStreamHandler); + private b; + private s; + private o; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + private p; + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * deflated output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. A separate DEFLATE stream may be concatenated + * with the current output after a sync flush. + */ + flush(sync?: boolean): void; +} +/** + * Asynchronous streaming DEFLATE compression + */ +export declare class AsyncDeflate { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of uncompressed bytes buffered in the stream + */ + queuedSize: number; + /** + * Creates an asynchronous DEFLATE stream + * @param opts The compression options + * @param cb The callback to call whenever data is deflated + */ + constructor(opts: DeflateOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous DEFLATE stream + * @param cb The callback to call whenever data is deflated + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * deflated output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. A separate DEFLATE stream may be concatenated + * with the current output after a sync flush. + */ + flush(sync?: boolean): void; + /** + * A method to terminate the stream's internal worker. Subsequent calls to + * push() will silently fail. + */ + terminate: AsyncTerminable; +} +/** + * Asynchronously compresses data with DEFLATE without any wrapper + * @param data The data to compress + * @param opts The compression options + * @param cb The function to be called upon compression completion + * @returns A function that can be used to immediately terminate the compression + */ +export declare function deflate(data: Uint8Array, opts: AsyncDeflateOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously compresses data with DEFLATE without any wrapper + * @param data The data to compress + * @param cb The function to be called upon compression completion + */ +export declare function deflate(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Compresses data with DEFLATE without any wrapper + * @param data The data to compress + * @param opts The compression options + * @returns The deflated version of the data + */ +export declare function deflateSync(data: Uint8Array, opts?: DeflateOptions): Uint8Array; +/** + * Streaming DEFLATE decompression + */ +export declare class Inflate { + private s; + private o; + private p; + private d; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + /** + * Creates a DEFLATE decompression stream + * @param opts The decompression options + * @param cb The callback to call whenever data is inflated + */ + constructor(opts: InflateStreamOptions, cb?: FlateStreamHandler); + /** + * Creates a DEFLATE decompression stream + * @param cb The callback to call whenever data is inflated + */ + constructor(cb?: FlateStreamHandler); + private e; + private c; + /** + * Pushes a chunk to be inflated + * @param chunk The chunk to push + * @param final Whether this is the final chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Asynchronous streaming DEFLATE decompression + */ +export declare class AsyncInflate { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of compressed bytes buffered in the stream + */ + queuedSize: number; + /** + * Creates an asynchronous DEFLATE decompression stream + * @param opts The decompression options + * @param cb The callback to call whenever data is inflated + */ + constructor(opts: InflateStreamOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous DEFLATE decompression stream + * @param cb The callback to call whenever data is inflated + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Pushes a chunk to be inflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * A method to terminate the stream's internal worker. Subsequent calls to + * push() will silently fail. + */ + terminate: AsyncTerminable; +} +/** + * Asynchronously expands DEFLATE data with no wrapper + * @param data The data to decompress + * @param opts The decompression options + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function inflate(data: Uint8Array, opts: AsyncInflateOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously expands DEFLATE data with no wrapper + * @param data The data to decompress + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function inflate(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Expands DEFLATE data with no wrapper + * @param data The data to decompress + * @returns The decompressed version of the data + */ +export declare function inflateSync(data: Uint8Array): Uint8Array; +/** + * Expands DEFLATE data with no wrapper + * @param data The data to decompress + * @param opts The decompression options + * @returns The decompressed version of the data + */ +export declare function inflateSync(data: Uint8Array, opts?: InflateOptions): Uint8Array; +/** + * Streaming GZIP compression + */ +export declare class Gzip { + private c; + private l; + private v; + private o; + private s; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + /** + * Creates a GZIP stream + * @param opts The compression options + * @param cb The callback to call whenever data is deflated + */ + constructor(opts: GzipOptions, cb?: FlateStreamHandler); + /** + * Creates a GZIP stream + * @param cb The callback to call whenever data is deflated + */ + constructor(cb?: FlateStreamHandler); + /** + * Pushes a chunk to be GZIPped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + private p; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * GZIPped output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. + */ + flush(sync?: boolean): void; +} +/** + * Asynchronous streaming GZIP compression + */ +export declare class AsyncGzip { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of uncompressed bytes buffered in the stream + */ + queuedSize: number; + /** + * Creates an asynchronous GZIP stream + * @param opts The compression options + * @param cb The callback to call whenever data is deflated + */ + constructor(opts: GzipOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous GZIP stream + * @param cb The callback to call whenever data is deflated + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Pushes a chunk to be GZIPped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * GZIPped output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. + */ + flush(sync?: boolean): void; + /** + * A method to terminate the stream's internal worker. Subsequent calls to + * push() will silently fail. + */ + terminate: AsyncTerminable; +} +/** + * Asynchronously compresses data with GZIP + * @param data The data to compress + * @param opts The compression options + * @param cb The function to be called upon compression completion + * @returns A function that can be used to immediately terminate the compression + */ +export declare function gzip(data: Uint8Array, opts: AsyncGzipOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously compresses data with GZIP + * @param data The data to compress + * @param cb The function to be called upon compression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function gzip(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Compresses data with GZIP + * @param data The data to compress + * @param opts The compression options + * @returns The gzipped version of the data + */ +export declare function gzipSync(data: Uint8Array, opts?: GzipOptions): Uint8Array; +/** + * Handler for new GZIP members in concatenated GZIP streams. Useful for building indices used to perform random-access reads on compressed files. + * @param offset The offset of the new member relative to the start of the stream + */ +export type GunzipMemberHandler = (offset: number) => void; +/** + * Streaming single or multi-member GZIP decompression + */ +export declare class Gunzip { + private v; + private r; + private o; + private p; + private s; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + /** + * The handler to call whenever a new GZIP member is found + */ + onmember?: GunzipMemberHandler; + /** + * Creates a GUNZIP stream + * @param opts The decompression options + * @param cb The callback to call whenever data is inflated + */ + constructor(opts: GunzipStreamOptions, cb?: FlateStreamHandler); + /** + * Creates a GUNZIP stream + * @param cb The callback to call whenever data is inflated + */ + constructor(cb?: FlateStreamHandler); + /** + * Pushes a chunk to be GUNZIPped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Asynchronous streaming single or multi-member GZIP decompression + */ +export declare class AsyncGunzip { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of compressed bytes buffered in the stream + */ + queuedSize: number; + /** + * The handler to call whenever a new GZIP member is found + */ + onmember?: GunzipMemberHandler; + /** + * Creates an asynchronous GUNZIP stream + * @param opts The decompression options + * @param cb The callback to call whenever data is inflated + */ + constructor(opts: GunzipStreamOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous GUNZIP stream + * @param cb The callback to call whenever data is inflated + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Pushes a chunk to be GUNZIPped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * A method to terminate the stream's internal worker. Subsequent calls to + * push() will silently fail. + */ + terminate: AsyncTerminable; +} +/** + * Asynchronously expands GZIP data + * @param data The data to decompress + * @param opts The decompression options + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function gunzip(data: Uint8Array, opts: AsyncGunzipOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously expands GZIP data + * @param data The data to decompress + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function gunzip(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Expands GZIP data + * @param data The data to decompress + * @returns The decompressed version of the data + */ +export declare function gunzipSync(data: Uint8Array): Uint8Array; +/** + * Expands GZIP data + * @param data The data to decompress + * @param opts The decompression options + * @returns The decompressed version of the data + */ +export declare function gunzipSync(data: Uint8Array, opts?: GunzipOptions): Uint8Array; +/** + * Streaming Zlib compression + */ +export declare class Zlib { + private c; + private v; + private o; + private s; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + /** + * Creates a Zlib stream + * @param opts The compression options + * @param cb The callback to call whenever data is deflated + */ + constructor(opts: ZlibOptions, cb?: FlateStreamHandler); + /** + * Creates a Zlib stream + * @param cb The callback to call whenever data is deflated + */ + constructor(cb?: FlateStreamHandler); + /** + * Pushes a chunk to be zlibbed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + private p; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * zlibbed output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. + */ + flush(sync?: boolean): void; +} +/** + * Asynchronous streaming Zlib compression + */ +export declare class AsyncZlib { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of uncompressed bytes buffered in the stream + */ + queuedSize: number; + /** + * Creates an asynchronous Zlib stream + * @param opts The compression options + * @param cb The callback to call whenever data is deflated + */ + constructor(opts: ZlibOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous Zlib stream + * @param cb The callback to call whenever data is deflated + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * zlibbed output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. + */ + flush(sync?: boolean): void; + /** + * A method to terminate the stream's internal worker. Subsequent calls to + * push() will silently fail. + */ + terminate: AsyncTerminable; +} +/** + * Asynchronously compresses data with Zlib + * @param data The data to compress + * @param opts The compression options + * @param cb The function to be called upon compression completion + */ +export declare function zlib(data: Uint8Array, opts: AsyncZlibOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously compresses data with Zlib + * @param data The data to compress + * @param cb The function to be called upon compression completion + * @returns A function that can be used to immediately terminate the compression + */ +export declare function zlib(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Compress data with Zlib + * @param data The data to compress + * @param opts The compression options + * @returns The zlib-compressed version of the data + */ +export declare function zlibSync(data: Uint8Array, opts?: ZlibOptions): Uint8Array; +/** + * Streaming Zlib decompression + */ +export declare class Unzlib { + private v; + private p; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + /** + * Creates a Zlib decompression stream + * @param opts The decompression options + * @param cb The callback to call whenever data is inflated + */ + constructor(opts: UnzlibStreamOptions, cb?: FlateStreamHandler); + /** + * Creates a Zlib decompression stream + * @param cb The callback to call whenever data is inflated + */ + constructor(cb?: FlateStreamHandler); + /** + * Pushes a chunk to be unzlibbed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Asynchronous streaming Zlib decompression + */ +export declare class AsyncUnzlib { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of compressed bytes buffered in the stream + */ + queuedSize: number; + /** + * Creates an asynchronous Zlib decompression stream + * @param opts The decompression options + * @param cb The callback to call whenever data is inflated + */ + constructor(opts: UnzlibStreamOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous Zlib decompression stream + * @param cb The callback to call whenever data is inflated + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Pushes a chunk to be decompressed from Zlib + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * A method to terminate the stream's internal worker. Subsequent calls to + * push() will silently fail. + */ + terminate: AsyncTerminable; +} +/** + * Asynchronously expands Zlib data + * @param data The data to decompress + * @param opts The decompression options + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function unzlib(data: Uint8Array, opts: AsyncUnzlibOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously expands Zlib data + * @param data The data to decompress + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function unzlib(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Expands Zlib data + * @param data The data to decompress + * @returns The decompressed version of the data + */ +export declare function unzlibSync(data: Uint8Array): Uint8Array; +/** + * Expands Zlib data + * @param data The data to decompress + * @param opts The decompression options + * @returns The decompressed version of the data + */ +export declare function unzlibSync(data: Uint8Array, opts?: UnzlibOptions): Uint8Array; +export { gzip as compress, AsyncGzip as AsyncCompress }; +export { gzipSync as compressSync, Gzip as Compress }; +/** + * Streaming GZIP, Zlib, or raw DEFLATE decompression + */ +export declare class Decompress { + private G; + private I; + private Z; + private o; + private s; + private p; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + /** + * Creates a decompression stream + * @param opts The decompression options + * @param cb The callback to call whenever data is decompressed + */ + constructor(opts: InflateStreamOptions, cb?: FlateStreamHandler); + /** + * Creates a decompression stream + * @param cb The callback to call whenever data is decompressed + */ + constructor(cb?: FlateStreamHandler); + private i; + /** + * Pushes a chunk to be decompressed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression + */ +export declare class AsyncDecompress { + private G; + private I; + private Z; + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of compressed bytes buffered in the stream + */ + queuedSize: number; + /** + * Creates an asynchronous decompression stream + * @param opts The decompression options + * @param cb The callback to call whenever data is decompressed + */ + constructor(opts: InflateStreamOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous decompression stream + * @param cb The callback to call whenever data is decompressed + */ + constructor(cb?: AsyncFlateStreamHandler); + private i; + /** + * Pushes a chunk to be decompressed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Asynchrononously expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format + * @param data The data to decompress + * @param opts The decompression options + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function decompress(data: Uint8Array, opts: AsyncInflateOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchrononously expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format + * @param data The data to decompress + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function decompress(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format + * @param data The data to decompress + * @param opts The decompression options + * @returns The decompressed version of the data + */ +export declare function decompressSync(data: Uint8Array, opts?: InflateOptions): Uint8Array; +/** + * Attributes for files added to a ZIP archive object + */ +export interface ZipAttributes { + /** + * The operating system of origin for this file. The value is defined + * by PKZIP's APPNOTE.txt, section 4.4.2.2. For example, 0 (the default) + * is MS/DOS, 3 is Unix, 19 is macOS. + */ + os?: number; + /** + * The file's attributes. These are traditionally somewhat complicated + * and platform-dependent, so using them is scarcely necessary. However, + * here is a representation of what this is, bit by bit: + * + * `TTTTugtrwxrwxrwx0000000000ADVSHR` + * + * TTTT = file type (rarely useful) + * + * u = setuid, g = setgid, t = sticky + * + * rwx = user permissions, rwx = group permissions, rwx = other permissions + * + * 0000000000 = unused + * + * A = archive, D = directory, V = volume label, S = system file, H = hidden, R = read-only + * + * If you want to set the Unix permissions, for instance, just bit shift by 16, e.g. 0o644 << 16. + * Note that attributes usually only work in conjunction with the `os` setting: you must use + * `os` = 3 (Unix) if you want to set Unix permissions + */ + attrs?: number; + /** + * Extra metadata to add to the file. This field is defined by PKZIP's APPNOTE.txt, + * section 4.4.28. At most 65,535 bytes may be used in each ID. The ID must be an + * integer between 0 and 65,535, inclusive. + * + * This field is incredibly rare and almost never needed except for compliance with + * proprietary standards and software. + */ + extra?: Record; + /** + * The comment to attach to the file. This field is defined by PKZIP's APPNOTE.txt, + * section 4.4.26. The comment must be at most 65,535 bytes long UTF-8 encoded. This + * field is not read by consumer software. + */ + comment?: string; + /** + * When the file was last modified. Defaults to the current time. + */ + mtime?: GzipOptions['mtime']; +} +/** + * Options for creating a ZIP archive + */ +export interface ZipOptions extends DeflateOptions, ZipAttributes { +} +/** + * Options for expanding a ZIP archive + */ +export interface UnzipOptions { + /** + * A filter function to extract only certain files from a ZIP archive + */ + filter?: UnzipFileFilter; +} +/** + * Options for asynchronously creating a ZIP archive + */ +export interface AsyncZipOptions extends AsyncDeflateOptions, ZipAttributes { +} +/** + * Options for asynchronously expanding a ZIP archive + */ +export interface AsyncUnzipOptions extends UnzipOptions { +} +/** + * A file that can be used to create a ZIP archive + */ +export type ZippableFile = Uint8Array | Zippable | [Uint8Array | Zippable, ZipOptions]; +/** + * A file that can be used to asynchronously create a ZIP archive + */ +export type AsyncZippableFile = Uint8Array | AsyncZippable | [Uint8Array | AsyncZippable, AsyncZipOptions]; +/** + * The complete directory structure of a ZIPpable archive + */ +export interface Zippable { + [path: string]: ZippableFile; +} +/** + * The complete directory structure of an asynchronously ZIPpable archive + */ +export interface AsyncZippable { + [path: string]: AsyncZippableFile; +} +/** + * An unzipped archive. The full path of each file is used as the key, + * and the file is the value + */ +export interface Unzipped { + [path: string]: Uint8Array; +} +/** + * Handler for string generation streams + * @param data The string output from the stream processor + * @param final Whether this is the final block + */ +export type StringStreamHandler = (data: string, final: boolean) => void; +/** + * Callback for asynchronous ZIP decompression + * @param err Any error that occurred + * @param data The decompressed ZIP archive + */ +export type UnzipCallback = (err: FlateError | null, data: Unzipped) => void; +/** + * Handler for streaming ZIP decompression + * @param file The file that was found in the archive + */ +export type UnzipFileHandler = (file: UnzipFile) => void; +/** + * Streaming UTF-8 decoding + */ +export declare class DecodeUTF8 { + private p; + private t; + /** + * Creates a UTF-8 decoding stream + * @param cb The callback to call whenever data is decoded + */ + constructor(cb?: StringStreamHandler); + /** + * Pushes a chunk to be decoded from UTF-8 binary + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * The handler to call whenever data is available + */ + ondata: StringStreamHandler; +} +/** + * Streaming UTF-8 encoding + */ +export declare class EncodeUTF8 { + private d; + /** + * Creates a UTF-8 decoding stream + * @param cb The callback to call whenever data is encoded + */ + constructor(cb?: FlateStreamHandler); + /** + * Pushes a chunk to be encoded to UTF-8 + * @param chunk The string data to push + * @param final Whether this is the last chunk + */ + push(chunk: string, final?: boolean): void; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; +} +/** + * Converts a string into a Uint8Array for use with compression/decompression methods + * @param str The string to encode + * @param latin1 Whether or not to interpret the data as Latin-1. This should + * not need to be true unless decoding a binary string. + * @returns The string encoded in UTF-8/Latin-1 binary + */ +export declare function strToU8(str: string, latin1?: boolean): Uint8Array; +/** + * Converts a Uint8Array to a string + * @param dat The data to decode to string + * @param latin1 Whether or not to interpret the data as Latin-1. This should + * not need to be true unless encoding to binary string. + * @returns The original UTF-8/Latin-1 string + */ +export declare function strFromU8(dat: Uint8Array, latin1?: boolean): string; +/** + * A stream that can be used to create a file in a ZIP archive + */ +export interface ZipInputFile extends ZipAttributes { + /** + * The filename to associate with the data provided to this stream. If you + * want a file in a subdirectory, use forward slashes as a separator (e.g. + * `directory/filename.ext`). This will still work on Windows. + */ + filename: string; + /** + * The size of the file in bytes. This attribute may be invalid after + * the file is added to the ZIP archive; it must be correct only before the + * stream completes. + * + * If you don't want to have to compute this yourself, consider extending the + * ZipPassThrough class and overriding its process() method, or using one of + * ZipDeflate or AsyncZipDeflate. + */ + size: number; + /** + * A CRC of the original file contents. This attribute may be invalid after + * the file is added to the ZIP archive; it must be correct only before the + * stream completes. + * + * If you don't want to have to generate this yourself, consider extending the + * ZipPassThrough class and overriding its process() method, or using one of + * ZipDeflate or AsyncZipDeflate. + */ + crc: number; + /** + * The compression format for the data stream. This number is determined by + * the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no + * compression, 8 = deflate, 14 = LZMA + */ + compression: number; + /** + * Bits 1 and 2 of the general purpose bit flag, specified in PKZIP's + * APPNOTE.txt, section 4.4.4. Should be between 0 and 3. This is unlikely + * to be necessary. + */ + flag?: number; + /** + * The handler to be called when data is added. After passing this stream to + * the ZIP file object, this handler will always be defined. To call it: + * + * `stream.ondata(error, chunk, final)` + * + * error = any error that occurred (null if there was no error) + * + * chunk = a Uint8Array of the data that was added (null if there was an + * error) + * + * final = boolean, whether this is the final chunk in the stream + */ + ondata?: AsyncFlateStreamHandler; + /** + * A method called when the stream is no longer needed, for clean-up + * purposes. This will not always be called after the stream completes, + * so you may wish to call this.terminate() after the final chunk is + * processed if you have clean-up logic. + */ + terminate?: AsyncTerminable; +} +/** + * A pass-through stream to keep data uncompressed in a ZIP archive. + */ +export declare class ZipPassThrough implements ZipInputFile { + filename: string; + crc: number; + size: number; + compression: number; + os?: number; + attrs?: number; + comment?: string; + extra?: Record; + mtime?: GzipOptions['mtime']; + ondata: AsyncFlateStreamHandler; + private c; + /** + * Creates a pass-through stream that can be added to ZIP archives + * @param filename The filename to associate with this data stream + */ + constructor(filename: string); + /** + * Processes a chunk and pushes to the output stream. You can override this + * method in a subclass for custom behavior, but by default this passes + * the data through. You must call this.ondata(err, chunk, final) at some + * point in this method. + * @param chunk The chunk to process + * @param final Whether this is the last chunk + */ + protected process(chunk: Uint8Array, final: boolean): void; + /** + * Pushes a chunk to be added. If you are subclassing this with a custom + * compression algorithm, note that you must push data from the source + * file only, pre-compression. + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate + * for better performance + */ +export declare class ZipDeflate implements ZipInputFile { + filename: string; + crc: number; + size: number; + compression: number; + flag: 0 | 1 | 2 | 3; + os?: number; + attrs?: number; + comment?: string; + extra?: Record; + mtime?: GzipOptions['mtime']; + ondata: AsyncFlateStreamHandler; + private d; + /** + * Creates a DEFLATE stream that can be added to ZIP archives + * @param filename The filename to associate with this data stream + * @param opts The compression options + */ + constructor(filename: string, opts?: DeflateOptions); + private process; + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Asynchronous streaming DEFLATE compression for ZIP archives + */ +export declare class AsyncZipDeflate implements ZipInputFile { + filename: string; + crc: number; + size: number; + compression: number; + flag: 0 | 1 | 2 | 3; + os?: number; + attrs?: number; + comment?: string; + extra?: Record; + mtime?: GzipOptions['mtime']; + ondata: AsyncFlateStreamHandler; + private d; + terminate: AsyncTerminable; + /** + * Creates an asynchronous DEFLATE stream that can be added to ZIP archives + * @param filename The filename to associate with this data stream + * @param opts The compression options + */ + constructor(filename: string, opts?: DeflateOptions); + private process; + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * A zippable archive to which files can incrementally be added + */ +export declare class Zip { + private u; + private d; + /** + * Creates an empty ZIP archive to which files can be added + * @param cb The callback to call whenever data for the generated ZIP archive + * is available + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Adds a file to the ZIP archive + * @param file The file stream to add + */ + add(file: ZipInputFile): void; + /** + * Ends the process of adding files and prepares to emit the final chunks. + * This *must* be called after adding all desired files for the resulting + * ZIP file to work properly. + */ + end(): void; + private e; + /** + * A method to terminate any internal workers used by the stream. Subsequent + * calls to add() will fail. + */ + terminate(): void; + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; +} +/** + * Asynchronously creates a ZIP file + * @param data The directory structure for the ZIP archive + * @param opts The main options, merged with per-file options + * @param cb The callback to call with the generated ZIP archive + * @returns A function that can be used to immediately terminate the compression + */ +export declare function zip(data: AsyncZippable, opts: AsyncZipOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously creates a ZIP file + * @param data The directory structure for the ZIP archive + * @param cb The callback to call with the generated ZIP archive + * @returns A function that can be used to immediately terminate the compression + */ +export declare function zip(data: AsyncZippable, cb: FlateCallback): AsyncTerminable; +/** + * Synchronously creates a ZIP file. Prefer using `zip` for better performance + * with more than one file. + * @param data The directory structure for the ZIP archive + * @param opts The main options, merged with per-file options + * @returns The generated ZIP archive + */ +export declare function zipSync(data: Zippable, opts?: ZipOptions): Uint8Array; +/** + * A decoder for files in ZIP streams + */ +export interface UnzipDecoder { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * Pushes a chunk to be decompressed + * @param chunk The data in this chunk. Do not consume (detach) this buffer. + * @param final Whether this is the last chunk in the data stream + */ + push(chunk: Uint8Array, final: boolean): void; + /** + * A method to terminate any internal workers used by the stream. Subsequent + * calls to push() should silently fail. + */ + terminate?: AsyncTerminable; +} +/** + * A constructor for a decoder for unzip streams + */ +export interface UnzipDecoderConstructor { + /** + * Creates an instance of the decoder + * @param filename The name of the file + * @param size The compressed size of the file + * @param originalSize The original size of the file + */ + new (filename: string, size?: number, originalSize?: number): UnzipDecoder; + /** + * The compression format for the data stream. This number is determined by + * the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no + * compression, 8 = deflate, 14 = LZMA + */ + compression: number; +} +/** + * Information about a file to be extracted from a ZIP archive + */ +export interface UnzipFileInfo { + /** + * The name of the file + */ + name: string; + /** + * The compressed size of the file + */ + size: number; + /** + * The original size of the file + */ + originalSize: number; + /** + * The compression format for the data stream. This number is determined by + * the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no + * compression, 8 = deflate, 14 = LZMA. If the filter function returns true + * but this value is not 8, the unzip function will throw. + */ + compression: number; +} +/** + * A filter for files to be extracted during the unzipping process + * @param file The info for the current file being processed + * @returns Whether or not to extract the current file + */ +export type UnzipFileFilter = (file: UnzipFileInfo) => boolean; +/** + * Streaming file extraction from ZIP archives + */ +export interface UnzipFile { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The name of the file + */ + name: string; + /** + * The compression format for the data stream. This number is determined by + * the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no + * compression, 8 = deflate, 14 = LZMA. If start() is called but there is no + * decompression stream available for this method, start() will throw. + */ + compression: number; + /** + * The compressed size of the file. Will not be present for archives created + * in a streaming fashion. + */ + size?: number; + /** + * The original size of the file. Will not be present for archives created + * in a streaming fashion. + */ + originalSize?: number; + /** + * Starts reading from the stream. Calling this function will always enable + * this stream, but ocassionally the stream will be enabled even without + * this being called. + */ + start(): void; + /** + * A method to terminate any internal workers used by the stream. ondata + * will not be called any further. + */ + terminate: AsyncTerminable; +} +/** + * Streaming pass-through decompression for ZIP archives + */ +export declare class UnzipPassThrough implements UnzipDecoder { + static compression: number; + ondata: AsyncFlateStreamHandler; + push(chunk: Uint8Array, final: boolean): void; +} +/** + * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for + * better performance. + */ +export declare class UnzipInflate implements UnzipDecoder { + static compression: number; + private i; + ondata: AsyncFlateStreamHandler; + /** + * Creates a DEFLATE decompression that can be used in ZIP archives + */ + constructor(); + push(chunk: Uint8Array, final: boolean): void; +} +/** + * Asynchronous streaming DEFLATE decompression for ZIP archives + */ +export declare class AsyncUnzipInflate implements UnzipDecoder { + static compression: number; + private i; + ondata: AsyncFlateStreamHandler; + terminate: AsyncTerminable; + /** + * Creates a DEFLATE decompression that can be used in ZIP archives + */ + constructor(_: string, sz?: number); + push(chunk: Uint8Array, final: boolean): void; +} +/** + * A ZIP archive decompression stream that emits files as they are discovered + */ +export declare class Unzip { + private d; + private c; + private p; + private k; + private o; + /** + * Creates a ZIP decompression stream + * @param cb The callback to call whenever a file in the ZIP archive is found + */ + constructor(cb?: UnzipFileHandler); + /** + * Pushes a chunk to be unzipped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * Registers a decoder with the stream, allowing for files compressed with + * the compression type provided to be expanded correctly + * @param decoder The decoder constructor + */ + register(decoder: UnzipDecoderConstructor): void; + /** + * The handler to call whenever a file is discovered + */ + onfile: UnzipFileHandler; +} +/** + * Asynchronously decompresses a ZIP archive + * @param data The raw compressed ZIP file + * @param opts The ZIP extraction options + * @param cb The callback to call with the decompressed files + * @returns A function that can be used to immediately terminate the unzipping + */ +export declare function unzip(data: Uint8Array, opts: AsyncUnzipOptions, cb: UnzipCallback): AsyncTerminable; +/** + * Asynchronously decompresses a ZIP archive + * @param data The raw compressed ZIP file + * @param cb The callback to call with the decompressed files + * @returns A function that can be used to immediately terminate the unzipping + */ +export declare function unzip(data: Uint8Array, cb: UnzipCallback): AsyncTerminable; +/** + * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better + * performance with more than one file. + * @param data The raw compressed ZIP file + * @param opts The ZIP extraction options + * @returns The decompressed files + */ +export declare function unzipSync(data: Uint8Array, opts?: UnzipOptions): Unzipped; diff --git a/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/esm/index.mjs b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/esm/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..4c057eef8a9932d1eb80325c2f08f2975afe23bd --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/esm/index.mjs @@ -0,0 +1,2710 @@ +import { createRequire } from 'module'; +var require = createRequire('/'); +// DEFLATE is a complex format; to read this code, you should probably check the RFC first: +// https://tools.ietf.org/html/rfc1951 +// You may also wish to take a look at the guide I made about this program: +// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad +// Some of the following code is similar to that of UZIP.js: +// https://github.com/photopea/UZIP.js +// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size. +// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint +// is better for memory in most engines (I *think*). +var _a; +// Mediocre shim +var Worker; +var isMarkedAsUntransferable; +var workerAdd = ";var __w=require('worker_threads');__w.parentPort.on('message',function(m){onmessage({data:m})}),postMessage=function(m,t){__w.parentPort.postMessage(m,t)},close=process.exit;self=global"; +try { + (_a = require('worker_threads'), Worker = _a.Worker, isMarkedAsUntransferable = _a.isMarkedAsUntransferable); +} +catch (e) { +} +var wk = Worker ? function (c, _, msg, transfer, cb) { + var done = false; + var w = new Worker(c + workerAdd, { eval: true }) + .on('error', function (e) { return cb(e, null); }) + .on('message', function (m) { return cb(null, m); }) + .on('exit', function (c) { + if (c && !done) + cb(new Error('exited with code ' + c), null); + }); + if (isMarkedAsUntransferable) + transfer = transfer.filter(function (t) { return !isMarkedAsUntransferable(t); }); + w.postMessage(msg, transfer); + w.terminate = function () { + done = true; + return Worker.prototype.terminate.call(w); + }; + return w; +} : function (_, __, ___, ____, cb) { + setImmediate(function () { return cb(new Error('async operations unsupported - update to Node 12+ (or Node 10-11 with the --experimental-worker CLI flag)'), null); }); + var NOP = function () { }; + return { + terminate: NOP, + postMessage: NOP + }; +}; + +// aliases for shorter compressed code (most minifers don't do this) +var u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array; +// fixed length extra bits +var fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]); +// fixed distance extra bits +var fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, /* unused */ 0, 0]); +// code length index map +var clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]); +// get base, reverse index map from extra bits +var freb = function (eb, start) { + var b = new u16(31); + for (var i = 0; i < 31; ++i) { + b[i] = start += 1 << eb[i - 1]; + } + // numbers here are at max 18 bits + var r = new i32(b[30]); + for (var i = 1; i < 30; ++i) { + for (var j = b[i]; j < b[i + 1]; ++j) { + r[j] = ((j - b[i]) << 5) | i; + } + } + return { b: b, r: r }; +}; +var _a = freb(fleb, 2), fl = _a.b, revfl = _a.r; +// we can ignore the fact that the other numbers are wrong; they never happen anyway +fl[28] = 258, revfl[258] = 28; +var _b = freb(fdeb, 0), fd = _b.b, revfd = _b.r; +// map of value to reverse (assuming 16 bits) +var rev = new u16(32768); +for (var i = 0; i < 32768; ++i) { + // reverse table algorithm from SO + var x = ((i & 0xAAAA) >> 1) | ((i & 0x5555) << 1); + x = ((x & 0xCCCC) >> 2) | ((x & 0x3333) << 2); + x = ((x & 0xF0F0) >> 4) | ((x & 0x0F0F) << 4); + rev[i] = (((x & 0xFF00) >> 8) | ((x & 0x00FF) << 8)) >> 1; +} +// create huffman tree from u8 "map": index -> code length for code index +// mb (max bits) must be at most 15 +// TODO: optimize/split up? +var hMap = (function (cd, mb, r) { + var s = cd.length; + // index + var i = 0; + // u16 "map": index -> # of codes with bit length = index + var l = new u16(mb); + // length of cd must be 288 (total # of codes) + for (; i < s; ++i) { + if (cd[i]) + ++l[cd[i] - 1]; + } + // u16 "map": index -> minimum code for bit length = index + var le = new u16(mb); + for (i = 1; i < mb; ++i) { + le[i] = (le[i - 1] + l[i - 1]) << 1; + } + var co; + if (r) { + // u16 "map": index -> number of actual bits, symbol for code + co = new u16(1 << mb); + // bits to remove for reverser + var rvb = 15 - mb; + for (i = 0; i < s; ++i) { + // ignore 0 lengths + if (cd[i]) { + // num encoding both symbol and bits read + var sv = (i << 4) | cd[i]; + // free bits + var r_1 = mb - cd[i]; + // start value + var v = le[cd[i] - 1]++ << r_1; + // m is end value + for (var m = v | ((1 << r_1) - 1); v <= m; ++v) { + // every 16 bit value starting with the code yields the same result + co[rev[v] >> rvb] = sv; + } + } + } + } + else { + co = new u16(s); + for (i = 0; i < s; ++i) { + if (cd[i]) { + co[i] = rev[le[cd[i] - 1]++] >> (15 - cd[i]); + } + } + } + return co; +}); +// fixed length tree +var flt = new u8(288); +for (var i = 0; i < 144; ++i) + flt[i] = 8; +for (var i = 144; i < 256; ++i) + flt[i] = 9; +for (var i = 256; i < 280; ++i) + flt[i] = 7; +for (var i = 280; i < 288; ++i) + flt[i] = 8; +// fixed distance tree +var fdt = new u8(32); +for (var i = 0; i < 32; ++i) + fdt[i] = 5; +// fixed length map +var flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1); +// fixed distance map +var fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1); +// find max of array +var max = function (a) { + var m = a[0]; + for (var i = 1; i < a.length; ++i) { + if (a[i] > m) + m = a[i]; + } + return m; +}; +// read d, starting at bit p and mask with m +var bits = function (d, p, m) { + var o = (p / 8) | 0; + return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m; +}; +// read d, starting at bit p continuing for at least 16 bits +var bits16 = function (d, p) { + var o = (p / 8) | 0; + return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7)); +}; +// get end of byte +var shft = function (p) { return ((p + 7) / 8) | 0; }; +// typed array slice - allows garbage collector to free original reference, +// while being more compatible than .slice +var slc = function (v, s, e) { + if (s == null || s < 0) + s = 0; + if (e == null || e > v.length) + e = v.length; + // can't use .constructor in case user-supplied + return new u8(v.subarray(s, e)); +}; +/** + * Codes for errors generated within this library + */ +export var FlateErrorCode = { + UnexpectedEOF: 0, + InvalidBlockType: 1, + InvalidLengthLiteral: 2, + InvalidDistance: 3, + StreamFinished: 4, + NoStreamHandler: 5, + InvalidHeader: 6, + NoCallback: 7, + InvalidUTF8: 8, + ExtraFieldTooLong: 9, + InvalidDate: 10, + FilenameTooLong: 11, + StreamFinishing: 12, + InvalidZipData: 13, + UnknownCompressionMethod: 14 +}; +// error codes +var ec = [ + 'unexpected EOF', + 'invalid block type', + 'invalid length/literal', + 'invalid distance', + 'stream finished', + 'no stream handler', + , // determined by compression function + 'no callback', + 'invalid UTF-8 data', + 'extra field too long', + 'date not in range 1980-2099', + 'filename too long', + 'stream finishing', + 'invalid zip data' + // determined by unknown compression method +]; +; +var err = function (ind, msg, nt) { + var e = new Error(msg || ec[ind]); + e.code = ind; + if (Error.captureStackTrace) + Error.captureStackTrace(e, err); + if (!nt) + throw e; + return e; +}; +// expands raw DEFLATE data +var inflt = function (dat, st, buf, dict) { + // source length dict length + var sl = dat.length, dl = dict ? dict.length : 0; + if (!sl || st.f && !st.l) + return buf || new u8(0); + var noBuf = !buf; + // have to estimate size + var resize = noBuf || st.i != 2; + // no state + var noSt = st.i; + // Assumes roughly 33% compression ratio average + if (noBuf) + buf = new u8(sl * 3); + // ensure buffer can fit at least l elements + var cbuf = function (l) { + var bl = buf.length; + // need to increase size to fit + if (l > bl) { + // Double or set to necessary, whichever is greater + var nbuf = new u8(Math.max(bl * 2, l)); + nbuf.set(buf); + buf = nbuf; + } + }; + // last chunk bitpos bytes + var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n; + // total bits + var tbts = sl * 8; + do { + if (!lm) { + // BFINAL - this is only 1 when last chunk is next + final = bits(dat, pos, 1); + // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman + var type = bits(dat, pos + 1, 3); + pos += 3; + if (!type) { + // go to end of byte boundary + var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l; + if (t > sl) { + if (noSt) + err(0); + break; + } + // ensure size + if (resize) + cbuf(bt + l); + // Copy over uncompressed data + buf.set(dat.subarray(s, t), bt); + // Get new bitpos, update byte count + st.b = bt += l, st.p = pos = t * 8, st.f = final; + continue; + } + else if (type == 1) + lm = flrm, dm = fdrm, lbt = 9, dbt = 5; + else if (type == 2) { + // literal lengths + var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4; + var tl = hLit + bits(dat, pos + 5, 31) + 1; + pos += 14; + // length+distance tree + var ldt = new u8(tl); + // code length tree + var clt = new u8(19); + for (var i = 0; i < hcLen; ++i) { + // use index map to get real code + clt[clim[i]] = bits(dat, pos + i * 3, 7); + } + pos += hcLen * 3; + // code lengths bits + var clb = max(clt), clbmsk = (1 << clb) - 1; + // code lengths map + var clm = hMap(clt, clb, 1); + for (var i = 0; i < tl;) { + var r = clm[bits(dat, pos, clbmsk)]; + // bits read + pos += r & 15; + // symbol + var s = r >> 4; + // code length to copy + if (s < 16) { + ldt[i++] = s; + } + else { + // copy count + var c = 0, n = 0; + if (s == 16) + n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1]; + else if (s == 17) + n = 3 + bits(dat, pos, 7), pos += 3; + else if (s == 18) + n = 11 + bits(dat, pos, 127), pos += 7; + while (n--) + ldt[i++] = c; + } + } + // length tree distance tree + var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit); + // max length bits + lbt = max(lt); + // max dist bits + dbt = max(dt); + lm = hMap(lt, lbt, 1); + dm = hMap(dt, dbt, 1); + } + else + err(1); + if (pos > tbts) { + if (noSt) + err(0); + break; + } + } + // Make sure the buffer can hold this + the largest possible addition + // Maximum chunk size (practically, theoretically infinite) is 2^17 + if (resize) + cbuf(bt + 131072); + var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1; + var lpos = pos; + for (;; lpos = pos) { + // bits read, code + var c = lm[bits16(dat, pos) & lms], sym = c >> 4; + pos += c & 15; + if (pos > tbts) { + if (noSt) + err(0); + break; + } + if (!c) + err(2); + if (sym < 256) + buf[bt++] = sym; + else if (sym == 256) { + lpos = pos, lm = null; + break; + } + else { + var add = sym - 254; + // no extra bits needed if less + if (sym > 264) { + // index + var i = sym - 257, b = fleb[i]; + add = bits(dat, pos, (1 << b) - 1) + fl[i]; + pos += b; + } + // dist + var d = dm[bits16(dat, pos) & dms], dsym = d >> 4; + if (!d) + err(3); + pos += d & 15; + var dt = fd[dsym]; + if (dsym > 3) { + var b = fdeb[dsym]; + dt += bits16(dat, pos) & (1 << b) - 1, pos += b; + } + if (pos > tbts) { + if (noSt) + err(0); + break; + } + if (resize) + cbuf(bt + 131072); + var end = bt + add; + if (bt < dt) { + var shift = dl - dt, dend = Math.min(dt, end); + if (shift + bt < 0) + err(3); + for (; bt < dend; ++bt) + buf[bt] = dict[shift + bt]; + } + for (; bt < end; ++bt) + buf[bt] = buf[bt - dt]; + } + } + st.l = lm, st.p = lpos, st.b = bt, st.f = final; + if (lm) + final = 1, st.m = lbt, st.d = dm, st.n = dbt; + } while (!final); + // don't reallocate for streams or user buffers + return bt != buf.length && noBuf ? slc(buf, 0, bt) : buf.subarray(0, bt); +}; +// starting at p, write the minimum number of bits that can hold v to d +var wbits = function (d, p, v) { + v <<= p & 7; + var o = (p / 8) | 0; + d[o] |= v; + d[o + 1] |= v >> 8; +}; +// starting at p, write the minimum number of bits (>8) that can hold v to d +var wbits16 = function (d, p, v) { + v <<= p & 7; + var o = (p / 8) | 0; + d[o] |= v; + d[o + 1] |= v >> 8; + d[o + 2] |= v >> 16; +}; +// creates code lengths from a frequency table +var hTree = function (d, mb) { + // Need extra info to make a tree + var t = []; + for (var i = 0; i < d.length; ++i) { + if (d[i]) + t.push({ s: i, f: d[i] }); + } + var s = t.length; + var t2 = t.slice(); + if (!s) + return { t: et, l: 0 }; + if (s == 1) { + var v = new u8(t[0].s + 1); + v[t[0].s] = 1; + return { t: v, l: 1 }; + } + t.sort(function (a, b) { return a.f - b.f; }); + // after i2 reaches last ind, will be stopped + // freq must be greater than largest possible number of symbols + t.push({ s: -1, f: 25001 }); + var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2; + t[0] = { s: -1, f: l.f + r.f, l: l, r: r }; + // efficient algorithm from UZIP.js + // i0 is lookbehind, i2 is lookahead - after processing two low-freq + // symbols that combined have high freq, will start processing i2 (high-freq, + // non-composite) symbols instead + // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/ + while (i1 != s - 1) { + l = t[t[i0].f < t[i2].f ? i0++ : i2++]; + r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++]; + t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r }; + } + var maxSym = t2[0].s; + for (var i = 1; i < s; ++i) { + if (t2[i].s > maxSym) + maxSym = t2[i].s; + } + // code lengths + var tr = new u16(maxSym + 1); + // max bits in tree + var mbt = ln(t[i1 - 1], tr, 0); + if (mbt > mb) { + // more algorithms from UZIP.js + // TODO: find out how this code works (debt) + // ind debt + var i = 0, dt = 0; + // left cost + var lft = mbt - mb, cst = 1 << lft; + t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; }); + for (; i < s; ++i) { + var i2_1 = t2[i].s; + if (tr[i2_1] > mb) { + dt += cst - (1 << (mbt - tr[i2_1])); + tr[i2_1] = mb; + } + else + break; + } + dt >>= lft; + while (dt > 0) { + var i2_2 = t2[i].s; + if (tr[i2_2] < mb) + dt -= 1 << (mb - tr[i2_2]++ - 1); + else + ++i; + } + for (; i >= 0 && dt; --i) { + var i2_3 = t2[i].s; + if (tr[i2_3] == mb) { + --tr[i2_3]; + ++dt; + } + } + mbt = mb; + } + return { t: new u8(tr), l: mbt }; +}; +// get the max length and assign length codes +var ln = function (n, l, d) { + return n.s == -1 + ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1)) + : (l[n.s] = d); +}; +// length codes generation +var lc = function (c) { + var s = c.length; + // Note that the semicolon was intentional + while (s && !c[--s]) + ; + var cl = new u16(++s); + // ind num streak + var cli = 0, cln = c[0], cls = 1; + var w = function (v) { cl[cli++] = v; }; + for (var i = 1; i <= s; ++i) { + if (c[i] == cln && i != s) + ++cls; + else { + if (!cln && cls > 2) { + for (; cls > 138; cls -= 138) + w(32754); + if (cls > 2) { + w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305); + cls = 0; + } + } + else if (cls > 3) { + w(cln), --cls; + for (; cls > 6; cls -= 6) + w(8304); + if (cls > 2) + w(((cls - 3) << 5) | 8208), cls = 0; + } + while (cls--) + w(cln); + cls = 1; + cln = c[i]; + } + } + return { c: cl.subarray(0, cli), n: s }; +}; +// calculate the length of output from tree, code lengths +var clen = function (cf, cl) { + var l = 0; + for (var i = 0; i < cl.length; ++i) + l += cf[i] * cl[i]; + return l; +}; +// writes a fixed block +// returns the new bit pos +var wfblk = function (out, pos, dat) { + // no need to write 00 as type: TypedArray defaults to 0 + var s = dat.length; + var o = shft(pos + 2); + out[o] = s & 255; + out[o + 1] = s >> 8; + out[o + 2] = out[o] ^ 255; + out[o + 3] = out[o + 1] ^ 255; + for (var i = 0; i < s; ++i) + out[o + i + 4] = dat[i]; + return (o + 4 + s) * 8; +}; +// writes a block +var wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) { + wbits(out, p++, final); + ++lf[256]; + var _a = hTree(lf, 15), dlt = _a.t, mlb = _a.l; + var _b = hTree(df, 15), ddt = _b.t, mdb = _b.l; + var _c = lc(dlt), lclt = _c.c, nlc = _c.n; + var _d = lc(ddt), lcdt = _d.c, ndc = _d.n; + var lcfreq = new u16(19); + for (var i = 0; i < lclt.length; ++i) + ++lcfreq[lclt[i] & 31]; + for (var i = 0; i < lcdt.length; ++i) + ++lcfreq[lcdt[i] & 31]; + var _e = hTree(lcfreq, 7), lct = _e.t, mlcb = _e.l; + var nlcc = 19; + for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc) + ; + var flen = (bl + 5) << 3; + var ftlen = clen(lf, flt) + clen(df, fdt) + eb; + var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + 2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]; + if (bs >= 0 && flen <= ftlen && flen <= dtlen) + return wfblk(out, p, dat.subarray(bs, bs + bl)); + var lm, ll, dm, dl; + wbits(out, p, 1 + (dtlen < ftlen)), p += 2; + if (dtlen < ftlen) { + lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt; + var llm = hMap(lct, mlcb, 0); + wbits(out, p, nlc - 257); + wbits(out, p + 5, ndc - 1); + wbits(out, p + 10, nlcc - 4); + p += 14; + for (var i = 0; i < nlcc; ++i) + wbits(out, p + 3 * i, lct[clim[i]]); + p += 3 * nlcc; + var lcts = [lclt, lcdt]; + for (var it = 0; it < 2; ++it) { + var clct = lcts[it]; + for (var i = 0; i < clct.length; ++i) { + var len = clct[i] & 31; + wbits(out, p, llm[len]), p += lct[len]; + if (len > 15) + wbits(out, p, (clct[i] >> 5) & 127), p += clct[i] >> 12; + } + } + } + else { + lm = flm, ll = flt, dm = fdm, dl = fdt; + } + for (var i = 0; i < li; ++i) { + var sym = syms[i]; + if (sym > 255) { + var len = (sym >> 18) & 31; + wbits16(out, p, lm[len + 257]), p += ll[len + 257]; + if (len > 7) + wbits(out, p, (sym >> 23) & 31), p += fleb[len]; + var dst = sym & 31; + wbits16(out, p, dm[dst]), p += dl[dst]; + if (dst > 3) + wbits16(out, p, (sym >> 5) & 8191), p += fdeb[dst]; + } + else { + wbits16(out, p, lm[sym]), p += ll[sym]; + } + } + wbits16(out, p, lm[256]); + return p + ll[256]; +}; +// deflate options (nice << 13) | chain +var deo = /*#__PURE__*/ new i32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]); +// empty +var et = /*#__PURE__*/ new u8(0); +// compresses data into a raw DEFLATE buffer +var dflt = function (dat, lvl, plvl, pre, post, st) { + var s = st.z || dat.length; + var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post); + // writing to this writes to the output buffer + var w = o.subarray(pre, o.length - post); + var lst = st.l; + var pos = (st.r || 0) & 7; + if (lvl) { + if (pos) + w[0] = st.r >> 3; + var opt = deo[lvl - 1]; + var n = opt >> 13, c = opt & 8191; + var msk_1 = (1 << plvl) - 1; + // prev 2-byte val map curr 2-byte val map + var prev = st.p || new u16(32768), head = st.h || new u16(msk_1 + 1); + var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1; + var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; }; + // 24576 is an arbitrary number of maximum symbols per block + // 424 buffer for last block + var syms = new i32(25000); + // length/literal freq distance freq + var lf = new u16(288), df = new u16(32); + // l/lcnt exbits index l/lind waitdx blkpos + var lc_1 = 0, eb = 0, i = st.i || 0, li = 0, wi = st.w || 0, bs = 0; + for (; i + 2 < s; ++i) { + // hash value + var hv = hsh(i); + // index mod 32768 previous index mod + var imod = i & 32767, pimod = head[hv]; + prev[imod] = pimod; + head[hv] = imod; + // We always should modify head and prev, but only add symbols if + // this data is not yet processed ("wait" for wait index) + if (wi <= i) { + // bytes remaining + var rem = s - i; + if ((lc_1 > 7000 || li > 24576) && (rem > 423 || !lst)) { + pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos); + li = lc_1 = eb = 0, bs = i; + for (var j = 0; j < 286; ++j) + lf[j] = 0; + for (var j = 0; j < 30; ++j) + df[j] = 0; + } + // len dist chain + var l = 2, d = 0, ch_1 = c, dif = imod - pimod & 32767; + if (rem > 2 && hv == hsh(i - dif)) { + var maxn = Math.min(n, rem) - 1; + var maxd = Math.min(32767, i); + // max possible length + // not capped at dif because decompressors implement "rolling" index population + var ml = Math.min(258, rem); + while (dif <= maxd && --ch_1 && imod != pimod) { + if (dat[i + l] == dat[i + l - dif]) { + var nl = 0; + for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl) + ; + if (nl > l) { + l = nl, d = dif; + // break out early when we reach "nice" (we are satisfied enough) + if (nl > maxn) + break; + // now, find the rarest 2-byte sequence within this + // length of literals and search for that instead. + // Much faster than just using the start + var mmd = Math.min(dif, nl - 2); + var md = 0; + for (var j = 0; j < mmd; ++j) { + var ti = i - dif + j & 32767; + var pti = prev[ti]; + var cd = ti - pti & 32767; + if (cd > md) + md = cd, pimod = ti; + } + } + } + // check the previous match + imod = pimod, pimod = prev[imod]; + dif += imod - pimod & 32767; + } + } + // d will be nonzero only when a match was found + if (d) { + // store both dist and len data in one int32 + // Make sure this is recognized as a len/dist with 28th bit (2^28) + syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d]; + var lin = revfl[l] & 31, din = revfd[d] & 31; + eb += fleb[lin] + fdeb[din]; + ++lf[257 + lin]; + ++df[din]; + wi = i + l; + ++lc_1; + } + else { + syms[li++] = dat[i]; + ++lf[dat[i]]; + } + } + } + for (i = Math.max(i, wi); i < s; ++i) { + syms[li++] = dat[i]; + ++lf[dat[i]]; + } + pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos); + if (!lst) { + st.r = (pos & 7) | w[(pos / 8) | 0] << 3; + // shft(pos) now 1 less if pos & 7 != 0 + pos -= 7; + st.h = head, st.p = prev, st.i = i, st.w = wi; + } + } + else { + for (var i = st.w || 0; i < s + lst; i += 65535) { + // end + var e = i + 65535; + if (e >= s) { + // write final block + w[(pos / 8) | 0] = lst; + e = s; + } + pos = wfblk(w, pos + 1, dat.subarray(i, e)); + } + st.i = s; + } + return slc(o, 0, pre + shft(pos) + post); +}; +// CRC32 table +var crct = /*#__PURE__*/ (function () { + var t = new Int32Array(256); + for (var i = 0; i < 256; ++i) { + var c = i, k = 9; + while (--k) + c = ((c & 1) && -306674912) ^ (c >>> 1); + t[i] = c; + } + return t; +})(); +// CRC32 +var crc = function () { + var c = -1; + return { + p: function (d) { + // closures have awful performance + var cr = c; + for (var i = 0; i < d.length; ++i) + cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8); + c = cr; + }, + d: function () { return ~c; } + }; +}; +// Adler32 +var adler = function () { + var a = 1, b = 0; + return { + p: function (d) { + // closures have awful performance + var n = a, m = b; + var l = d.length | 0; + for (var i = 0; i != l;) { + var e = Math.min(i + 2655, l); + for (; i < e; ++i) + m += n += d[i]; + n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16); + } + a = n, b = m; + }, + d: function () { + a %= 65521, b %= 65521; + return (a & 255) << 24 | (a & 0xFF00) << 8 | (b & 255) << 8 | (b >> 8); + } + }; +}; +; +// deflate with opts +var dopt = function (dat, opt, pre, post, st) { + if (!st) { + st = { l: 1 }; + if (opt.dictionary) { + var dict = opt.dictionary.subarray(-32768); + var newDat = new u8(dict.length + dat.length); + newDat.set(dict); + newDat.set(dat, dict.length); + dat = newDat; + st.w = dict.length; + } + } + return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? (st.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : 20) : (12 + opt.mem), pre, post, st); +}; +// Walmart object spread +var mrg = function (a, b) { + var o = {}; + for (var k in a) + o[k] = a[k]; + for (var k in b) + o[k] = b[k]; + return o; +}; +// worker clone +// This is possibly the craziest part of the entire codebase, despite how simple it may seem. +// The only parameter to this function is a closure that returns an array of variables outside of the function scope. +// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization. +// We will return an object mapping of true variable name to value (basically, the current scope as a JS object). +// The reason we can't just use the original variable names is minifiers mangling the toplevel scope. +// This took me three weeks to figure out how to do. +var wcln = function (fn, fnStr, td) { + var dt = fn(); + var st = fn.toString(); + var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/\s+/g, '').split(','); + for (var i = 0; i < dt.length; ++i) { + var v = dt[i], k = ks[i]; + if (typeof v == 'function') { + fnStr += ';' + k + '='; + var st_1 = v.toString(); + if (v.prototype) { + // for global objects + if (st_1.indexOf('[native code]') != -1) { + var spInd = st_1.indexOf(' ', 8) + 1; + fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd)); + } + else { + fnStr += st_1; + for (var t in v.prototype) + fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString(); + } + } + else + fnStr += st_1; + } + else + td[k] = v; + } + return fnStr; +}; +var ch = []; +// clone bufs +var cbfs = function (v) { + var tl = []; + for (var k in v) { + if (v[k].buffer) { + tl.push((v[k] = new v[k].constructor(v[k])).buffer); + } + } + return tl; +}; +// use a worker to execute code +var wrkr = function (fns, init, id, cb) { + if (!ch[id]) { + var fnStr = '', td_1 = {}, m = fns.length - 1; + for (var i = 0; i < m; ++i) + fnStr = wcln(fns[i], fnStr, td_1); + ch[id] = { c: wcln(fns[m], fnStr, td_1), e: td_1 }; + } + var td = mrg({}, ch[id].e); + return wk(ch[id].c + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb); +}; +// base async inflate fn +var bInflt = function () { return [u8, u16, i32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gopt]; }; +var bDflt = function () { return [u8, u16, i32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; }; +// gzip extra +var gze = function () { return [gzh, gzhl, wbytes, crc, crct]; }; +// gunzip extra +var guze = function () { return [gzs, gzl]; }; +// zlib extra +var zle = function () { return [zlh, wbytes, adler]; }; +// unzlib extra +var zule = function () { return [zls]; }; +// post buf +var pbf = function (msg) { return postMessage(msg, [msg.buffer]); }; +// get opts +var gopt = function (o) { return o && { + out: o.size && new u8(o.size), + dictionary: o.dictionary +}; }; +// async helper +var cbify = function (dat, opts, fns, init, id, cb) { + var w = wrkr(fns, init, id, function (err, dat) { + w.terminate(); + cb(err, dat); + }); + w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []); + return function () { w.terminate(); }; +}; +// auto stream +var astrm = function (strm) { + strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); }; + return function (ev) { + if (ev.data[0]) { + strm.push(ev.data[0], ev.data[1]); + postMessage([ev.data[0].length]); + } + else + strm.flush(ev.data[1]); + }; +}; +// async stream attach +var astrmify = function (fns, strm, opts, init, id, flush, ext) { + var t; + var w = wrkr(fns, init, id, function (err, dat) { + if (err) + w.terminate(), strm.ondata.call(strm, err); + else if (!Array.isArray(dat)) + ext(dat); + else if (dat.length == 1) { + strm.queuedSize -= dat[0]; + if (strm.ondrain) + strm.ondrain(dat[0]); + } + else { + if (dat[1]) + w.terminate(); + strm.ondata.call(strm, err, dat[0], dat[1]); + } + }); + w.postMessage(opts); + strm.queuedSize = 0; + strm.push = function (d, f) { + if (!strm.ondata) + err(5); + if (t) + strm.ondata(err(4, 0, 1), null, !!f); + strm.queuedSize += d.length; + // can fail for cross-realm Uint8Array, but ok - only a small performance penalty + w.postMessage([d, t = f], d.buffer instanceof ArrayBuffer ? [d.buffer] : []); + }; + strm.terminate = function () { w.terminate(); }; + if (flush) { + strm.flush = function (sync) { w.postMessage([0, sync]); }; + } +}; +// read 2 bytes +var b2 = function (d, b) { return d[b] | (d[b + 1] << 8); }; +// read 4 bytes +var b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; }; +// read 8 bytes +var b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); }; +// write bytes +var wbytes = function (d, b, v) { + for (; v; ++b) + d[b] = v, v >>>= 8; +}; +// gzip header +var gzh = function (c, o) { + var fn = o.filename; + c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix + if (o.mtime != 0) + wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000)); + if (fn) { + c[3] = 8; + for (var i = 0; i <= fn.length; ++i) + c[i + 10] = fn.charCodeAt(i); + } +}; +// gzip footer: -8 to -4 = CRC, -4 to -0 is length +// gzip start +var gzs = function (d) { + if (d[0] != 31 || d[1] != 139 || d[2] != 8) + err(6, 'invalid gzip data'); + var flg = d[3]; + var st = 10; + if (flg & 4) + st += (d[10] | d[11] << 8) + 2; + for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++]) + ; + return st + (flg & 2); +}; +// gzip length +var gzl = function (d) { + var l = d.length; + return (d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16 | d[l - 1] << 24) >>> 0; +}; +// gzip header length +var gzhl = function (o) { return 10 + (o.filename ? o.filename.length + 1 : 0); }; +// zlib header +var zlh = function (c, o) { + var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2; + c[0] = 120, c[1] = (fl << 6) | (o.dictionary && 32); + c[1] |= 31 - ((c[0] << 8) | c[1]) % 31; + if (o.dictionary) { + var h = adler(); + h.p(o.dictionary); + wbytes(c, 2, h.d()); + } +}; +// zlib start +var zls = function (d, dict) { + if ((d[0] & 15) != 8 || (d[0] >> 4) > 7 || ((d[0] << 8 | d[1]) % 31)) + err(6, 'invalid zlib data'); + if ((d[1] >> 5 & 1) == +!dict) + err(6, 'invalid zlib data: ' + (d[1] & 32 ? 'need' : 'unexpected') + ' dictionary'); + return (d[1] >> 3 & 4) + 2; +}; +function StrmOpt(opts, cb) { + if (typeof opts == 'function') + cb = opts, opts = {}; + this.ondata = cb; + return opts; +} +/** + * Streaming DEFLATE compression + */ +var Deflate = /*#__PURE__*/ (function () { + function Deflate(opts, cb) { + if (typeof opts == 'function') + cb = opts, opts = {}; + this.ondata = cb; + this.o = opts || {}; + this.s = { l: 0, i: 32768, w: 32768, z: 32768 }; + // Buffer length must always be 0 mod 32768 for index calculations to be correct when modifying head and prev + // 98304 = 32768 (lookback) + 65536 (common chunk size) + this.b = new u8(98304); + if (this.o.dictionary) { + var dict = this.o.dictionary.subarray(-32768); + this.b.set(dict, 32768 - dict.length); + this.s.i = 32768 - dict.length; + } + } + Deflate.prototype.p = function (c, f) { + this.ondata(dopt(c, this.o, 0, 0, this.s), f); + }; + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Deflate.prototype.push = function (chunk, final) { + if (!this.ondata) + err(5); + if (this.s.l) + err(4); + var endLen = chunk.length + this.s.z; + if (endLen > this.b.length) { + if (endLen > 2 * this.b.length - 32768) { + var newBuf = new u8(endLen & -32768); + newBuf.set(this.b.subarray(0, this.s.z)); + this.b = newBuf; + } + var split = this.b.length - this.s.z; + this.b.set(chunk.subarray(0, split), this.s.z); + this.s.z = this.b.length; + this.p(this.b, false); + this.b.set(this.b.subarray(-32768)); + this.b.set(chunk.subarray(split), 32768); + this.s.z = chunk.length - split + 32768; + this.s.i = 32766, this.s.w = 32768; + } + else { + this.b.set(chunk, this.s.z); + this.s.z += chunk.length; + } + this.s.l = final & 1; + if (this.s.z > this.s.w + 8191 || final) { + this.p(this.b, final || false); + this.s.w = this.s.i, this.s.i -= 2; + } + if (final) { + // cleanup unneeded buffers/state to reduce memory usage + this.s = this.o = {}; + this.b = et; + } + }; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * deflated output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. A separate DEFLATE stream may be concatenated + * with the current output after a sync flush. + */ + Deflate.prototype.flush = function (sync) { + if (!this.ondata) + err(5); + if (this.s.l) + err(4); + this.p(this.b, false); + this.s.w = this.s.i, this.s.i -= 2; + // could technically skip writing the type-0 block for (this.s.r & 7) == 0, + // but the deterministic trailer (00 00 FF FF) is useful in some situations + if (sync) { + var c = new u8(6); + c[0] = this.s.r >> 3; + // write empty, non-final type-0 block + var ep = wfblk(c, this.s.r, et); + this.s.r = 0; + this.ondata(c.subarray(0, ep >> 3), false); + } + }; + return Deflate; +}()); +export { Deflate }; +/** + * Asynchronous streaming DEFLATE compression + */ +var AsyncDeflate = /*#__PURE__*/ (function () { + function AsyncDeflate(opts, cb) { + astrmify([ + bDflt, + function () { return [astrm, Deflate]; } + ], this, StrmOpt.call(this, opts, cb), function (ev) { + var strm = new Deflate(ev.data); + onmessage = astrm(strm); + }, 6, 1); + } + return AsyncDeflate; +}()); +export { AsyncDeflate }; +export function deflate(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return cbify(data, opts, [ + bDflt, + ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb); +} +/** + * Compresses data with DEFLATE without any wrapper + * @param data The data to compress + * @param opts The compression options + * @returns The deflated version of the data + */ +export function deflateSync(data, opts) { + return dopt(data, opts || {}, 0, 0); +} +/** + * Streaming DEFLATE decompression + */ +var Inflate = /*#__PURE__*/ (function () { + function Inflate(opts, cb) { + // no StrmOpt here to avoid adding to workerizer + if (typeof opts == 'function') + cb = opts, opts = {}; + this.ondata = cb; + var dict = opts && opts.dictionary && opts.dictionary.subarray(-32768); + this.s = { i: 0, b: dict ? dict.length : 0 }; + this.o = new u8(32768); + this.p = new u8(0); + if (dict) + this.o.set(dict); + } + Inflate.prototype.e = function (c) { + if (!this.ondata) + err(5); + if (this.d) + err(4); + if (!this.p.length) + this.p = c; + else if (c.length) { + var n = new u8(this.p.length + c.length); + n.set(this.p), n.set(c, this.p.length), this.p = n; + } + }; + Inflate.prototype.c = function (final) { + this.s.i = +(this.d = final || false); + var bts = this.s.b; + var dt = inflt(this.p, this.s, this.o); + this.ondata(slc(dt, bts, this.s.b), this.d); + this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length; + this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7; + }; + /** + * Pushes a chunk to be inflated + * @param chunk The chunk to push + * @param final Whether this is the final chunk + */ + Inflate.prototype.push = function (chunk, final) { + this.e(chunk), this.c(final); + }; + return Inflate; +}()); +export { Inflate }; +/** + * Asynchronous streaming DEFLATE decompression + */ +var AsyncInflate = /*#__PURE__*/ (function () { + function AsyncInflate(opts, cb) { + astrmify([ + bInflt, + function () { return [astrm, Inflate]; } + ], this, StrmOpt.call(this, opts, cb), function (ev) { + var strm = new Inflate(ev.data); + onmessage = astrm(strm); + }, 7, 0); + } + return AsyncInflate; +}()); +export { AsyncInflate }; +export function inflate(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return cbify(data, opts, [ + bInflt + ], function (ev) { return pbf(inflateSync(ev.data[0], gopt(ev.data[1]))); }, 1, cb); +} +export function inflateSync(data, opts) { + return inflt(data, { i: 2 }, opts && opts.out, opts && opts.dictionary); +} +// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize. +/** + * Streaming GZIP compression + */ +var Gzip = /*#__PURE__*/ (function () { + function Gzip(opts, cb) { + this.c = crc(); + this.l = 0; + this.v = 1; + Deflate.call(this, opts, cb); + } + /** + * Pushes a chunk to be GZIPped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Gzip.prototype.push = function (chunk, final) { + this.c.p(chunk); + this.l += chunk.length; + Deflate.prototype.push.call(this, chunk, final); + }; + Gzip.prototype.p = function (c, f) { + var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, this.s); + if (this.v) + gzh(raw, this.o), this.v = 0; + if (f) + wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l); + this.ondata(raw, f); + }; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * GZIPped output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. + */ + Gzip.prototype.flush = function (sync) { + Deflate.prototype.flush.call(this, sync); + }; + return Gzip; +}()); +export { Gzip }; +/** + * Asynchronous streaming GZIP compression + */ +var AsyncGzip = /*#__PURE__*/ (function () { + function AsyncGzip(opts, cb) { + astrmify([ + bDflt, + gze, + function () { return [astrm, Deflate, Gzip]; } + ], this, StrmOpt.call(this, opts, cb), function (ev) { + var strm = new Gzip(ev.data); + onmessage = astrm(strm); + }, 8, 1); + } + return AsyncGzip; +}()); +export { AsyncGzip }; +export function gzip(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return cbify(data, opts, [ + bDflt, + gze, + function () { return [gzipSync]; } + ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb); +} +/** + * Compresses data with GZIP + * @param data The data to compress + * @param opts The compression options + * @returns The gzipped version of the data + */ +export function gzipSync(data, opts) { + if (!opts) + opts = {}; + var c = crc(), l = data.length; + c.p(data); + var d = dopt(data, opts, gzhl(opts), 8), s = d.length; + return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d; +} +/** + * Streaming single or multi-member GZIP decompression + */ +var Gunzip = /*#__PURE__*/ (function () { + function Gunzip(opts, cb) { + this.v = 1; + this.r = 0; + Inflate.call(this, opts, cb); + } + /** + * Pushes a chunk to be GUNZIPped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Gunzip.prototype.push = function (chunk, final) { + Inflate.prototype.e.call(this, chunk); + this.r += chunk.length; + if (this.v) { + var p = this.p.subarray(this.v - 1); + var s = p.length > 3 ? gzs(p) : 4; + if (s > p.length) { + if (!final) + return; + } + else if (this.v > 1 && this.onmember) { + this.onmember(this.r - p.length); + } + this.p = p.subarray(s), this.v = 0; + } + // necessary to prevent TS from using the closure value + // This allows for workerization to function correctly + Inflate.prototype.c.call(this, 0); + // process concatenated GZIP + if (this.s.f && !this.s.l) { + this.v = shft(this.s.p) + 9; + this.s = { i: 0 }; + this.o = new u8(0); + this.push(new u8(0), final); + } + else if (final) { + Inflate.prototype.c.call(this, final); + } + }; + return Gunzip; +}()); +export { Gunzip }; +/** + * Asynchronous streaming single or multi-member GZIP decompression + */ +var AsyncGunzip = /*#__PURE__*/ (function () { + function AsyncGunzip(opts, cb) { + var _this = this; + astrmify([ + bInflt, + guze, + function () { return [astrm, Inflate, Gunzip]; } + ], this, StrmOpt.call(this, opts, cb), function (ev) { + var strm = new Gunzip(ev.data); + strm.onmember = function (offset) { return postMessage(offset); }; + onmessage = astrm(strm); + }, 9, 0, function (offset) { return _this.onmember && _this.onmember(offset); }); + } + return AsyncGunzip; +}()); +export { AsyncGunzip }; +export function gunzip(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return cbify(data, opts, [ + bInflt, + guze, + function () { return [gunzipSync]; } + ], function (ev) { return pbf(gunzipSync(ev.data[0], ev.data[1])); }, 3, cb); +} +export function gunzipSync(data, opts) { + var st = gzs(data); + if (st + 8 > data.length) + err(6, 'invalid gzip data'); + return inflt(data.subarray(st, -8), { i: 2 }, opts && opts.out || new u8(gzl(data)), opts && opts.dictionary); +} +/** + * Streaming Zlib compression + */ +var Zlib = /*#__PURE__*/ (function () { + function Zlib(opts, cb) { + this.c = adler(); + this.v = 1; + Deflate.call(this, opts, cb); + } + /** + * Pushes a chunk to be zlibbed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Zlib.prototype.push = function (chunk, final) { + this.c.p(chunk); + Deflate.prototype.push.call(this, chunk, final); + }; + Zlib.prototype.p = function (c, f) { + var raw = dopt(c, this.o, this.v && (this.o.dictionary ? 6 : 2), f && 4, this.s); + if (this.v) + zlh(raw, this.o), this.v = 0; + if (f) + wbytes(raw, raw.length - 4, this.c.d()); + this.ondata(raw, f); + }; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * zlibbed output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. + */ + Zlib.prototype.flush = function (sync) { + Deflate.prototype.flush.call(this, sync); + }; + return Zlib; +}()); +export { Zlib }; +/** + * Asynchronous streaming Zlib compression + */ +var AsyncZlib = /*#__PURE__*/ (function () { + function AsyncZlib(opts, cb) { + astrmify([ + bDflt, + zle, + function () { return [astrm, Deflate, Zlib]; } + ], this, StrmOpt.call(this, opts, cb), function (ev) { + var strm = new Zlib(ev.data); + onmessage = astrm(strm); + }, 10, 1); + } + return AsyncZlib; +}()); +export { AsyncZlib }; +export function zlib(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return cbify(data, opts, [ + bDflt, + zle, + function () { return [zlibSync]; } + ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb); +} +/** + * Compress data with Zlib + * @param data The data to compress + * @param opts The compression options + * @returns The zlib-compressed version of the data + */ +export function zlibSync(data, opts) { + if (!opts) + opts = {}; + var a = adler(); + a.p(data); + var d = dopt(data, opts, opts.dictionary ? 6 : 2, 4); + return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d; +} +/** + * Streaming Zlib decompression + */ +var Unzlib = /*#__PURE__*/ (function () { + function Unzlib(opts, cb) { + Inflate.call(this, opts, cb); + this.v = opts && opts.dictionary ? 2 : 1; + } + /** + * Pushes a chunk to be unzlibbed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Unzlib.prototype.push = function (chunk, final) { + Inflate.prototype.e.call(this, chunk); + if (this.v) { + if (this.p.length < 6 && !final) + return; + this.p = this.p.subarray(zls(this.p, this.v - 1)), this.v = 0; + } + if (final) { + if (this.p.length < 4) + err(6, 'invalid zlib data'); + this.p = this.p.subarray(0, -4); + } + // necessary to prevent TS from using the closure value + // This allows for workerization to function correctly + Inflate.prototype.c.call(this, final); + }; + return Unzlib; +}()); +export { Unzlib }; +/** + * Asynchronous streaming Zlib decompression + */ +var AsyncUnzlib = /*#__PURE__*/ (function () { + function AsyncUnzlib(opts, cb) { + astrmify([ + bInflt, + zule, + function () { return [astrm, Inflate, Unzlib]; } + ], this, StrmOpt.call(this, opts, cb), function (ev) { + var strm = new Unzlib(ev.data); + onmessage = astrm(strm); + }, 11, 0); + } + return AsyncUnzlib; +}()); +export { AsyncUnzlib }; +export function unzlib(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return cbify(data, opts, [ + bInflt, + zule, + function () { return [unzlibSync]; } + ], function (ev) { return pbf(unzlibSync(ev.data[0], gopt(ev.data[1]))); }, 5, cb); +} +export function unzlibSync(data, opts) { + return inflt(data.subarray(zls(data, opts && opts.dictionary), -4), { i: 2 }, opts && opts.out, opts && opts.dictionary); +} +// Default algorithm for compression (used because having a known output size allows faster decompression) +export { gzip as compress, AsyncGzip as AsyncCompress }; +export { gzipSync as compressSync, Gzip as Compress }; +/** + * Streaming GZIP, Zlib, or raw DEFLATE decompression + */ +var Decompress = /*#__PURE__*/ (function () { + function Decompress(opts, cb) { + this.o = StrmOpt.call(this, opts, cb) || {}; + this.G = Gunzip; + this.I = Inflate; + this.Z = Unzlib; + } + // init substream + // overriden by AsyncDecompress + Decompress.prototype.i = function () { + var _this = this; + this.s.ondata = function (dat, final) { + _this.ondata(dat, final); + }; + }; + /** + * Pushes a chunk to be decompressed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Decompress.prototype.push = function (chunk, final) { + if (!this.ondata) + err(5); + if (!this.s) { + if (this.p && this.p.length) { + var n = new u8(this.p.length + chunk.length); + n.set(this.p), n.set(chunk, this.p.length); + } + else + this.p = chunk; + if (this.p.length > 2) { + this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8) + ? new this.G(this.o) + : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31)) + ? new this.I(this.o) + : new this.Z(this.o); + this.i(); + this.s.push(this.p, final); + this.p = null; + } + } + else + this.s.push(chunk, final); + }; + return Decompress; +}()); +export { Decompress }; +/** + * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression + */ +var AsyncDecompress = /*#__PURE__*/ (function () { + function AsyncDecompress(opts, cb) { + Decompress.call(this, opts, cb); + this.queuedSize = 0; + this.G = AsyncGunzip; + this.I = AsyncInflate; + this.Z = AsyncUnzlib; + } + AsyncDecompress.prototype.i = function () { + var _this = this; + this.s.ondata = function (err, dat, final) { + _this.ondata(err, dat, final); + }; + this.s.ondrain = function (size) { + _this.queuedSize -= size; + if (_this.ondrain) + _this.ondrain(size); + }; + }; + /** + * Pushes a chunk to be decompressed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + AsyncDecompress.prototype.push = function (chunk, final) { + this.queuedSize += chunk.length; + Decompress.prototype.push.call(this, chunk, final); + }; + return AsyncDecompress; +}()); +export { AsyncDecompress }; +export function decompress(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return (data[0] == 31 && data[1] == 139 && data[2] == 8) + ? gunzip(data, opts, cb) + : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31)) + ? inflate(data, opts, cb) + : unzlib(data, opts, cb); +} +/** + * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format + * @param data The data to decompress + * @param opts The decompression options + * @returns The decompressed version of the data + */ +export function decompressSync(data, opts) { + return (data[0] == 31 && data[1] == 139 && data[2] == 8) + ? gunzipSync(data, opts) + : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31)) + ? inflateSync(data, opts) + : unzlibSync(data, opts); +} +// flatten a directory structure +var fltn = function (d, p, t, o) { + for (var k in d) { + var val = d[k], n = p + k, op = o; + if (Array.isArray(val)) + op = mrg(o, val[1]), val = val[0]; + if (ArrayBuffer.isView(val)) + t[n] = [val, op]; + else { + t[n += '/'] = [new u8(0), op]; + fltn(val, n, t, o); + } + } +}; +// text encoder +var te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder(); +// text decoder +var td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder(); +// text decoder stream +var tds = 0; +try { + td.decode(et, { stream: true }); + tds = 1; +} +catch (e) { } +// decode UTF8 +var dutf8 = function (d) { + for (var r = '', i = 0;;) { + var c = d[i++]; + var eb = (c > 127) + (c > 223) + (c > 239); + if (i + eb > d.length) + return { s: r, r: slc(d, i - 1) }; + if (!eb) + r += String.fromCharCode(c); + else if (eb == 3) { + c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536, + r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023)); + } + else if (eb & 1) + r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63)); + else + r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)); + } +}; +/** + * Streaming UTF-8 decoding + */ +var DecodeUTF8 = /*#__PURE__*/ (function () { + /** + * Creates a UTF-8 decoding stream + * @param cb The callback to call whenever data is decoded + */ + function DecodeUTF8(cb) { + this.ondata = cb; + if (tds) + this.t = new TextDecoder(); + else + this.p = et; + } + /** + * Pushes a chunk to be decoded from UTF-8 binary + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + DecodeUTF8.prototype.push = function (chunk, final) { + if (!this.ondata) + err(5); + final = !!final; + if (this.t) { + this.ondata(this.t.decode(chunk, { stream: true }), final); + if (final) { + if (this.t.decode().length) + err(8); + this.t = null; + } + return; + } + if (!this.p) + err(4); + var dat = new u8(this.p.length + chunk.length); + dat.set(this.p); + dat.set(chunk, this.p.length); + var _a = dutf8(dat), s = _a.s, r = _a.r; + if (final) { + if (r.length) + err(8); + this.p = null; + } + else + this.p = r; + this.ondata(s, final); + }; + return DecodeUTF8; +}()); +export { DecodeUTF8 }; +/** + * Streaming UTF-8 encoding + */ +var EncodeUTF8 = /*#__PURE__*/ (function () { + /** + * Creates a UTF-8 decoding stream + * @param cb The callback to call whenever data is encoded + */ + function EncodeUTF8(cb) { + this.ondata = cb; + } + /** + * Pushes a chunk to be encoded to UTF-8 + * @param chunk The string data to push + * @param final Whether this is the last chunk + */ + EncodeUTF8.prototype.push = function (chunk, final) { + if (!this.ondata) + err(5); + if (this.d) + err(4); + this.ondata(strToU8(chunk), this.d = final || false); + }; + return EncodeUTF8; +}()); +export { EncodeUTF8 }; +/** + * Converts a string into a Uint8Array for use with compression/decompression methods + * @param str The string to encode + * @param latin1 Whether or not to interpret the data as Latin-1. This should + * not need to be true unless decoding a binary string. + * @returns The string encoded in UTF-8/Latin-1 binary + */ +export function strToU8(str, latin1) { + if (latin1) { + var ar_1 = new u8(str.length); + for (var i = 0; i < str.length; ++i) + ar_1[i] = str.charCodeAt(i); + return ar_1; + } + if (te) + return te.encode(str); + var l = str.length; + var ar = new u8(str.length + (str.length >> 1)); + var ai = 0; + var w = function (v) { ar[ai++] = v; }; + for (var i = 0; i < l; ++i) { + if (ai + 5 > ar.length) { + var n = new u8(ai + 8 + ((l - i) << 1)); + n.set(ar); + ar = n; + } + var c = str.charCodeAt(i); + if (c < 128 || latin1) + w(c); + else if (c < 2048) + w(192 | (c >> 6)), w(128 | (c & 63)); + else if (c > 55295 && c < 57344) + c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023), + w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63)); + else + w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63)); + } + return slc(ar, 0, ai); +} +/** + * Converts a Uint8Array to a string + * @param dat The data to decode to string + * @param latin1 Whether or not to interpret the data as Latin-1. This should + * not need to be true unless encoding to binary string. + * @returns The original UTF-8/Latin-1 string + */ +export function strFromU8(dat, latin1) { + if (latin1) { + var r = ''; + for (var i = 0; i < dat.length; i += 16384) + r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384)); + return r; + } + else if (td) { + return td.decode(dat); + } + else { + var _a = dutf8(dat), s = _a.s, r = _a.r; + if (r.length) + err(8); + return s; + } +} +; +// deflate bit flag +var dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; }; +// skip local zip header +var slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); }; +// read zip header +var zh = function (d, b, z) { + var fnl = b2(d, b + 28), efl = b2(d, b + 30), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl; + var _a = z64hs(d, es, efl, z, b4(d, b + 20), b4(d, b + 24), b4(d, b + 42)), sc = _a[0], su = _a[1], off = _a[2]; + return [b2(d, b + 10), sc, su, fn, es + efl + b2(d, b + 32), off]; +}; +// read zip64 header sizes +var z64hs = function (d, b, l, z, sc, su, off) { + var nsc = sc == 4294967295, nsu = su == 4294967295, noff = off == 4294967295, e = b + l; + var nf = nsc + nsu + noff; + if (z && nf) { + for (; b + 4 < e; b += 4 + b2(d, b + 2)) { + if (b2(d, b) == 1) { + return [ + nsc ? b8(d, b + 4 + 8 * nsu) : sc, + nsu ? b8(d, b + 4) : su, + noff ? b8(d, b + 4 + 8 * (nsu + nsc)) : off, + 1 + ]; + } + } + // z == 2 for unknown whether or not zip64 + if (z < 2) + err(13); + } + return [sc, su, off, 0]; +}; +// extra field length +var exfl = function (ex) { + var le = 0; + if (ex) { + for (var k in ex) { + var l = ex[k].length; + if (l > 65535) + err(9); + le += l + 4; + } + } + return le; +}; +// write zip header +var wzh = function (d, b, f, fn, u, c, ce, co) { + var fl = fn.length, ex = f.extra, col = co && co.length; + var exl = exfl(ex); + wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4; + if (ce != null) + d[b++] = 20, d[b++] = f.os; + d[b] = 20, b += 2; // spec compliance? what's that? + d[b++] = (f.flag << 1) | (c < 0 && 8), d[b++] = u && 8; + d[b++] = f.compression & 255, d[b++] = f.compression >> 8; + var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980; + if (y < 0 || y > 119) + err(10); + wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >> 1)), b += 4; + if (c != -1) { + wbytes(d, b, f.crc); + wbytes(d, b + 4, c < 0 ? -c - 2 : c); + wbytes(d, b + 8, f.size); + } + wbytes(d, b + 12, fl); + wbytes(d, b + 14, exl), b += 16; + if (ce != null) { + wbytes(d, b, col); + wbytes(d, b + 6, f.attrs); + wbytes(d, b + 10, ce), b += 14; + } + d.set(fn, b); + b += fl; + if (exl) { + for (var k in ex) { + var exf = ex[k], l = exf.length; + wbytes(d, b, +k); + wbytes(d, b + 2, l); + d.set(exf, b + 4), b += 4 + l; + } + } + if (col) + d.set(co, b), b += col; + return b; +}; +// write zip footer (end of central directory) +var wzf = function (o, b, c, d, e) { + wbytes(o, b, 0x6054B50); // skip disk + wbytes(o, b + 8, c); + wbytes(o, b + 10, c); + wbytes(o, b + 12, d); + wbytes(o, b + 16, e); +}; +/** + * A pass-through stream to keep data uncompressed in a ZIP archive. + */ +var ZipPassThrough = /*#__PURE__*/ (function () { + /** + * Creates a pass-through stream that can be added to ZIP archives + * @param filename The filename to associate with this data stream + */ + function ZipPassThrough(filename) { + this.filename = filename; + this.c = crc(); + this.size = 0; + this.compression = 0; + } + /** + * Processes a chunk and pushes to the output stream. You can override this + * method in a subclass for custom behavior, but by default this passes + * the data through. You must call this.ondata(err, chunk, final) at some + * point in this method. + * @param chunk The chunk to process + * @param final Whether this is the last chunk + */ + ZipPassThrough.prototype.process = function (chunk, final) { + this.ondata(null, chunk, final); + }; + /** + * Pushes a chunk to be added. If you are subclassing this with a custom + * compression algorithm, note that you must push data from the source + * file only, pre-compression. + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + ZipPassThrough.prototype.push = function (chunk, final) { + if (!this.ondata) + err(5); + this.c.p(chunk); + this.size += chunk.length; + if (final) + this.crc = this.c.d(); + // we shouldn't really do this cast, but properly handling ArrayBufferLike + // makes the API unergonomic with Buffer + this.process(chunk, final || false); + }; + return ZipPassThrough; +}()); +export { ZipPassThrough }; +// I don't extend because TypeScript extension adds 1kB of runtime bloat +/** + * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate + * for better performance + */ +var ZipDeflate = /*#__PURE__*/ (function () { + /** + * Creates a DEFLATE stream that can be added to ZIP archives + * @param filename The filename to associate with this data stream + * @param opts The compression options + */ + function ZipDeflate(filename, opts) { + var _this = this; + if (!opts) + opts = {}; + ZipPassThrough.call(this, filename); + this.d = new Deflate(opts, function (dat, final) { + _this.ondata(null, dat, final); + }); + this.compression = 8; + this.flag = dbf(opts.level); + } + ZipDeflate.prototype.process = function (chunk, final) { + try { + this.d.push(chunk, final); + } + catch (e) { + this.ondata(e, null, final); + } + }; + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + ZipDeflate.prototype.push = function (chunk, final) { + ZipPassThrough.prototype.push.call(this, chunk, final); + }; + return ZipDeflate; +}()); +export { ZipDeflate }; +/** + * Asynchronous streaming DEFLATE compression for ZIP archives + */ +var AsyncZipDeflate = /*#__PURE__*/ (function () { + /** + * Creates an asynchronous DEFLATE stream that can be added to ZIP archives + * @param filename The filename to associate with this data stream + * @param opts The compression options + */ + function AsyncZipDeflate(filename, opts) { + var _this = this; + if (!opts) + opts = {}; + ZipPassThrough.call(this, filename); + this.d = new AsyncDeflate(opts, function (err, dat, final) { + _this.ondata(err, dat, final); + }); + this.compression = 8; + this.flag = dbf(opts.level); + this.terminate = this.d.terminate; + } + AsyncZipDeflate.prototype.process = function (chunk, final) { + this.d.push(chunk, final); + }; + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + AsyncZipDeflate.prototype.push = function (chunk, final) { + ZipPassThrough.prototype.push.call(this, chunk, final); + }; + return AsyncZipDeflate; +}()); +export { AsyncZipDeflate }; +// TODO: Better tree shaking +/** + * A zippable archive to which files can incrementally be added + */ +var Zip = /*#__PURE__*/ (function () { + /** + * Creates an empty ZIP archive to which files can be added + * @param cb The callback to call whenever data for the generated ZIP archive + * is available + */ + function Zip(cb) { + this.ondata = cb; + this.u = []; + this.d = 1; + } + /** + * Adds a file to the ZIP archive + * @param file The file stream to add + */ + Zip.prototype.add = function (file) { + var _this = this; + if (!this.ondata) + err(5); + // finishing or finished + if (this.d & 2) + this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false); + else { + var f = strToU8(file.filename), fl_1 = f.length; + var com = file.comment, o = com && strToU8(com); + var u = fl_1 != file.filename.length || (o && (com.length != o.length)); + var hl_1 = fl_1 + exfl(file.extra) + 30; + if (fl_1 > 65535) + this.ondata(err(11, 0, 1), null, false); + var header = new u8(hl_1); + wzh(header, 0, file, f, u, -1); + var chks_1 = [header]; + var pAll_1 = function () { + for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) { + var chk = chks_2[_i]; + _this.ondata(null, chk, false); + } + chks_1 = []; + }; + var tr_1 = this.d; + this.d = 0; + var ind_1 = this.u.length; + var uf_1 = mrg(file, { + f: f, + u: u, + o: o, + t: function () { + if (file.terminate) + file.terminate(); + }, + r: function () { + pAll_1(); + if (tr_1) { + var nxt = _this.u[ind_1 + 1]; + if (nxt) + nxt.r(); + else + _this.d = 1; + } + tr_1 = 1; + } + }); + var cl_1 = 0; + file.ondata = function (err, dat, final) { + if (err) { + _this.ondata(err, dat, final); + _this.terminate(); + } + else { + cl_1 += dat.length; + chks_1.push(dat); + if (final) { + var dd = new u8(16); + wbytes(dd, 0, 0x8074B50); + wbytes(dd, 4, file.crc); + wbytes(dd, 8, cl_1); + wbytes(dd, 12, file.size); + chks_1.push(dd); + uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size; + if (tr_1) + uf_1.r(); + tr_1 = 1; + } + else if (tr_1) + pAll_1(); + } + }; + this.u.push(uf_1); + } + }; + /** + * Ends the process of adding files and prepares to emit the final chunks. + * This *must* be called after adding all desired files for the resulting + * ZIP file to work properly. + */ + Zip.prototype.end = function () { + var _this = this; + if (this.d & 2) { + this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true); + return; + } + if (this.d) + this.e(); + else + this.u.push({ + r: function () { + if (!(_this.d & 1)) + return; + _this.u.splice(-1, 1); + _this.e(); + }, + t: function () { } + }); + this.d = 3; + }; + Zip.prototype.e = function () { + var bt = 0, l = 0, tl = 0; + for (var _i = 0, _a = this.u; _i < _a.length; _i++) { + var f = _a[_i]; + tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0); + } + var out = new u8(tl + 22); + for (var _b = 0, _c = this.u; _b < _c.length; _b++) { + var f = _c[_b]; + wzh(out, bt, f, f.f, f.u, -f.c - 2, l, f.o); + bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b; + } + wzf(out, bt, this.u.length, tl, l); + this.ondata(null, out, true); + this.d = 2; + }; + /** + * A method to terminate any internal workers used by the stream. Subsequent + * calls to add() will fail. + */ + Zip.prototype.terminate = function () { + for (var _i = 0, _a = this.u; _i < _a.length; _i++) { + var f = _a[_i]; + f.t(); + } + this.d = 2; + }; + return Zip; +}()); +export { Zip }; +export function zip(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + var r = {}; + fltn(data, '', r, opts); + var k = Object.keys(r); + var lft = k.length, o = 0, tot = 0; + var slft = lft, files = new Array(lft); + var term = []; + var tAll = function () { + for (var i = 0; i < term.length; ++i) + term[i](); + }; + var cbd = function (a, b) { + mt(function () { cb(a, b); }); + }; + mt(function () { cbd = cb; }); + var cbf = function () { + var out = new u8(tot + 22), oe = o, cdl = tot - o; + tot = 0; + for (var i = 0; i < slft; ++i) { + var f = files[i]; + try { + var l = f.c.length; + wzh(out, tot, f, f.f, f.u, l); + var badd = 30 + f.f.length + exfl(f.extra); + var loc = tot + badd; + out.set(f.c, loc); + wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l; + } + catch (e) { + return cbd(e, null); + } + } + wzf(out, o, files.length, cdl, oe); + cbd(null, out); + }; + if (!lft) + cbf(); + var _loop_1 = function (i) { + var fn = k[i]; + var _a = r[fn], file = _a[0], p = _a[1]; + var c = crc(), size = file.length; + c.p(file); + var f = strToU8(fn), s = f.length; + var com = p.comment, m = com && strToU8(com), ms = m && m.length; + var exl = exfl(p.extra); + var compression = p.level == 0 ? 0 : 8; + var cbl = function (e, d) { + if (e) { + tAll(); + cbd(e, null); + } + else { + var l = d.length; + files[i] = mrg(p, { + size: size, + crc: c.d(), + c: d, + f: f, + m: m, + u: s != fn.length || (m && (com.length != ms)), + compression: compression + }); + o += 30 + s + exl + l; + tot += 76 + 2 * (s + exl) + (ms || 0) + l; + if (!--lft) + cbf(); + } + }; + if (s > 65535) + cbl(err(11, 0, 1), null); + if (!compression) + cbl(null, file); + else if (size < 160000) { + try { + cbl(null, deflateSync(file, p)); + } + catch (e) { + cbl(e, null); + } + } + else + term.push(deflate(file, p, cbl)); + }; + // Cannot use lft because it can decrease + for (var i = 0; i < slft; ++i) { + _loop_1(i); + } + return tAll; +} +/** + * Synchronously creates a ZIP file. Prefer using `zip` for better performance + * with more than one file. + * @param data The directory structure for the ZIP archive + * @param opts The main options, merged with per-file options + * @returns The generated ZIP archive + */ +export function zipSync(data, opts) { + if (!opts) + opts = {}; + var r = {}; + var files = []; + fltn(data, '', r, opts); + var o = 0; + var tot = 0; + for (var fn in r) { + var _a = r[fn], file = _a[0], p = _a[1]; + var compression = p.level == 0 ? 0 : 8; + var f = strToU8(fn), s = f.length; + var com = p.comment, m = com && strToU8(com), ms = m && m.length; + var exl = exfl(p.extra); + if (s > 65535) + err(11); + var d = compression ? deflateSync(file, p) : file, l = d.length; + var c = crc(); + c.p(file); + files.push(mrg(p, { + size: file.length, + crc: c.d(), + c: d, + f: f, + m: m, + u: s != fn.length || (m && (com.length != ms)), + o: o, + compression: compression + })); + o += 30 + s + exl + l; + tot += 76 + 2 * (s + exl) + (ms || 0) + l; + } + var out = new u8(tot + 22), oe = o, cdl = tot - o; + for (var i = 0; i < files.length; ++i) { + var f = files[i]; + wzh(out, f.o, f, f.f, f.u, f.c.length); + var badd = 30 + f.f.length + exfl(f.extra); + out.set(f.c, f.o + badd); + wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0); + } + wzf(out, o, files.length, cdl, oe); + return out; +} +/** + * Streaming pass-through decompression for ZIP archives + */ +var UnzipPassThrough = /*#__PURE__*/ (function () { + function UnzipPassThrough() { + } + UnzipPassThrough.prototype.push = function (chunk, final) { + // same as ZipPassThrough: cast to retain Buffer ergonomics + this.ondata(null, chunk, final); + }; + UnzipPassThrough.compression = 0; + return UnzipPassThrough; +}()); +export { UnzipPassThrough }; +/** + * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for + * better performance. + */ +var UnzipInflate = /*#__PURE__*/ (function () { + /** + * Creates a DEFLATE decompression that can be used in ZIP archives + */ + function UnzipInflate() { + var _this = this; + this.i = new Inflate(function (dat, final) { + _this.ondata(null, dat, final); + }); + } + UnzipInflate.prototype.push = function (chunk, final) { + try { + this.i.push(chunk, final); + } + catch (e) { + this.ondata(e, null, final); + } + }; + UnzipInflate.compression = 8; + return UnzipInflate; +}()); +export { UnzipInflate }; +/** + * Asynchronous streaming DEFLATE decompression for ZIP archives + */ +var AsyncUnzipInflate = /*#__PURE__*/ (function () { + /** + * Creates a DEFLATE decompression that can be used in ZIP archives + */ + function AsyncUnzipInflate(_, sz) { + var _this = this; + if (sz < 320000) { + this.i = new Inflate(function (dat, final) { + _this.ondata(null, dat, final); + }); + } + else { + this.i = new AsyncInflate(function (err, dat, final) { + _this.ondata(err, dat, final); + }); + this.terminate = this.i.terminate; + } + } + AsyncUnzipInflate.prototype.push = function (chunk, final) { + if (this.i.terminate) + chunk = slc(chunk, 0); + this.i.push(chunk, final); + }; + AsyncUnzipInflate.compression = 8; + return AsyncUnzipInflate; +}()); +export { AsyncUnzipInflate }; +/** + * A ZIP archive decompression stream that emits files as they are discovered + */ +var Unzip = /*#__PURE__*/ (function () { + /** + * Creates a ZIP decompression stream + * @param cb The callback to call whenever a file in the ZIP archive is found + */ + function Unzip(cb) { + this.onfile = cb; + this.k = []; + this.o = { + 0: UnzipPassThrough + }; + this.p = et; + } + /** + * Pushes a chunk to be unzipped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Unzip.prototype.push = function (chunk, final) { + var _this = this; + if (!this.onfile) + err(5); + if (!this.p) + err(4); + if (this.c > 0) { + var len = Math.min(this.c, chunk.length); + var toAdd = chunk.subarray(0, len); + this.c -= len; + if (this.d) + this.d.push(toAdd, !this.c); + else + this.k[0].push(toAdd); + chunk = chunk.subarray(len); + if (chunk.length) + return this.push(chunk, final); + } + else { + var f = 0, i = 0, is = void 0, buf = void 0; + if (!this.p.length) + buf = chunk; + else if (!chunk.length) + buf = this.p; + else { + buf = new u8(this.p.length + chunk.length); + buf.set(this.p), buf.set(chunk, this.p.length); + } + var l = buf.length, oc = this.c, add = oc && this.d; + var _loop_2 = function () { + var sig = b4(buf, i); + if (sig == 0x4034B50) { + f = 1, is = i; + this_1.d = null; + this_1.c = 0; + var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28); + if (l > i + 30 + fnl + es) { + var chks_3 = []; + this_1.k.unshift(chks_3); + f = 2; + var lsc = b4(buf, i + 18), lsu = b4(buf, i + 22); + var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u); + var _a = z64hs(buf, i, es, 2, lsc, lsu, 0), sc_1 = _a[0], su_1 = _a[1], z64 = _a[3]; + if (dd) + sc_1 = -1 - z64; + i += es; + this_1.c = sc_1; + var d_1; + var file_1 = { + name: fn_1, + compression: cmp_1, + start: function () { + if (!file_1.ondata) + err(5); + if (!sc_1) + file_1.ondata(null, et, true); + else { + var ctr = _this.o[cmp_1]; + if (!ctr) + file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false); + d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1); + d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); }; + for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) { + var dat = chks_4[_i]; + d_1.push(dat, false); + } + if (_this.k[0] == chks_3 && _this.c) + _this.d = d_1; + else + d_1.push(et, true); + } + }, + terminate: function () { + if (d_1 && d_1.terminate) + d_1.terminate(); + } + }; + if (sc_1 >= 0) + file_1.size = sc_1, file_1.originalSize = su_1; + this_1.onfile(file_1); + } + return "break"; + } + else if (oc) { + if (sig == 0x8074B50) { + is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0; + return "break"; + } + else if (sig == 0x2014B50) { + is = i -= 4, f = 3, this_1.c = 0; + return "break"; + } + } + }; + var this_1 = this; + for (; i < l - 4; ++i) { + var state_1 = _loop_2(); + if (state_1 === "break") + break; + } + this.p = et; + if (oc < 0) { + var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i); + if (add) + add.push(dat, !!f); + else + this.k[+(f == 2)].push(dat); + } + if (f & 2) + return this.push(buf.subarray(i), final); + this.p = buf.subarray(i); + } + if (final) { + if (this.c) + err(13); + this.p = null; + } + }; + /** + * Registers a decoder with the stream, allowing for files compressed with + * the compression type provided to be expanded correctly + * @param decoder The decoder constructor + */ + Unzip.prototype.register = function (decoder) { + this.o[decoder.compression] = decoder; + }; + return Unzip; +}()); +export { Unzip }; +var mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); }; +export function unzip(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + var term = []; + var tAll = function () { + for (var i = 0; i < term.length; ++i) + term[i](); + }; + var files = {}; + var cbd = function (a, b) { + mt(function () { cb(a, b); }); + }; + mt(function () { cbd = cb; }); + var e = data.length - 22; + for (; b4(data, e) != 0x6054B50; --e) { + if (!e || data.length - e > 65558) { + cbd(err(13, 0, 1), null); + return tAll; + } + } + ; + var lft = b2(data, e + 8); + if (lft) { + var c = lft; + var o = b4(data, e + 16); + var z = b4(data, e - 20) == 0x7064B50; + if (z) { + var ze = b4(data, e - 12); + z = b4(data, ze) == 0x6064B50; + if (z) { + c = lft = b4(data, ze + 32); + o = b4(data, ze + 48); + } + } + var fltr = opts && opts.filter; + var _loop_3 = function (i) { + var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off); + o = no; + var cbl = function (e, d) { + if (e) { + tAll(); + cbd(e, null); + } + else { + if (d) + files[fn] = d; + if (!--lft) + cbd(null, files); + } + }; + if (!fltr || fltr({ + name: fn, + size: sc, + originalSize: su, + compression: c_1 + })) { + if (!c_1) + cbl(null, slc(data, b, b + sc)); + else if (c_1 == 8) { + var infl = data.subarray(b, b + sc); + // Synchronously decompress under 512KB, or barely-compressed data + if (su < 524288 || sc > 0.8 * su) { + try { + cbl(null, inflateSync(infl, { out: new u8(su) })); + } + catch (e) { + cbl(e, null); + } + } + else + term.push(inflate(infl, { size: su }, cbl)); + } + else + cbl(err(14, 'unknown compression type ' + c_1, 1), null); + } + else + cbl(null, null); + }; + for (var i = 0; i < c; ++i) { + _loop_3(i); + } + } + else + cbd(null, {}); + return tAll; +} +/** + * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better + * performance with more than one file. + * @param data The raw compressed ZIP file + * @param opts The ZIP extraction options + * @returns The decompressed files + */ +export function unzipSync(data, opts) { + var files = {}; + var e = data.length - 22; + for (; b4(data, e) != 0x6054B50; --e) { + if (!e || data.length - e > 65558) + err(13); + } + ; + var c = b2(data, e + 8); + if (!c) + return {}; + var o = b4(data, e + 16); + var z = b4(data, e - 20) == 0x7064B50; + if (z) { + var ze = b4(data, e - 12); + z = b4(data, ze) == 0x6064B50; + if (z) { + c = b4(data, ze + 32); + o = b4(data, ze + 48); + } + } + var fltr = opts && opts.filter; + for (var i = 0; i < c; ++i) { + var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off); + o = no; + if (!fltr || fltr({ + name: fn, + size: sc, + originalSize: su, + compression: c_2 + })) { + if (!c_2) + files[fn] = slc(data, b, b + sc); + else if (c_2 == 8) + files[fn] = inflateSync(data.subarray(b, b + sc), { out: new u8(su) }); + else + err(14, 'unknown compression type ' + c_2); + } + } + return files; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/lib/browser.cjs b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/lib/browser.cjs new file mode 100644 index 0000000000000000000000000000000000000000..d3427caca233f968e8b3dc9c1a2d96e81abe42d3 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/lib/browser.cjs @@ -0,0 +1,2717 @@ +"use strict"; +// DEFLATE is a complex format; to read this code, you should probably check the RFC first: +// https://tools.ietf.org/html/rfc1951 +// You may also wish to take a look at the guide I made about this program: +// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad +exports.deflate = deflate; +exports.deflateSync = deflateSync; +exports.inflate = inflate; +exports.inflateSync = inflateSync; +exports.gzip = gzip; +exports.compress = gzip; +exports.gzipSync = gzipSync; +exports.compressSync = gzipSync; +exports.gunzip = gunzip; +exports.gunzipSync = gunzipSync; +exports.zlib = zlib; +exports.zlibSync = zlibSync; +exports.unzlib = unzlib; +exports.unzlibSync = unzlibSync; +exports.gzip = gzip; +exports.compress = gzip; +exports.decompress = decompress; +exports.decompressSync = decompressSync; +exports.strToU8 = strToU8; +exports.strFromU8 = strFromU8; +exports.zip = zip; +exports.zipSync = zipSync; +exports.unzip = unzip; +exports.unzipSync = unzipSync; +// Some of the following code is similar to that of UZIP.js: +// https://github.com/photopea/UZIP.js +// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size. +// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint +// is better for memory in most engines (I *think*). +var ch2 = {}; +var node_worker_1 = {}; +node_worker_1["default"] = (function (c, id, msg, transfer, cb) { + var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([ + c + ';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})' + ], { type: 'text/javascript' })))); + w.onmessage = function (e) { + var d = e.data, ed = d.$e$; + if (ed) { + var err = new Error(ed[0]); + err['code'] = ed[1]; + err.stack = ed[2]; + cb(err, null); + } + else + cb(null, d); + }; + w.postMessage(msg, transfer); + return w; +}); + +// aliases for shorter compressed code (most minifers don't do this) +var u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array; +// fixed length extra bits +var fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]); +// fixed distance extra bits +var fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, /* unused */ 0, 0]); +// code length index map +var clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]); +// get base, reverse index map from extra bits +var freb = function (eb, start) { + var b = new u16(31); + for (var i = 0; i < 31; ++i) { + b[i] = start += 1 << eb[i - 1]; + } + // numbers here are at max 18 bits + var r = new i32(b[30]); + for (var i = 1; i < 30; ++i) { + for (var j = b[i]; j < b[i + 1]; ++j) { + r[j] = ((j - b[i]) << 5) | i; + } + } + return { b: b, r: r }; +}; +var _a = freb(fleb, 2), fl = _a.b, revfl = _a.r; +// we can ignore the fact that the other numbers are wrong; they never happen anyway +fl[28] = 258, revfl[258] = 28; +var _b = freb(fdeb, 0), fd = _b.b, revfd = _b.r; +// map of value to reverse (assuming 16 bits) +var rev = new u16(32768); +for (var i = 0; i < 32768; ++i) { + // reverse table algorithm from SO + var x = ((i & 0xAAAA) >> 1) | ((i & 0x5555) << 1); + x = ((x & 0xCCCC) >> 2) | ((x & 0x3333) << 2); + x = ((x & 0xF0F0) >> 4) | ((x & 0x0F0F) << 4); + rev[i] = (((x & 0xFF00) >> 8) | ((x & 0x00FF) << 8)) >> 1; +} +// create huffman tree from u8 "map": index -> code length for code index +// mb (max bits) must be at most 15 +// TODO: optimize/split up? +var hMap = (function (cd, mb, r) { + var s = cd.length; + // index + var i = 0; + // u16 "map": index -> # of codes with bit length = index + var l = new u16(mb); + // length of cd must be 288 (total # of codes) + for (; i < s; ++i) { + if (cd[i]) + ++l[cd[i] - 1]; + } + // u16 "map": index -> minimum code for bit length = index + var le = new u16(mb); + for (i = 1; i < mb; ++i) { + le[i] = (le[i - 1] + l[i - 1]) << 1; + } + var co; + if (r) { + // u16 "map": index -> number of actual bits, symbol for code + co = new u16(1 << mb); + // bits to remove for reverser + var rvb = 15 - mb; + for (i = 0; i < s; ++i) { + // ignore 0 lengths + if (cd[i]) { + // num encoding both symbol and bits read + var sv = (i << 4) | cd[i]; + // free bits + var r_1 = mb - cd[i]; + // start value + var v = le[cd[i] - 1]++ << r_1; + // m is end value + for (var m = v | ((1 << r_1) - 1); v <= m; ++v) { + // every 16 bit value starting with the code yields the same result + co[rev[v] >> rvb] = sv; + } + } + } + } + else { + co = new u16(s); + for (i = 0; i < s; ++i) { + if (cd[i]) { + co[i] = rev[le[cd[i] - 1]++] >> (15 - cd[i]); + } + } + } + return co; +}); +// fixed length tree +var flt = new u8(288); +for (var i = 0; i < 144; ++i) + flt[i] = 8; +for (var i = 144; i < 256; ++i) + flt[i] = 9; +for (var i = 256; i < 280; ++i) + flt[i] = 7; +for (var i = 280; i < 288; ++i) + flt[i] = 8; +// fixed distance tree +var fdt = new u8(32); +for (var i = 0; i < 32; ++i) + fdt[i] = 5; +// fixed length map +var flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1); +// fixed distance map +var fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1); +// find max of array +var max = function (a) { + var m = a[0]; + for (var i = 1; i < a.length; ++i) { + if (a[i] > m) + m = a[i]; + } + return m; +}; +// read d, starting at bit p and mask with m +var bits = function (d, p, m) { + var o = (p / 8) | 0; + return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m; +}; +// read d, starting at bit p continuing for at least 16 bits +var bits16 = function (d, p) { + var o = (p / 8) | 0; + return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7)); +}; +// get end of byte +var shft = function (p) { return ((p + 7) / 8) | 0; }; +// typed array slice - allows garbage collector to free original reference, +// while being more compatible than .slice +var slc = function (v, s, e) { + if (s == null || s < 0) + s = 0; + if (e == null || e > v.length) + e = v.length; + // can't use .constructor in case user-supplied + return new u8(v.subarray(s, e)); +}; +/** + * Codes for errors generated within this library + */ +exports.FlateErrorCode = { + UnexpectedEOF: 0, + InvalidBlockType: 1, + InvalidLengthLiteral: 2, + InvalidDistance: 3, + StreamFinished: 4, + NoStreamHandler: 5, + InvalidHeader: 6, + NoCallback: 7, + InvalidUTF8: 8, + ExtraFieldTooLong: 9, + InvalidDate: 10, + FilenameTooLong: 11, + StreamFinishing: 12, + InvalidZipData: 13, + UnknownCompressionMethod: 14 +}; +// error codes +var ec = [ + 'unexpected EOF', + 'invalid block type', + 'invalid length/literal', + 'invalid distance', + 'stream finished', + 'no stream handler', + , // determined by compression function + 'no callback', + 'invalid UTF-8 data', + 'extra field too long', + 'date not in range 1980-2099', + 'filename too long', + 'stream finishing', + 'invalid zip data' + // determined by unknown compression method +]; +; +var err = function (ind, msg, nt) { + var e = new Error(msg || ec[ind]); + e.code = ind; + if (Error.captureStackTrace) + Error.captureStackTrace(e, err); + if (!nt) + throw e; + return e; +}; +// expands raw DEFLATE data +var inflt = function (dat, st, buf, dict) { + // source length dict length + var sl = dat.length, dl = dict ? dict.length : 0; + if (!sl || st.f && !st.l) + return buf || new u8(0); + var noBuf = !buf; + // have to estimate size + var resize = noBuf || st.i != 2; + // no state + var noSt = st.i; + // Assumes roughly 33% compression ratio average + if (noBuf) + buf = new u8(sl * 3); + // ensure buffer can fit at least l elements + var cbuf = function (l) { + var bl = buf.length; + // need to increase size to fit + if (l > bl) { + // Double or set to necessary, whichever is greater + var nbuf = new u8(Math.max(bl * 2, l)); + nbuf.set(buf); + buf = nbuf; + } + }; + // last chunk bitpos bytes + var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n; + // total bits + var tbts = sl * 8; + do { + if (!lm) { + // BFINAL - this is only 1 when last chunk is next + final = bits(dat, pos, 1); + // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman + var type = bits(dat, pos + 1, 3); + pos += 3; + if (!type) { + // go to end of byte boundary + var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l; + if (t > sl) { + if (noSt) + err(0); + break; + } + // ensure size + if (resize) + cbuf(bt + l); + // Copy over uncompressed data + buf.set(dat.subarray(s, t), bt); + // Get new bitpos, update byte count + st.b = bt += l, st.p = pos = t * 8, st.f = final; + continue; + } + else if (type == 1) + lm = flrm, dm = fdrm, lbt = 9, dbt = 5; + else if (type == 2) { + // literal lengths + var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4; + var tl = hLit + bits(dat, pos + 5, 31) + 1; + pos += 14; + // length+distance tree + var ldt = new u8(tl); + // code length tree + var clt = new u8(19); + for (var i = 0; i < hcLen; ++i) { + // use index map to get real code + clt[clim[i]] = bits(dat, pos + i * 3, 7); + } + pos += hcLen * 3; + // code lengths bits + var clb = max(clt), clbmsk = (1 << clb) - 1; + // code lengths map + var clm = hMap(clt, clb, 1); + for (var i = 0; i < tl;) { + var r = clm[bits(dat, pos, clbmsk)]; + // bits read + pos += r & 15; + // symbol + var s = r >> 4; + // code length to copy + if (s < 16) { + ldt[i++] = s; + } + else { + // copy count + var c = 0, n = 0; + if (s == 16) + n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1]; + else if (s == 17) + n = 3 + bits(dat, pos, 7), pos += 3; + else if (s == 18) + n = 11 + bits(dat, pos, 127), pos += 7; + while (n--) + ldt[i++] = c; + } + } + // length tree distance tree + var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit); + // max length bits + lbt = max(lt); + // max dist bits + dbt = max(dt); + lm = hMap(lt, lbt, 1); + dm = hMap(dt, dbt, 1); + } + else + err(1); + if (pos > tbts) { + if (noSt) + err(0); + break; + } + } + // Make sure the buffer can hold this + the largest possible addition + // Maximum chunk size (practically, theoretically infinite) is 2^17 + if (resize) + cbuf(bt + 131072); + var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1; + var lpos = pos; + for (;; lpos = pos) { + // bits read, code + var c = lm[bits16(dat, pos) & lms], sym = c >> 4; + pos += c & 15; + if (pos > tbts) { + if (noSt) + err(0); + break; + } + if (!c) + err(2); + if (sym < 256) + buf[bt++] = sym; + else if (sym == 256) { + lpos = pos, lm = null; + break; + } + else { + var add = sym - 254; + // no extra bits needed if less + if (sym > 264) { + // index + var i = sym - 257, b = fleb[i]; + add = bits(dat, pos, (1 << b) - 1) + fl[i]; + pos += b; + } + // dist + var d = dm[bits16(dat, pos) & dms], dsym = d >> 4; + if (!d) + err(3); + pos += d & 15; + var dt = fd[dsym]; + if (dsym > 3) { + var b = fdeb[dsym]; + dt += bits16(dat, pos) & (1 << b) - 1, pos += b; + } + if (pos > tbts) { + if (noSt) + err(0); + break; + } + if (resize) + cbuf(bt + 131072); + var end = bt + add; + if (bt < dt) { + var shift = dl - dt, dend = Math.min(dt, end); + if (shift + bt < 0) + err(3); + for (; bt < dend; ++bt) + buf[bt] = dict[shift + bt]; + } + for (; bt < end; ++bt) + buf[bt] = buf[bt - dt]; + } + } + st.l = lm, st.p = lpos, st.b = bt, st.f = final; + if (lm) + final = 1, st.m = lbt, st.d = dm, st.n = dbt; + } while (!final); + // don't reallocate for streams or user buffers + return bt != buf.length && noBuf ? slc(buf, 0, bt) : buf.subarray(0, bt); +}; +// starting at p, write the minimum number of bits that can hold v to d +var wbits = function (d, p, v) { + v <<= p & 7; + var o = (p / 8) | 0; + d[o] |= v; + d[o + 1] |= v >> 8; +}; +// starting at p, write the minimum number of bits (>8) that can hold v to d +var wbits16 = function (d, p, v) { + v <<= p & 7; + var o = (p / 8) | 0; + d[o] |= v; + d[o + 1] |= v >> 8; + d[o + 2] |= v >> 16; +}; +// creates code lengths from a frequency table +var hTree = function (d, mb) { + // Need extra info to make a tree + var t = []; + for (var i = 0; i < d.length; ++i) { + if (d[i]) + t.push({ s: i, f: d[i] }); + } + var s = t.length; + var t2 = t.slice(); + if (!s) + return { t: et, l: 0 }; + if (s == 1) { + var v = new u8(t[0].s + 1); + v[t[0].s] = 1; + return { t: v, l: 1 }; + } + t.sort(function (a, b) { return a.f - b.f; }); + // after i2 reaches last ind, will be stopped + // freq must be greater than largest possible number of symbols + t.push({ s: -1, f: 25001 }); + var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2; + t[0] = { s: -1, f: l.f + r.f, l: l, r: r }; + // efficient algorithm from UZIP.js + // i0 is lookbehind, i2 is lookahead - after processing two low-freq + // symbols that combined have high freq, will start processing i2 (high-freq, + // non-composite) symbols instead + // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/ + while (i1 != s - 1) { + l = t[t[i0].f < t[i2].f ? i0++ : i2++]; + r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++]; + t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r }; + } + var maxSym = t2[0].s; + for (var i = 1; i < s; ++i) { + if (t2[i].s > maxSym) + maxSym = t2[i].s; + } + // code lengths + var tr = new u16(maxSym + 1); + // max bits in tree + var mbt = ln(t[i1 - 1], tr, 0); + if (mbt > mb) { + // more algorithms from UZIP.js + // TODO: find out how this code works (debt) + // ind debt + var i = 0, dt = 0; + // left cost + var lft = mbt - mb, cst = 1 << lft; + t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; }); + for (; i < s; ++i) { + var i2_1 = t2[i].s; + if (tr[i2_1] > mb) { + dt += cst - (1 << (mbt - tr[i2_1])); + tr[i2_1] = mb; + } + else + break; + } + dt >>= lft; + while (dt > 0) { + var i2_2 = t2[i].s; + if (tr[i2_2] < mb) + dt -= 1 << (mb - tr[i2_2]++ - 1); + else + ++i; + } + for (; i >= 0 && dt; --i) { + var i2_3 = t2[i].s; + if (tr[i2_3] == mb) { + --tr[i2_3]; + ++dt; + } + } + mbt = mb; + } + return { t: new u8(tr), l: mbt }; +}; +// get the max length and assign length codes +var ln = function (n, l, d) { + return n.s == -1 + ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1)) + : (l[n.s] = d); +}; +// length codes generation +var lc = function (c) { + var s = c.length; + // Note that the semicolon was intentional + while (s && !c[--s]) + ; + var cl = new u16(++s); + // ind num streak + var cli = 0, cln = c[0], cls = 1; + var w = function (v) { cl[cli++] = v; }; + for (var i = 1; i <= s; ++i) { + if (c[i] == cln && i != s) + ++cls; + else { + if (!cln && cls > 2) { + for (; cls > 138; cls -= 138) + w(32754); + if (cls > 2) { + w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305); + cls = 0; + } + } + else if (cls > 3) { + w(cln), --cls; + for (; cls > 6; cls -= 6) + w(8304); + if (cls > 2) + w(((cls - 3) << 5) | 8208), cls = 0; + } + while (cls--) + w(cln); + cls = 1; + cln = c[i]; + } + } + return { c: cl.subarray(0, cli), n: s }; +}; +// calculate the length of output from tree, code lengths +var clen = function (cf, cl) { + var l = 0; + for (var i = 0; i < cl.length; ++i) + l += cf[i] * cl[i]; + return l; +}; +// writes a fixed block +// returns the new bit pos +var wfblk = function (out, pos, dat) { + // no need to write 00 as type: TypedArray defaults to 0 + var s = dat.length; + var o = shft(pos + 2); + out[o] = s & 255; + out[o + 1] = s >> 8; + out[o + 2] = out[o] ^ 255; + out[o + 3] = out[o + 1] ^ 255; + for (var i = 0; i < s; ++i) + out[o + i + 4] = dat[i]; + return (o + 4 + s) * 8; +}; +// writes a block +var wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) { + wbits(out, p++, final); + ++lf[256]; + var _a = hTree(lf, 15), dlt = _a.t, mlb = _a.l; + var _b = hTree(df, 15), ddt = _b.t, mdb = _b.l; + var _c = lc(dlt), lclt = _c.c, nlc = _c.n; + var _d = lc(ddt), lcdt = _d.c, ndc = _d.n; + var lcfreq = new u16(19); + for (var i = 0; i < lclt.length; ++i) + ++lcfreq[lclt[i] & 31]; + for (var i = 0; i < lcdt.length; ++i) + ++lcfreq[lcdt[i] & 31]; + var _e = hTree(lcfreq, 7), lct = _e.t, mlcb = _e.l; + var nlcc = 19; + for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc) + ; + var flen = (bl + 5) << 3; + var ftlen = clen(lf, flt) + clen(df, fdt) + eb; + var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + 2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]; + if (bs >= 0 && flen <= ftlen && flen <= dtlen) + return wfblk(out, p, dat.subarray(bs, bs + bl)); + var lm, ll, dm, dl; + wbits(out, p, 1 + (dtlen < ftlen)), p += 2; + if (dtlen < ftlen) { + lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt; + var llm = hMap(lct, mlcb, 0); + wbits(out, p, nlc - 257); + wbits(out, p + 5, ndc - 1); + wbits(out, p + 10, nlcc - 4); + p += 14; + for (var i = 0; i < nlcc; ++i) + wbits(out, p + 3 * i, lct[clim[i]]); + p += 3 * nlcc; + var lcts = [lclt, lcdt]; + for (var it = 0; it < 2; ++it) { + var clct = lcts[it]; + for (var i = 0; i < clct.length; ++i) { + var len = clct[i] & 31; + wbits(out, p, llm[len]), p += lct[len]; + if (len > 15) + wbits(out, p, (clct[i] >> 5) & 127), p += clct[i] >> 12; + } + } + } + else { + lm = flm, ll = flt, dm = fdm, dl = fdt; + } + for (var i = 0; i < li; ++i) { + var sym = syms[i]; + if (sym > 255) { + var len = (sym >> 18) & 31; + wbits16(out, p, lm[len + 257]), p += ll[len + 257]; + if (len > 7) + wbits(out, p, (sym >> 23) & 31), p += fleb[len]; + var dst = sym & 31; + wbits16(out, p, dm[dst]), p += dl[dst]; + if (dst > 3) + wbits16(out, p, (sym >> 5) & 8191), p += fdeb[dst]; + } + else { + wbits16(out, p, lm[sym]), p += ll[sym]; + } + } + wbits16(out, p, lm[256]); + return p + ll[256]; +}; +// deflate options (nice << 13) | chain +var deo = /*#__PURE__*/ new i32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]); +// empty +var et = /*#__PURE__*/ new u8(0); +// compresses data into a raw DEFLATE buffer +var dflt = function (dat, lvl, plvl, pre, post, st) { + var s = st.z || dat.length; + var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post); + // writing to this writes to the output buffer + var w = o.subarray(pre, o.length - post); + var lst = st.l; + var pos = (st.r || 0) & 7; + if (lvl) { + if (pos) + w[0] = st.r >> 3; + var opt = deo[lvl - 1]; + var n = opt >> 13, c = opt & 8191; + var msk_1 = (1 << plvl) - 1; + // prev 2-byte val map curr 2-byte val map + var prev = st.p || new u16(32768), head = st.h || new u16(msk_1 + 1); + var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1; + var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; }; + // 24576 is an arbitrary number of maximum symbols per block + // 424 buffer for last block + var syms = new i32(25000); + // length/literal freq distance freq + var lf = new u16(288), df = new u16(32); + // l/lcnt exbits index l/lind waitdx blkpos + var lc_1 = 0, eb = 0, i = st.i || 0, li = 0, wi = st.w || 0, bs = 0; + for (; i + 2 < s; ++i) { + // hash value + var hv = hsh(i); + // index mod 32768 previous index mod + var imod = i & 32767, pimod = head[hv]; + prev[imod] = pimod; + head[hv] = imod; + // We always should modify head and prev, but only add symbols if + // this data is not yet processed ("wait" for wait index) + if (wi <= i) { + // bytes remaining + var rem = s - i; + if ((lc_1 > 7000 || li > 24576) && (rem > 423 || !lst)) { + pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos); + li = lc_1 = eb = 0, bs = i; + for (var j = 0; j < 286; ++j) + lf[j] = 0; + for (var j = 0; j < 30; ++j) + df[j] = 0; + } + // len dist chain + var l = 2, d = 0, ch_1 = c, dif = imod - pimod & 32767; + if (rem > 2 && hv == hsh(i - dif)) { + var maxn = Math.min(n, rem) - 1; + var maxd = Math.min(32767, i); + // max possible length + // not capped at dif because decompressors implement "rolling" index population + var ml = Math.min(258, rem); + while (dif <= maxd && --ch_1 && imod != pimod) { + if (dat[i + l] == dat[i + l - dif]) { + var nl = 0; + for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl) + ; + if (nl > l) { + l = nl, d = dif; + // break out early when we reach "nice" (we are satisfied enough) + if (nl > maxn) + break; + // now, find the rarest 2-byte sequence within this + // length of literals and search for that instead. + // Much faster than just using the start + var mmd = Math.min(dif, nl - 2); + var md = 0; + for (var j = 0; j < mmd; ++j) { + var ti = i - dif + j & 32767; + var pti = prev[ti]; + var cd = ti - pti & 32767; + if (cd > md) + md = cd, pimod = ti; + } + } + } + // check the previous match + imod = pimod, pimod = prev[imod]; + dif += imod - pimod & 32767; + } + } + // d will be nonzero only when a match was found + if (d) { + // store both dist and len data in one int32 + // Make sure this is recognized as a len/dist with 28th bit (2^28) + syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d]; + var lin = revfl[l] & 31, din = revfd[d] & 31; + eb += fleb[lin] + fdeb[din]; + ++lf[257 + lin]; + ++df[din]; + wi = i + l; + ++lc_1; + } + else { + syms[li++] = dat[i]; + ++lf[dat[i]]; + } + } + } + for (i = Math.max(i, wi); i < s; ++i) { + syms[li++] = dat[i]; + ++lf[dat[i]]; + } + pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos); + if (!lst) { + st.r = (pos & 7) | w[(pos / 8) | 0] << 3; + // shft(pos) now 1 less if pos & 7 != 0 + pos -= 7; + st.h = head, st.p = prev, st.i = i, st.w = wi; + } + } + else { + for (var i = st.w || 0; i < s + lst; i += 65535) { + // end + var e = i + 65535; + if (e >= s) { + // write final block + w[(pos / 8) | 0] = lst; + e = s; + } + pos = wfblk(w, pos + 1, dat.subarray(i, e)); + } + st.i = s; + } + return slc(o, 0, pre + shft(pos) + post); +}; +// CRC32 table +var crct = /*#__PURE__*/ (function () { + var t = new Int32Array(256); + for (var i = 0; i < 256; ++i) { + var c = i, k = 9; + while (--k) + c = ((c & 1) && -306674912) ^ (c >>> 1); + t[i] = c; + } + return t; +})(); +// CRC32 +var crc = function () { + var c = -1; + return { + p: function (d) { + // closures have awful performance + var cr = c; + for (var i = 0; i < d.length; ++i) + cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8); + c = cr; + }, + d: function () { return ~c; } + }; +}; +// Adler32 +var adler = function () { + var a = 1, b = 0; + return { + p: function (d) { + // closures have awful performance + var n = a, m = b; + var l = d.length | 0; + for (var i = 0; i != l;) { + var e = Math.min(i + 2655, l); + for (; i < e; ++i) + m += n += d[i]; + n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16); + } + a = n, b = m; + }, + d: function () { + a %= 65521, b %= 65521; + return (a & 255) << 24 | (a & 0xFF00) << 8 | (b & 255) << 8 | (b >> 8); + } + }; +}; +; +// deflate with opts +var dopt = function (dat, opt, pre, post, st) { + if (!st) { + st = { l: 1 }; + if (opt.dictionary) { + var dict = opt.dictionary.subarray(-32768); + var newDat = new u8(dict.length + dat.length); + newDat.set(dict); + newDat.set(dat, dict.length); + dat = newDat; + st.w = dict.length; + } + } + return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? (st.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : 20) : (12 + opt.mem), pre, post, st); +}; +// Walmart object spread +var mrg = function (a, b) { + var o = {}; + for (var k in a) + o[k] = a[k]; + for (var k in b) + o[k] = b[k]; + return o; +}; +// worker clone +// This is possibly the craziest part of the entire codebase, despite how simple it may seem. +// The only parameter to this function is a closure that returns an array of variables outside of the function scope. +// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization. +// We will return an object mapping of true variable name to value (basically, the current scope as a JS object). +// The reason we can't just use the original variable names is minifiers mangling the toplevel scope. +// This took me three weeks to figure out how to do. +var wcln = function (fn, fnStr, td) { + var dt = fn(); + var st = fn.toString(); + var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/\s+/g, '').split(','); + for (var i = 0; i < dt.length; ++i) { + var v = dt[i], k = ks[i]; + if (typeof v == 'function') { + fnStr += ';' + k + '='; + var st_1 = v.toString(); + if (v.prototype) { + // for global objects + if (st_1.indexOf('[native code]') != -1) { + var spInd = st_1.indexOf(' ', 8) + 1; + fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd)); + } + else { + fnStr += st_1; + for (var t in v.prototype) + fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString(); + } + } + else + fnStr += st_1; + } + else + td[k] = v; + } + return fnStr; +}; +var ch = []; +// clone bufs +var cbfs = function (v) { + var tl = []; + for (var k in v) { + if (v[k].buffer) { + tl.push((v[k] = new v[k].constructor(v[k])).buffer); + } + } + return tl; +}; +// use a worker to execute code +var wrkr = function (fns, init, id, cb) { + if (!ch[id]) { + var fnStr = '', td_1 = {}, m = fns.length - 1; + for (var i = 0; i < m; ++i) + fnStr = wcln(fns[i], fnStr, td_1); + ch[id] = { c: wcln(fns[m], fnStr, td_1), e: td_1 }; + } + var td = mrg({}, ch[id].e); + return (0, node_worker_1.default)(ch[id].c + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb); +}; +// base async inflate fn +var bInflt = function () { return [u8, u16, i32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gopt]; }; +var bDflt = function () { return [u8, u16, i32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; }; +// gzip extra +var gze = function () { return [gzh, gzhl, wbytes, crc, crct]; }; +// gunzip extra +var guze = function () { return [gzs, gzl]; }; +// zlib extra +var zle = function () { return [zlh, wbytes, adler]; }; +// unzlib extra +var zule = function () { return [zls]; }; +// post buf +var pbf = function (msg) { return postMessage(msg, [msg.buffer]); }; +// get opts +var gopt = function (o) { return o && { + out: o.size && new u8(o.size), + dictionary: o.dictionary +}; }; +// async helper +var cbify = function (dat, opts, fns, init, id, cb) { + var w = wrkr(fns, init, id, function (err, dat) { + w.terminate(); + cb(err, dat); + }); + w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []); + return function () { w.terminate(); }; +}; +// auto stream +var astrm = function (strm) { + strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); }; + return function (ev) { + if (ev.data[0]) { + strm.push(ev.data[0], ev.data[1]); + postMessage([ev.data[0].length]); + } + else + strm.flush(ev.data[1]); + }; +}; +// async stream attach +var astrmify = function (fns, strm, opts, init, id, flush, ext) { + var t; + var w = wrkr(fns, init, id, function (err, dat) { + if (err) + w.terminate(), strm.ondata.call(strm, err); + else if (!Array.isArray(dat)) + ext(dat); + else if (dat.length == 1) { + strm.queuedSize -= dat[0]; + if (strm.ondrain) + strm.ondrain(dat[0]); + } + else { + if (dat[1]) + w.terminate(); + strm.ondata.call(strm, err, dat[0], dat[1]); + } + }); + w.postMessage(opts); + strm.queuedSize = 0; + strm.push = function (d, f) { + if (!strm.ondata) + err(5); + if (t) + strm.ondata(err(4, 0, 1), null, !!f); + strm.queuedSize += d.length; + // can fail for cross-realm Uint8Array, but ok - only a small performance penalty + w.postMessage([d, t = f], d.buffer instanceof ArrayBuffer ? [d.buffer] : []); + }; + strm.terminate = function () { w.terminate(); }; + if (flush) { + strm.flush = function (sync) { w.postMessage([0, sync]); }; + } +}; +// read 2 bytes +var b2 = function (d, b) { return d[b] | (d[b + 1] << 8); }; +// read 4 bytes +var b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; }; +// read 8 bytes +var b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); }; +// write bytes +var wbytes = function (d, b, v) { + for (; v; ++b) + d[b] = v, v >>>= 8; +}; +// gzip header +var gzh = function (c, o) { + var fn = o.filename; + c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix + if (o.mtime != 0) + wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000)); + if (fn) { + c[3] = 8; + for (var i = 0; i <= fn.length; ++i) + c[i + 10] = fn.charCodeAt(i); + } +}; +// gzip footer: -8 to -4 = CRC, -4 to -0 is length +// gzip start +var gzs = function (d) { + if (d[0] != 31 || d[1] != 139 || d[2] != 8) + err(6, 'invalid gzip data'); + var flg = d[3]; + var st = 10; + if (flg & 4) + st += (d[10] | d[11] << 8) + 2; + for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++]) + ; + return st + (flg & 2); +}; +// gzip length +var gzl = function (d) { + var l = d.length; + return (d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16 | d[l - 1] << 24) >>> 0; +}; +// gzip header length +var gzhl = function (o) { return 10 + (o.filename ? o.filename.length + 1 : 0); }; +// zlib header +var zlh = function (c, o) { + var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2; + c[0] = 120, c[1] = (fl << 6) | (o.dictionary && 32); + c[1] |= 31 - ((c[0] << 8) | c[1]) % 31; + if (o.dictionary) { + var h = adler(); + h.p(o.dictionary); + wbytes(c, 2, h.d()); + } +}; +// zlib start +var zls = function (d, dict) { + if ((d[0] & 15) != 8 || (d[0] >> 4) > 7 || ((d[0] << 8 | d[1]) % 31)) + err(6, 'invalid zlib data'); + if ((d[1] >> 5 & 1) == +!dict) + err(6, 'invalid zlib data: ' + (d[1] & 32 ? 'need' : 'unexpected') + ' dictionary'); + return (d[1] >> 3 & 4) + 2; +}; +function StrmOpt(opts, cb) { + if (typeof opts == 'function') + cb = opts, opts = {}; + this.ondata = cb; + return opts; +} +/** + * Streaming DEFLATE compression + */ +var Deflate = /*#__PURE__*/ (function () { + function Deflate(opts, cb) { + if (typeof opts == 'function') + cb = opts, opts = {}; + this.ondata = cb; + this.o = opts || {}; + this.s = { l: 0, i: 32768, w: 32768, z: 32768 }; + // Buffer length must always be 0 mod 32768 for index calculations to be correct when modifying head and prev + // 98304 = 32768 (lookback) + 65536 (common chunk size) + this.b = new u8(98304); + if (this.o.dictionary) { + var dict = this.o.dictionary.subarray(-32768); + this.b.set(dict, 32768 - dict.length); + this.s.i = 32768 - dict.length; + } + } + Deflate.prototype.p = function (c, f) { + this.ondata(dopt(c, this.o, 0, 0, this.s), f); + }; + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Deflate.prototype.push = function (chunk, final) { + if (!this.ondata) + err(5); + if (this.s.l) + err(4); + var endLen = chunk.length + this.s.z; + if (endLen > this.b.length) { + if (endLen > 2 * this.b.length - 32768) { + var newBuf = new u8(endLen & -32768); + newBuf.set(this.b.subarray(0, this.s.z)); + this.b = newBuf; + } + var split = this.b.length - this.s.z; + this.b.set(chunk.subarray(0, split), this.s.z); + this.s.z = this.b.length; + this.p(this.b, false); + this.b.set(this.b.subarray(-32768)); + this.b.set(chunk.subarray(split), 32768); + this.s.z = chunk.length - split + 32768; + this.s.i = 32766, this.s.w = 32768; + } + else { + this.b.set(chunk, this.s.z); + this.s.z += chunk.length; + } + this.s.l = final & 1; + if (this.s.z > this.s.w + 8191 || final) { + this.p(this.b, final || false); + this.s.w = this.s.i, this.s.i -= 2; + } + if (final) { + // cleanup unneeded buffers/state to reduce memory usage + this.s = this.o = {}; + this.b = et; + } + }; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * deflated output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. A separate DEFLATE stream may be concatenated + * with the current output after a sync flush. + */ + Deflate.prototype.flush = function (sync) { + if (!this.ondata) + err(5); + if (this.s.l) + err(4); + this.p(this.b, false); + this.s.w = this.s.i, this.s.i -= 2; + // could technically skip writing the type-0 block for (this.s.r & 7) == 0, + // but the deterministic trailer (00 00 FF FF) is useful in some situations + if (sync) { + var c = new u8(6); + c[0] = this.s.r >> 3; + // write empty, non-final type-0 block + var ep = wfblk(c, this.s.r, et); + this.s.r = 0; + this.ondata(c.subarray(0, ep >> 3), false); + } + }; + return Deflate; +}()); +exports.Deflate = Deflate; +/** + * Asynchronous streaming DEFLATE compression + */ +var AsyncDeflate = /*#__PURE__*/ (function () { + function AsyncDeflate(opts, cb) { + astrmify([ + bDflt, + function () { return [astrm, Deflate]; } + ], this, StrmOpt.call(this, opts, cb), function (ev) { + var strm = new Deflate(ev.data); + onmessage = astrm(strm); + }, 6, 1); + } + return AsyncDeflate; +}()); +exports.AsyncDeflate = AsyncDeflate; +function deflate(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return cbify(data, opts, [ + bDflt, + ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb); +} +/** + * Compresses data with DEFLATE without any wrapper + * @param data The data to compress + * @param opts The compression options + * @returns The deflated version of the data + */ +function deflateSync(data, opts) { + return dopt(data, opts || {}, 0, 0); +} +/** + * Streaming DEFLATE decompression + */ +var Inflate = /*#__PURE__*/ (function () { + function Inflate(opts, cb) { + // no StrmOpt here to avoid adding to workerizer + if (typeof opts == 'function') + cb = opts, opts = {}; + this.ondata = cb; + var dict = opts && opts.dictionary && opts.dictionary.subarray(-32768); + this.s = { i: 0, b: dict ? dict.length : 0 }; + this.o = new u8(32768); + this.p = new u8(0); + if (dict) + this.o.set(dict); + } + Inflate.prototype.e = function (c) { + if (!this.ondata) + err(5); + if (this.d) + err(4); + if (!this.p.length) + this.p = c; + else if (c.length) { + var n = new u8(this.p.length + c.length); + n.set(this.p), n.set(c, this.p.length), this.p = n; + } + }; + Inflate.prototype.c = function (final) { + this.s.i = +(this.d = final || false); + var bts = this.s.b; + var dt = inflt(this.p, this.s, this.o); + this.ondata(slc(dt, bts, this.s.b), this.d); + this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length; + this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7; + }; + /** + * Pushes a chunk to be inflated + * @param chunk The chunk to push + * @param final Whether this is the final chunk + */ + Inflate.prototype.push = function (chunk, final) { + this.e(chunk), this.c(final); + }; + return Inflate; +}()); +exports.Inflate = Inflate; +/** + * Asynchronous streaming DEFLATE decompression + */ +var AsyncInflate = /*#__PURE__*/ (function () { + function AsyncInflate(opts, cb) { + astrmify([ + bInflt, + function () { return [astrm, Inflate]; } + ], this, StrmOpt.call(this, opts, cb), function (ev) { + var strm = new Inflate(ev.data); + onmessage = astrm(strm); + }, 7, 0); + } + return AsyncInflate; +}()); +exports.AsyncInflate = AsyncInflate; +function inflate(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return cbify(data, opts, [ + bInflt + ], function (ev) { return pbf(inflateSync(ev.data[0], gopt(ev.data[1]))); }, 1, cb); +} +function inflateSync(data, opts) { + return inflt(data, { i: 2 }, opts && opts.out, opts && opts.dictionary); +} +// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize. +/** + * Streaming GZIP compression + */ +var Gzip = /*#__PURE__*/ (function () { + function Gzip(opts, cb) { + this.c = crc(); + this.l = 0; + this.v = 1; + Deflate.call(this, opts, cb); + } + /** + * Pushes a chunk to be GZIPped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Gzip.prototype.push = function (chunk, final) { + this.c.p(chunk); + this.l += chunk.length; + Deflate.prototype.push.call(this, chunk, final); + }; + Gzip.prototype.p = function (c, f) { + var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, this.s); + if (this.v) + gzh(raw, this.o), this.v = 0; + if (f) + wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l); + this.ondata(raw, f); + }; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * GZIPped output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. + */ + Gzip.prototype.flush = function (sync) { + Deflate.prototype.flush.call(this, sync); + }; + return Gzip; +}()); +exports.Gzip = Gzip; +exports.Compress = Gzip; +/** + * Asynchronous streaming GZIP compression + */ +var AsyncGzip = /*#__PURE__*/ (function () { + function AsyncGzip(opts, cb) { + astrmify([ + bDflt, + gze, + function () { return [astrm, Deflate, Gzip]; } + ], this, StrmOpt.call(this, opts, cb), function (ev) { + var strm = new Gzip(ev.data); + onmessage = astrm(strm); + }, 8, 1); + } + return AsyncGzip; +}()); +exports.AsyncGzip = AsyncGzip; +exports.AsyncCompress = AsyncGzip; +function gzip(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return cbify(data, opts, [ + bDflt, + gze, + function () { return [gzipSync]; } + ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb); +} +/** + * Compresses data with GZIP + * @param data The data to compress + * @param opts The compression options + * @returns The gzipped version of the data + */ +function gzipSync(data, opts) { + if (!opts) + opts = {}; + var c = crc(), l = data.length; + c.p(data); + var d = dopt(data, opts, gzhl(opts), 8), s = d.length; + return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d; +} +/** + * Streaming single or multi-member GZIP decompression + */ +var Gunzip = /*#__PURE__*/ (function () { + function Gunzip(opts, cb) { + this.v = 1; + this.r = 0; + Inflate.call(this, opts, cb); + } + /** + * Pushes a chunk to be GUNZIPped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Gunzip.prototype.push = function (chunk, final) { + Inflate.prototype.e.call(this, chunk); + this.r += chunk.length; + if (this.v) { + var p = this.p.subarray(this.v - 1); + var s = p.length > 3 ? gzs(p) : 4; + if (s > p.length) { + if (!final) + return; + } + else if (this.v > 1 && this.onmember) { + this.onmember(this.r - p.length); + } + this.p = p.subarray(s), this.v = 0; + } + // necessary to prevent TS from using the closure value + // This allows for workerization to function correctly + Inflate.prototype.c.call(this, 0); + // process concatenated GZIP + if (this.s.f && !this.s.l) { + this.v = shft(this.s.p) + 9; + this.s = { i: 0 }; + this.o = new u8(0); + this.push(new u8(0), final); + } + else if (final) { + Inflate.prototype.c.call(this, final); + } + }; + return Gunzip; +}()); +exports.Gunzip = Gunzip; +/** + * Asynchronous streaming single or multi-member GZIP decompression + */ +var AsyncGunzip = /*#__PURE__*/ (function () { + function AsyncGunzip(opts, cb) { + var _this = this; + astrmify([ + bInflt, + guze, + function () { return [astrm, Inflate, Gunzip]; } + ], this, StrmOpt.call(this, opts, cb), function (ev) { + var strm = new Gunzip(ev.data); + strm.onmember = function (offset) { return postMessage(offset); }; + onmessage = astrm(strm); + }, 9, 0, function (offset) { return _this.onmember && _this.onmember(offset); }); + } + return AsyncGunzip; +}()); +exports.AsyncGunzip = AsyncGunzip; +function gunzip(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return cbify(data, opts, [ + bInflt, + guze, + function () { return [gunzipSync]; } + ], function (ev) { return pbf(gunzipSync(ev.data[0], ev.data[1])); }, 3, cb); +} +function gunzipSync(data, opts) { + var st = gzs(data); + if (st + 8 > data.length) + err(6, 'invalid gzip data'); + return inflt(data.subarray(st, -8), { i: 2 }, opts && opts.out || new u8(gzl(data)), opts && opts.dictionary); +} +/** + * Streaming Zlib compression + */ +var Zlib = /*#__PURE__*/ (function () { + function Zlib(opts, cb) { + this.c = adler(); + this.v = 1; + Deflate.call(this, opts, cb); + } + /** + * Pushes a chunk to be zlibbed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Zlib.prototype.push = function (chunk, final) { + this.c.p(chunk); + Deflate.prototype.push.call(this, chunk, final); + }; + Zlib.prototype.p = function (c, f) { + var raw = dopt(c, this.o, this.v && (this.o.dictionary ? 6 : 2), f && 4, this.s); + if (this.v) + zlh(raw, this.o), this.v = 0; + if (f) + wbytes(raw, raw.length - 4, this.c.d()); + this.ondata(raw, f); + }; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * zlibbed output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. + */ + Zlib.prototype.flush = function (sync) { + Deflate.prototype.flush.call(this, sync); + }; + return Zlib; +}()); +exports.Zlib = Zlib; +/** + * Asynchronous streaming Zlib compression + */ +var AsyncZlib = /*#__PURE__*/ (function () { + function AsyncZlib(opts, cb) { + astrmify([ + bDflt, + zle, + function () { return [astrm, Deflate, Zlib]; } + ], this, StrmOpt.call(this, opts, cb), function (ev) { + var strm = new Zlib(ev.data); + onmessage = astrm(strm); + }, 10, 1); + } + return AsyncZlib; +}()); +exports.AsyncZlib = AsyncZlib; +function zlib(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return cbify(data, opts, [ + bDflt, + zle, + function () { return [zlibSync]; } + ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb); +} +/** + * Compress data with Zlib + * @param data The data to compress + * @param opts The compression options + * @returns The zlib-compressed version of the data + */ +function zlibSync(data, opts) { + if (!opts) + opts = {}; + var a = adler(); + a.p(data); + var d = dopt(data, opts, opts.dictionary ? 6 : 2, 4); + return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d; +} +/** + * Streaming Zlib decompression + */ +var Unzlib = /*#__PURE__*/ (function () { + function Unzlib(opts, cb) { + Inflate.call(this, opts, cb); + this.v = opts && opts.dictionary ? 2 : 1; + } + /** + * Pushes a chunk to be unzlibbed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Unzlib.prototype.push = function (chunk, final) { + Inflate.prototype.e.call(this, chunk); + if (this.v) { + if (this.p.length < 6 && !final) + return; + this.p = this.p.subarray(zls(this.p, this.v - 1)), this.v = 0; + } + if (final) { + if (this.p.length < 4) + err(6, 'invalid zlib data'); + this.p = this.p.subarray(0, -4); + } + // necessary to prevent TS from using the closure value + // This allows for workerization to function correctly + Inflate.prototype.c.call(this, final); + }; + return Unzlib; +}()); +exports.Unzlib = Unzlib; +/** + * Asynchronous streaming Zlib decompression + */ +var AsyncUnzlib = /*#__PURE__*/ (function () { + function AsyncUnzlib(opts, cb) { + astrmify([ + bInflt, + zule, + function () { return [astrm, Inflate, Unzlib]; } + ], this, StrmOpt.call(this, opts, cb), function (ev) { + var strm = new Unzlib(ev.data); + onmessage = astrm(strm); + }, 11, 0); + } + return AsyncUnzlib; +}()); +exports.AsyncUnzlib = AsyncUnzlib; +function unzlib(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return cbify(data, opts, [ + bInflt, + zule, + function () { return [unzlibSync]; } + ], function (ev) { return pbf(unzlibSync(ev.data[0], gopt(ev.data[1]))); }, 5, cb); +} +function unzlibSync(data, opts) { + return inflt(data.subarray(zls(data, opts && opts.dictionary), -4), { i: 2 }, opts && opts.out, opts && opts.dictionary); +} +/** + * Streaming GZIP, Zlib, or raw DEFLATE decompression + */ +var Decompress = /*#__PURE__*/ (function () { + function Decompress(opts, cb) { + this.o = StrmOpt.call(this, opts, cb) || {}; + this.G = Gunzip; + this.I = Inflate; + this.Z = Unzlib; + } + // init substream + // overriden by AsyncDecompress + Decompress.prototype.i = function () { + var _this = this; + this.s.ondata = function (dat, final) { + _this.ondata(dat, final); + }; + }; + /** + * Pushes a chunk to be decompressed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Decompress.prototype.push = function (chunk, final) { + if (!this.ondata) + err(5); + if (!this.s) { + if (this.p && this.p.length) { + var n = new u8(this.p.length + chunk.length); + n.set(this.p), n.set(chunk, this.p.length); + } + else + this.p = chunk; + if (this.p.length > 2) { + this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8) + ? new this.G(this.o) + : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31)) + ? new this.I(this.o) + : new this.Z(this.o); + this.i(); + this.s.push(this.p, final); + this.p = null; + } + } + else + this.s.push(chunk, final); + }; + return Decompress; +}()); +exports.Decompress = Decompress; +/** + * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression + */ +var AsyncDecompress = /*#__PURE__*/ (function () { + function AsyncDecompress(opts, cb) { + Decompress.call(this, opts, cb); + this.queuedSize = 0; + this.G = AsyncGunzip; + this.I = AsyncInflate; + this.Z = AsyncUnzlib; + } + AsyncDecompress.prototype.i = function () { + var _this = this; + this.s.ondata = function (err, dat, final) { + _this.ondata(err, dat, final); + }; + this.s.ondrain = function (size) { + _this.queuedSize -= size; + if (_this.ondrain) + _this.ondrain(size); + }; + }; + /** + * Pushes a chunk to be decompressed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + AsyncDecompress.prototype.push = function (chunk, final) { + this.queuedSize += chunk.length; + Decompress.prototype.push.call(this, chunk, final); + }; + return AsyncDecompress; +}()); +exports.AsyncDecompress = AsyncDecompress; +function decompress(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return (data[0] == 31 && data[1] == 139 && data[2] == 8) + ? gunzip(data, opts, cb) + : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31)) + ? inflate(data, opts, cb) + : unzlib(data, opts, cb); +} +/** + * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format + * @param data The data to decompress + * @param opts The decompression options + * @returns The decompressed version of the data + */ +function decompressSync(data, opts) { + return (data[0] == 31 && data[1] == 139 && data[2] == 8) + ? gunzipSync(data, opts) + : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31)) + ? inflateSync(data, opts) + : unzlibSync(data, opts); +} +// flatten a directory structure +var fltn = function (d, p, t, o) { + for (var k in d) { + var val = d[k], n = p + k, op = o; + if (Array.isArray(val)) + op = mrg(o, val[1]), val = val[0]; + if (ArrayBuffer.isView(val)) + t[n] = [val, op]; + else { + t[n += '/'] = [new u8(0), op]; + fltn(val, n, t, o); + } + } +}; +// text encoder +var te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder(); +// text decoder +var td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder(); +// text decoder stream +var tds = 0; +try { + td.decode(et, { stream: true }); + tds = 1; +} +catch (e) { } +// decode UTF8 +var dutf8 = function (d) { + for (var r = '', i = 0;;) { + var c = d[i++]; + var eb = (c > 127) + (c > 223) + (c > 239); + if (i + eb > d.length) + return { s: r, r: slc(d, i - 1) }; + if (!eb) + r += String.fromCharCode(c); + else if (eb == 3) { + c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536, + r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023)); + } + else if (eb & 1) + r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63)); + else + r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)); + } +}; +/** + * Streaming UTF-8 decoding + */ +var DecodeUTF8 = /*#__PURE__*/ (function () { + /** + * Creates a UTF-8 decoding stream + * @param cb The callback to call whenever data is decoded + */ + function DecodeUTF8(cb) { + this.ondata = cb; + if (tds) + this.t = new TextDecoder(); + else + this.p = et; + } + /** + * Pushes a chunk to be decoded from UTF-8 binary + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + DecodeUTF8.prototype.push = function (chunk, final) { + if (!this.ondata) + err(5); + final = !!final; + if (this.t) { + this.ondata(this.t.decode(chunk, { stream: true }), final); + if (final) { + if (this.t.decode().length) + err(8); + this.t = null; + } + return; + } + if (!this.p) + err(4); + var dat = new u8(this.p.length + chunk.length); + dat.set(this.p); + dat.set(chunk, this.p.length); + var _a = dutf8(dat), s = _a.s, r = _a.r; + if (final) { + if (r.length) + err(8); + this.p = null; + } + else + this.p = r; + this.ondata(s, final); + }; + return DecodeUTF8; +}()); +exports.DecodeUTF8 = DecodeUTF8; +/** + * Streaming UTF-8 encoding + */ +var EncodeUTF8 = /*#__PURE__*/ (function () { + /** + * Creates a UTF-8 decoding stream + * @param cb The callback to call whenever data is encoded + */ + function EncodeUTF8(cb) { + this.ondata = cb; + } + /** + * Pushes a chunk to be encoded to UTF-8 + * @param chunk The string data to push + * @param final Whether this is the last chunk + */ + EncodeUTF8.prototype.push = function (chunk, final) { + if (!this.ondata) + err(5); + if (this.d) + err(4); + this.ondata(strToU8(chunk), this.d = final || false); + }; + return EncodeUTF8; +}()); +exports.EncodeUTF8 = EncodeUTF8; +/** + * Converts a string into a Uint8Array for use with compression/decompression methods + * @param str The string to encode + * @param latin1 Whether or not to interpret the data as Latin-1. This should + * not need to be true unless decoding a binary string. + * @returns The string encoded in UTF-8/Latin-1 binary + */ +function strToU8(str, latin1) { + if (latin1) { + var ar_1 = new u8(str.length); + for (var i = 0; i < str.length; ++i) + ar_1[i] = str.charCodeAt(i); + return ar_1; + } + if (te) + return te.encode(str); + var l = str.length; + var ar = new u8(str.length + (str.length >> 1)); + var ai = 0; + var w = function (v) { ar[ai++] = v; }; + for (var i = 0; i < l; ++i) { + if (ai + 5 > ar.length) { + var n = new u8(ai + 8 + ((l - i) << 1)); + n.set(ar); + ar = n; + } + var c = str.charCodeAt(i); + if (c < 128 || latin1) + w(c); + else if (c < 2048) + w(192 | (c >> 6)), w(128 | (c & 63)); + else if (c > 55295 && c < 57344) + c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023), + w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63)); + else + w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63)); + } + return slc(ar, 0, ai); +} +/** + * Converts a Uint8Array to a string + * @param dat The data to decode to string + * @param latin1 Whether or not to interpret the data as Latin-1. This should + * not need to be true unless encoding to binary string. + * @returns The original UTF-8/Latin-1 string + */ +function strFromU8(dat, latin1) { + if (latin1) { + var r = ''; + for (var i = 0; i < dat.length; i += 16384) + r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384)); + return r; + } + else if (td) { + return td.decode(dat); + } + else { + var _a = dutf8(dat), s = _a.s, r = _a.r; + if (r.length) + err(8); + return s; + } +} +; +// deflate bit flag +var dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; }; +// skip local zip header +var slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); }; +// read zip header +var zh = function (d, b, z) { + var fnl = b2(d, b + 28), efl = b2(d, b + 30), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl; + var _a = z64hs(d, es, efl, z, b4(d, b + 20), b4(d, b + 24), b4(d, b + 42)), sc = _a[0], su = _a[1], off = _a[2]; + return [b2(d, b + 10), sc, su, fn, es + efl + b2(d, b + 32), off]; +}; +// read zip64 header sizes +var z64hs = function (d, b, l, z, sc, su, off) { + var nsc = sc == 4294967295, nsu = su == 4294967295, noff = off == 4294967295, e = b + l; + var nf = nsc + nsu + noff; + if (z && nf) { + for (; b + 4 < e; b += 4 + b2(d, b + 2)) { + if (b2(d, b) == 1) { + return [ + nsc ? b8(d, b + 4 + 8 * nsu) : sc, + nsu ? b8(d, b + 4) : su, + noff ? b8(d, b + 4 + 8 * (nsu + nsc)) : off, + 1 + ]; + } + } + // z == 2 for unknown whether or not zip64 + if (z < 2) + err(13); + } + return [sc, su, off, 0]; +}; +// extra field length +var exfl = function (ex) { + var le = 0; + if (ex) { + for (var k in ex) { + var l = ex[k].length; + if (l > 65535) + err(9); + le += l + 4; + } + } + return le; +}; +// write zip header +var wzh = function (d, b, f, fn, u, c, ce, co) { + var fl = fn.length, ex = f.extra, col = co && co.length; + var exl = exfl(ex); + wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4; + if (ce != null) + d[b++] = 20, d[b++] = f.os; + d[b] = 20, b += 2; // spec compliance? what's that? + d[b++] = (f.flag << 1) | (c < 0 && 8), d[b++] = u && 8; + d[b++] = f.compression & 255, d[b++] = f.compression >> 8; + var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980; + if (y < 0 || y > 119) + err(10); + wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >> 1)), b += 4; + if (c != -1) { + wbytes(d, b, f.crc); + wbytes(d, b + 4, c < 0 ? -c - 2 : c); + wbytes(d, b + 8, f.size); + } + wbytes(d, b + 12, fl); + wbytes(d, b + 14, exl), b += 16; + if (ce != null) { + wbytes(d, b, col); + wbytes(d, b + 6, f.attrs); + wbytes(d, b + 10, ce), b += 14; + } + d.set(fn, b); + b += fl; + if (exl) { + for (var k in ex) { + var exf = ex[k], l = exf.length; + wbytes(d, b, +k); + wbytes(d, b + 2, l); + d.set(exf, b + 4), b += 4 + l; + } + } + if (col) + d.set(co, b), b += col; + return b; +}; +// write zip footer (end of central directory) +var wzf = function (o, b, c, d, e) { + wbytes(o, b, 0x6054B50); // skip disk + wbytes(o, b + 8, c); + wbytes(o, b + 10, c); + wbytes(o, b + 12, d); + wbytes(o, b + 16, e); +}; +/** + * A pass-through stream to keep data uncompressed in a ZIP archive. + */ +var ZipPassThrough = /*#__PURE__*/ (function () { + /** + * Creates a pass-through stream that can be added to ZIP archives + * @param filename The filename to associate with this data stream + */ + function ZipPassThrough(filename) { + this.filename = filename; + this.c = crc(); + this.size = 0; + this.compression = 0; + } + /** + * Processes a chunk and pushes to the output stream. You can override this + * method in a subclass for custom behavior, but by default this passes + * the data through. You must call this.ondata(err, chunk, final) at some + * point in this method. + * @param chunk The chunk to process + * @param final Whether this is the last chunk + */ + ZipPassThrough.prototype.process = function (chunk, final) { + this.ondata(null, chunk, final); + }; + /** + * Pushes a chunk to be added. If you are subclassing this with a custom + * compression algorithm, note that you must push data from the source + * file only, pre-compression. + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + ZipPassThrough.prototype.push = function (chunk, final) { + if (!this.ondata) + err(5); + this.c.p(chunk); + this.size += chunk.length; + if (final) + this.crc = this.c.d(); + // we shouldn't really do this cast, but properly handling ArrayBufferLike + // makes the API unergonomic with Buffer + this.process(chunk, final || false); + }; + return ZipPassThrough; +}()); +exports.ZipPassThrough = ZipPassThrough; +// I don't extend because TypeScript extension adds 1kB of runtime bloat +/** + * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate + * for better performance + */ +var ZipDeflate = /*#__PURE__*/ (function () { + /** + * Creates a DEFLATE stream that can be added to ZIP archives + * @param filename The filename to associate with this data stream + * @param opts The compression options + */ + function ZipDeflate(filename, opts) { + var _this = this; + if (!opts) + opts = {}; + ZipPassThrough.call(this, filename); + this.d = new Deflate(opts, function (dat, final) { + _this.ondata(null, dat, final); + }); + this.compression = 8; + this.flag = dbf(opts.level); + } + ZipDeflate.prototype.process = function (chunk, final) { + try { + this.d.push(chunk, final); + } + catch (e) { + this.ondata(e, null, final); + } + }; + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + ZipDeflate.prototype.push = function (chunk, final) { + ZipPassThrough.prototype.push.call(this, chunk, final); + }; + return ZipDeflate; +}()); +exports.ZipDeflate = ZipDeflate; +/** + * Asynchronous streaming DEFLATE compression for ZIP archives + */ +var AsyncZipDeflate = /*#__PURE__*/ (function () { + /** + * Creates an asynchronous DEFLATE stream that can be added to ZIP archives + * @param filename The filename to associate with this data stream + * @param opts The compression options + */ + function AsyncZipDeflate(filename, opts) { + var _this = this; + if (!opts) + opts = {}; + ZipPassThrough.call(this, filename); + this.d = new AsyncDeflate(opts, function (err, dat, final) { + _this.ondata(err, dat, final); + }); + this.compression = 8; + this.flag = dbf(opts.level); + this.terminate = this.d.terminate; + } + AsyncZipDeflate.prototype.process = function (chunk, final) { + this.d.push(chunk, final); + }; + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + AsyncZipDeflate.prototype.push = function (chunk, final) { + ZipPassThrough.prototype.push.call(this, chunk, final); + }; + return AsyncZipDeflate; +}()); +exports.AsyncZipDeflate = AsyncZipDeflate; +// TODO: Better tree shaking +/** + * A zippable archive to which files can incrementally be added + */ +var Zip = /*#__PURE__*/ (function () { + /** + * Creates an empty ZIP archive to which files can be added + * @param cb The callback to call whenever data for the generated ZIP archive + * is available + */ + function Zip(cb) { + this.ondata = cb; + this.u = []; + this.d = 1; + } + /** + * Adds a file to the ZIP archive + * @param file The file stream to add + */ + Zip.prototype.add = function (file) { + var _this = this; + if (!this.ondata) + err(5); + // finishing or finished + if (this.d & 2) + this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false); + else { + var f = strToU8(file.filename), fl_1 = f.length; + var com = file.comment, o = com && strToU8(com); + var u = fl_1 != file.filename.length || (o && (com.length != o.length)); + var hl_1 = fl_1 + exfl(file.extra) + 30; + if (fl_1 > 65535) + this.ondata(err(11, 0, 1), null, false); + var header = new u8(hl_1); + wzh(header, 0, file, f, u, -1); + var chks_1 = [header]; + var pAll_1 = function () { + for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) { + var chk = chks_2[_i]; + _this.ondata(null, chk, false); + } + chks_1 = []; + }; + var tr_1 = this.d; + this.d = 0; + var ind_1 = this.u.length; + var uf_1 = mrg(file, { + f: f, + u: u, + o: o, + t: function () { + if (file.terminate) + file.terminate(); + }, + r: function () { + pAll_1(); + if (tr_1) { + var nxt = _this.u[ind_1 + 1]; + if (nxt) + nxt.r(); + else + _this.d = 1; + } + tr_1 = 1; + } + }); + var cl_1 = 0; + file.ondata = function (err, dat, final) { + if (err) { + _this.ondata(err, dat, final); + _this.terminate(); + } + else { + cl_1 += dat.length; + chks_1.push(dat); + if (final) { + var dd = new u8(16); + wbytes(dd, 0, 0x8074B50); + wbytes(dd, 4, file.crc); + wbytes(dd, 8, cl_1); + wbytes(dd, 12, file.size); + chks_1.push(dd); + uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size; + if (tr_1) + uf_1.r(); + tr_1 = 1; + } + else if (tr_1) + pAll_1(); + } + }; + this.u.push(uf_1); + } + }; + /** + * Ends the process of adding files and prepares to emit the final chunks. + * This *must* be called after adding all desired files for the resulting + * ZIP file to work properly. + */ + Zip.prototype.end = function () { + var _this = this; + if (this.d & 2) { + this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true); + return; + } + if (this.d) + this.e(); + else + this.u.push({ + r: function () { + if (!(_this.d & 1)) + return; + _this.u.splice(-1, 1); + _this.e(); + }, + t: function () { } + }); + this.d = 3; + }; + Zip.prototype.e = function () { + var bt = 0, l = 0, tl = 0; + for (var _i = 0, _a = this.u; _i < _a.length; _i++) { + var f = _a[_i]; + tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0); + } + var out = new u8(tl + 22); + for (var _b = 0, _c = this.u; _b < _c.length; _b++) { + var f = _c[_b]; + wzh(out, bt, f, f.f, f.u, -f.c - 2, l, f.o); + bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b; + } + wzf(out, bt, this.u.length, tl, l); + this.ondata(null, out, true); + this.d = 2; + }; + /** + * A method to terminate any internal workers used by the stream. Subsequent + * calls to add() will fail. + */ + Zip.prototype.terminate = function () { + for (var _i = 0, _a = this.u; _i < _a.length; _i++) { + var f = _a[_i]; + f.t(); + } + this.d = 2; + }; + return Zip; +}()); +exports.Zip = Zip; +function zip(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + var r = {}; + fltn(data, '', r, opts); + var k = Object.keys(r); + var lft = k.length, o = 0, tot = 0; + var slft = lft, files = new Array(lft); + var term = []; + var tAll = function () { + for (var i = 0; i < term.length; ++i) + term[i](); + }; + var cbd = function (a, b) { + mt(function () { cb(a, b); }); + }; + mt(function () { cbd = cb; }); + var cbf = function () { + var out = new u8(tot + 22), oe = o, cdl = tot - o; + tot = 0; + for (var i = 0; i < slft; ++i) { + var f = files[i]; + try { + var l = f.c.length; + wzh(out, tot, f, f.f, f.u, l); + var badd = 30 + f.f.length + exfl(f.extra); + var loc = tot + badd; + out.set(f.c, loc); + wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l; + } + catch (e) { + return cbd(e, null); + } + } + wzf(out, o, files.length, cdl, oe); + cbd(null, out); + }; + if (!lft) + cbf(); + var _loop_1 = function (i) { + var fn = k[i]; + var _a = r[fn], file = _a[0], p = _a[1]; + var c = crc(), size = file.length; + c.p(file); + var f = strToU8(fn), s = f.length; + var com = p.comment, m = com && strToU8(com), ms = m && m.length; + var exl = exfl(p.extra); + var compression = p.level == 0 ? 0 : 8; + var cbl = function (e, d) { + if (e) { + tAll(); + cbd(e, null); + } + else { + var l = d.length; + files[i] = mrg(p, { + size: size, + crc: c.d(), + c: d, + f: f, + m: m, + u: s != fn.length || (m && (com.length != ms)), + compression: compression + }); + o += 30 + s + exl + l; + tot += 76 + 2 * (s + exl) + (ms || 0) + l; + if (!--lft) + cbf(); + } + }; + if (s > 65535) + cbl(err(11, 0, 1), null); + if (!compression) + cbl(null, file); + else if (size < 160000) { + try { + cbl(null, deflateSync(file, p)); + } + catch (e) { + cbl(e, null); + } + } + else + term.push(deflate(file, p, cbl)); + }; + // Cannot use lft because it can decrease + for (var i = 0; i < slft; ++i) { + _loop_1(i); + } + return tAll; +} +/** + * Synchronously creates a ZIP file. Prefer using `zip` for better performance + * with more than one file. + * @param data The directory structure for the ZIP archive + * @param opts The main options, merged with per-file options + * @returns The generated ZIP archive + */ +function zipSync(data, opts) { + if (!opts) + opts = {}; + var r = {}; + var files = []; + fltn(data, '', r, opts); + var o = 0; + var tot = 0; + for (var fn in r) { + var _a = r[fn], file = _a[0], p = _a[1]; + var compression = p.level == 0 ? 0 : 8; + var f = strToU8(fn), s = f.length; + var com = p.comment, m = com && strToU8(com), ms = m && m.length; + var exl = exfl(p.extra); + if (s > 65535) + err(11); + var d = compression ? deflateSync(file, p) : file, l = d.length; + var c = crc(); + c.p(file); + files.push(mrg(p, { + size: file.length, + crc: c.d(), + c: d, + f: f, + m: m, + u: s != fn.length || (m && (com.length != ms)), + o: o, + compression: compression + })); + o += 30 + s + exl + l; + tot += 76 + 2 * (s + exl) + (ms || 0) + l; + } + var out = new u8(tot + 22), oe = o, cdl = tot - o; + for (var i = 0; i < files.length; ++i) { + var f = files[i]; + wzh(out, f.o, f, f.f, f.u, f.c.length); + var badd = 30 + f.f.length + exfl(f.extra); + out.set(f.c, f.o + badd); + wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0); + } + wzf(out, o, files.length, cdl, oe); + return out; +} +/** + * Streaming pass-through decompression for ZIP archives + */ +var UnzipPassThrough = /*#__PURE__*/ (function () { + function UnzipPassThrough() { + } + UnzipPassThrough.prototype.push = function (chunk, final) { + // same as ZipPassThrough: cast to retain Buffer ergonomics + this.ondata(null, chunk, final); + }; + UnzipPassThrough.compression = 0; + return UnzipPassThrough; +}()); +exports.UnzipPassThrough = UnzipPassThrough; +/** + * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for + * better performance. + */ +var UnzipInflate = /*#__PURE__*/ (function () { + /** + * Creates a DEFLATE decompression that can be used in ZIP archives + */ + function UnzipInflate() { + var _this = this; + this.i = new Inflate(function (dat, final) { + _this.ondata(null, dat, final); + }); + } + UnzipInflate.prototype.push = function (chunk, final) { + try { + this.i.push(chunk, final); + } + catch (e) { + this.ondata(e, null, final); + } + }; + UnzipInflate.compression = 8; + return UnzipInflate; +}()); +exports.UnzipInflate = UnzipInflate; +/** + * Asynchronous streaming DEFLATE decompression for ZIP archives + */ +var AsyncUnzipInflate = /*#__PURE__*/ (function () { + /** + * Creates a DEFLATE decompression that can be used in ZIP archives + */ + function AsyncUnzipInflate(_, sz) { + var _this = this; + if (sz < 320000) { + this.i = new Inflate(function (dat, final) { + _this.ondata(null, dat, final); + }); + } + else { + this.i = new AsyncInflate(function (err, dat, final) { + _this.ondata(err, dat, final); + }); + this.terminate = this.i.terminate; + } + } + AsyncUnzipInflate.prototype.push = function (chunk, final) { + if (this.i.terminate) + chunk = slc(chunk, 0); + this.i.push(chunk, final); + }; + AsyncUnzipInflate.compression = 8; + return AsyncUnzipInflate; +}()); +exports.AsyncUnzipInflate = AsyncUnzipInflate; +/** + * A ZIP archive decompression stream that emits files as they are discovered + */ +var Unzip = /*#__PURE__*/ (function () { + /** + * Creates a ZIP decompression stream + * @param cb The callback to call whenever a file in the ZIP archive is found + */ + function Unzip(cb) { + this.onfile = cb; + this.k = []; + this.o = { + 0: UnzipPassThrough + }; + this.p = et; + } + /** + * Pushes a chunk to be unzipped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Unzip.prototype.push = function (chunk, final) { + var _this = this; + if (!this.onfile) + err(5); + if (!this.p) + err(4); + if (this.c > 0) { + var len = Math.min(this.c, chunk.length); + var toAdd = chunk.subarray(0, len); + this.c -= len; + if (this.d) + this.d.push(toAdd, !this.c); + else + this.k[0].push(toAdd); + chunk = chunk.subarray(len); + if (chunk.length) + return this.push(chunk, final); + } + else { + var f = 0, i = 0, is = void 0, buf = void 0; + if (!this.p.length) + buf = chunk; + else if (!chunk.length) + buf = this.p; + else { + buf = new u8(this.p.length + chunk.length); + buf.set(this.p), buf.set(chunk, this.p.length); + } + var l = buf.length, oc = this.c, add = oc && this.d; + var _loop_2 = function () { + var sig = b4(buf, i); + if (sig == 0x4034B50) { + f = 1, is = i; + this_1.d = null; + this_1.c = 0; + var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28); + if (l > i + 30 + fnl + es) { + var chks_3 = []; + this_1.k.unshift(chks_3); + f = 2; + var lsc = b4(buf, i + 18), lsu = b4(buf, i + 22); + var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u); + var _a = z64hs(buf, i, es, 2, lsc, lsu, 0), sc_1 = _a[0], su_1 = _a[1], z64 = _a[3]; + if (dd) + sc_1 = -1 - z64; + i += es; + this_1.c = sc_1; + var d_1; + var file_1 = { + name: fn_1, + compression: cmp_1, + start: function () { + if (!file_1.ondata) + err(5); + if (!sc_1) + file_1.ondata(null, et, true); + else { + var ctr = _this.o[cmp_1]; + if (!ctr) + file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false); + d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1); + d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); }; + for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) { + var dat = chks_4[_i]; + d_1.push(dat, false); + } + if (_this.k[0] == chks_3 && _this.c) + _this.d = d_1; + else + d_1.push(et, true); + } + }, + terminate: function () { + if (d_1 && d_1.terminate) + d_1.terminate(); + } + }; + if (sc_1 >= 0) + file_1.size = sc_1, file_1.originalSize = su_1; + this_1.onfile(file_1); + } + return "break"; + } + else if (oc) { + if (sig == 0x8074B50) { + is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0; + return "break"; + } + else if (sig == 0x2014B50) { + is = i -= 4, f = 3, this_1.c = 0; + return "break"; + } + } + }; + var this_1 = this; + for (; i < l - 4; ++i) { + var state_1 = _loop_2(); + if (state_1 === "break") + break; + } + this.p = et; + if (oc < 0) { + var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i); + if (add) + add.push(dat, !!f); + else + this.k[+(f == 2)].push(dat); + } + if (f & 2) + return this.push(buf.subarray(i), final); + this.p = buf.subarray(i); + } + if (final) { + if (this.c) + err(13); + this.p = null; + } + }; + /** + * Registers a decoder with the stream, allowing for files compressed with + * the compression type provided to be expanded correctly + * @param decoder The decoder constructor + */ + Unzip.prototype.register = function (decoder) { + this.o[decoder.compression] = decoder; + }; + return Unzip; +}()); +exports.Unzip = Unzip; +var mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); }; +function unzip(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + var term = []; + var tAll = function () { + for (var i = 0; i < term.length; ++i) + term[i](); + }; + var files = {}; + var cbd = function (a, b) { + mt(function () { cb(a, b); }); + }; + mt(function () { cbd = cb; }); + var e = data.length - 22; + for (; b4(data, e) != 0x6054B50; --e) { + if (!e || data.length - e > 65558) { + cbd(err(13, 0, 1), null); + return tAll; + } + } + ; + var lft = b2(data, e + 8); + if (lft) { + var c = lft; + var o = b4(data, e + 16); + var z = b4(data, e - 20) == 0x7064B50; + if (z) { + var ze = b4(data, e - 12); + z = b4(data, ze) == 0x6064B50; + if (z) { + c = lft = b4(data, ze + 32); + o = b4(data, ze + 48); + } + } + var fltr = opts && opts.filter; + var _loop_3 = function (i) { + var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off); + o = no; + var cbl = function (e, d) { + if (e) { + tAll(); + cbd(e, null); + } + else { + if (d) + files[fn] = d; + if (!--lft) + cbd(null, files); + } + }; + if (!fltr || fltr({ + name: fn, + size: sc, + originalSize: su, + compression: c_1 + })) { + if (!c_1) + cbl(null, slc(data, b, b + sc)); + else if (c_1 == 8) { + var infl = data.subarray(b, b + sc); + // Synchronously decompress under 512KB, or barely-compressed data + if (su < 524288 || sc > 0.8 * su) { + try { + cbl(null, inflateSync(infl, { out: new u8(su) })); + } + catch (e) { + cbl(e, null); + } + } + else + term.push(inflate(infl, { size: su }, cbl)); + } + else + cbl(err(14, 'unknown compression type ' + c_1, 1), null); + } + else + cbl(null, null); + }; + for (var i = 0; i < c; ++i) { + _loop_3(i); + } + } + else + cbd(null, {}); + return tAll; +} +/** + * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better + * performance with more than one file. + * @param data The raw compressed ZIP file + * @param opts The ZIP extraction options + * @returns The decompressed files + */ +function unzipSync(data, opts) { + var files = {}; + var e = data.length - 22; + for (; b4(data, e) != 0x6054B50; --e) { + if (!e || data.length - e > 65558) + err(13); + } + ; + var c = b2(data, e + 8); + if (!c) + return {}; + var o = b4(data, e + 16); + var z = b4(data, e - 20) == 0x7064B50; + if (z) { + var ze = b4(data, e - 12); + z = b4(data, ze) == 0x6064B50; + if (z) { + c = b4(data, ze + 32); + o = b4(data, ze + 48); + } + } + var fltr = opts && opts.filter; + for (var i = 0; i < c; ++i) { + var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off); + o = no; + if (!fltr || fltr({ + name: fn, + size: sc, + originalSize: su, + compression: c_2 + })) { + if (!c_2) + files[fn] = slc(data, b, b + sc); + else if (c_2 == 8) + files[fn] = inflateSync(data.subarray(b, b + sc), { out: new u8(su) }); + else + err(14, 'unknown compression type ' + c_2); + } + } + return files; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/lib/browser.d.cts b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/lib/browser.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..d430faf2b555c978d66c89f46155b72c2c45a971 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/lib/browser.d.cts @@ -0,0 +1,1539 @@ +/** + * Codes for errors generated within this library + */ +export declare const FlateErrorCode: { + readonly UnexpectedEOF: 0; + readonly InvalidBlockType: 1; + readonly InvalidLengthLiteral: 2; + readonly InvalidDistance: 3; + readonly StreamFinished: 4; + readonly NoStreamHandler: 5; + readonly InvalidHeader: 6; + readonly NoCallback: 7; + readonly InvalidUTF8: 8; + readonly ExtraFieldTooLong: 9; + readonly InvalidDate: 10; + readonly FilenameTooLong: 11; + readonly StreamFinishing: 12; + readonly InvalidZipData: 13; + readonly UnknownCompressionMethod: 14; +}; +/** + * An error generated within this library + */ +export interface FlateError extends Error { + /** + * The code associated with this error + */ + code: number; +} +/** + * Options for decompressing a DEFLATE stream + */ +export interface InflateStreamOptions { + /** + * The dictionary used to compress the original data. If no dictionary was used during compression, this option has no effect. + * + * Supplying the wrong dictionary during decompression usually yields corrupt output or causes an invalid distance error. + */ + dictionary?: Uint8Array; +} +/** + * Options for decompressing DEFLATE data + */ +export interface InflateOptions extends InflateStreamOptions { + /** + * The buffer into which to write the decompressed data. Saves memory if you know the decompressed size in advance. + * + * Note that if the decompression result is larger than the size of this buffer, it will be truncated to fit. + */ + out?: Uint8Array; +} +/** + * Options for decompressing a GZIP stream + */ +export interface GunzipStreamOptions extends InflateStreamOptions { +} +/** + * Options for decompressing GZIP data + */ +export interface GunzipOptions extends InflateStreamOptions { + /** + * The buffer into which to write the decompressed data. GZIP already encodes the output size, so providing this doesn't save memory. + * + * Note that if the decompression result is larger than the size of this buffer, it will be truncated to fit. + */ + out?: Uint8Array; +} +/** + * Options for decompressing a Zlib stream + */ +export interface UnzlibStreamOptions extends InflateStreamOptions { +} +/** + * Options for decompressing Zlib data + */ +export interface UnzlibOptions extends InflateOptions { +} +/** + * Options for compressing data into a DEFLATE format + */ +export interface DeflateOptions { + /** + * The level of compression to use, ranging from 0-9. + * + * 0 will store the data without compression. + * 1 is fastest but compresses the worst, 9 is slowest but compresses the best. + * The default level is 6. + * + * Typically, binary data benefits much more from higher values than text data. + * In both cases, higher values usually take disproportionately longer than the reduction in final size that results. + * + * For example, a 1 MB text file could: + * - become 1.01 MB with level 0 in 1ms + * - become 400 kB with level 1 in 10ms + * - become 320 kB with level 9 in 100ms + */ + level?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; + /** + * The memory level to use, ranging from 0-12. Increasing this increases speed and compression ratio at the cost of memory. + * + * Note that this is exponential: while level 0 uses 8 kB, level 4 uses 128 kB, level 8 uses 2 MB, and level 12 uses 32 MB. + * It is recommended not to lower the value below 4, since that tends to hurt performance. + * In addition, values above 8 tend to help very little on most data and can even hurt performance. + * + * The default value is automatically determined based on the size of the input data. + */ + mem?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12; + /** + * A buffer containing common byte sequences in the input data that can be used to significantly improve compression ratios. + * + * Dictionaries should be 32kB or smaller and include strings or byte sequences likely to appear in the input. + * The decompressor must supply the same dictionary as the compressor to extract the original data. + * + * Dictionaries only improve aggregate compression ratio when reused across multiple small inputs. They should typically not be used otherwise. + * + * Avoid using dictionaries with GZIP and ZIP to maximize software compatibility. + */ + dictionary?: Uint8Array; +} +/** + * Options for compressing data into a GZIP format + */ +export interface GzipOptions extends DeflateOptions { + /** + * When the file was last modified. Defaults to the current time. + * Set this to 0 to avoid revealing a modification date entirely. + */ + mtime?: Date | string | number; + /** + * The filename of the data. If the `gunzip` command is used to decompress the data, it will output a file + * with this name instead of the name of the compressed file. + */ + filename?: string; +} +/** + * Options for compressing data into a Zlib format + */ +export interface ZlibOptions extends DeflateOptions { +} +/** + * Handler for data (de)compression streams + * @param data The data output from the stream processor + * @param final Whether this is the final block + */ +export type FlateStreamHandler = (data: Uint8Array, final: boolean) => void; +/** + * Handler for asynchronous data (de)compression streams + * @param err Any error that occurred + * @param data The data output from the stream processor + * @param final Whether this is the final block + */ +export type AsyncFlateStreamHandler = (err: FlateError | null, data: Uint8Array, final: boolean) => void; +/** + * Handler for the asynchronous completion of (de)compression for a data chunk + * @param size The number of bytes that were processed. This is measured in terms of the input + * (i.e. compressed bytes for decompression, uncompressed bytes for compression.) + */ +export type AsyncFlateDrainHandler = (size: number) => void; +/** + * Callback for asynchronous (de)compression methods + * @param err Any error that occurred + * @param data The resulting data. Only present if `err` is null + */ +export type FlateCallback = (err: FlateError | null, data: Uint8Array) => void; +interface AsyncOptions { + /** + * Whether or not to "consume" the source data. This will make the typed array/buffer you pass in + * unusable but will increase performance and reduce memory usage. + */ + consume?: boolean; +} +/** + * Options for compressing data asynchronously into a DEFLATE format + */ +export interface AsyncDeflateOptions extends DeflateOptions, AsyncOptions { +} +/** + * Options for decompressing DEFLATE data asynchronously + */ +export interface AsyncInflateOptions extends AsyncOptions, InflateStreamOptions { + /** + * The original size of the data. Currently, the asynchronous API disallows + * writing into a buffer you provide; the best you can do is provide the + * size in bytes and be given back a new typed array. + */ + size?: number; +} +/** + * Options for compressing data asynchronously into a GZIP format + */ +export interface AsyncGzipOptions extends GzipOptions, AsyncOptions { +} +/** + * Options for decompressing GZIP data asynchronously + */ +export interface AsyncGunzipOptions extends AsyncOptions, InflateStreamOptions { +} +/** + * Options for compressing data asynchronously into a Zlib format + */ +export interface AsyncZlibOptions extends ZlibOptions, AsyncOptions { +} +/** + * Options for decompressing Zlib data asynchronously + */ +export interface AsyncUnzlibOptions extends AsyncInflateOptions { +} +/** + * A terminable compression/decompression process + */ +export interface AsyncTerminable { + /** + * Terminates the worker thread immediately. The callback will not be called. + */ + (): void; +} +/** + * Streaming DEFLATE compression + */ +export declare class Deflate { + /** + * Creates a DEFLATE stream + * @param opts The compression options + * @param cb The callback to call whenever data is deflated + */ + constructor(opts: DeflateOptions, cb?: FlateStreamHandler); + /** + * Creates a DEFLATE stream + * @param cb The callback to call whenever data is deflated + */ + constructor(cb?: FlateStreamHandler); + private b; + private s; + private o; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + private p; + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * deflated output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. A separate DEFLATE stream may be concatenated + * with the current output after a sync flush. + */ + flush(sync?: boolean): void; +} +/** + * Asynchronous streaming DEFLATE compression + */ +export declare class AsyncDeflate { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of uncompressed bytes buffered in the stream + */ + queuedSize: number; + /** + * Creates an asynchronous DEFLATE stream + * @param opts The compression options + * @param cb The callback to call whenever data is deflated + */ + constructor(opts: DeflateOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous DEFLATE stream + * @param cb The callback to call whenever data is deflated + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * deflated output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. A separate DEFLATE stream may be concatenated + * with the current output after a sync flush. + */ + flush(sync?: boolean): void; + /** + * A method to terminate the stream's internal worker. Subsequent calls to + * push() will silently fail. + */ + terminate: AsyncTerminable; +} +/** + * Asynchronously compresses data with DEFLATE without any wrapper + * @param data The data to compress + * @param opts The compression options + * @param cb The function to be called upon compression completion + * @returns A function that can be used to immediately terminate the compression + */ +export declare function deflate(data: Uint8Array, opts: AsyncDeflateOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously compresses data with DEFLATE without any wrapper + * @param data The data to compress + * @param cb The function to be called upon compression completion + */ +export declare function deflate(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Compresses data with DEFLATE without any wrapper + * @param data The data to compress + * @param opts The compression options + * @returns The deflated version of the data + */ +export declare function deflateSync(data: Uint8Array, opts?: DeflateOptions): Uint8Array; +/** + * Streaming DEFLATE decompression + */ +export declare class Inflate { + private s; + private o; + private p; + private d; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + /** + * Creates a DEFLATE decompression stream + * @param opts The decompression options + * @param cb The callback to call whenever data is inflated + */ + constructor(opts: InflateStreamOptions, cb?: FlateStreamHandler); + /** + * Creates a DEFLATE decompression stream + * @param cb The callback to call whenever data is inflated + */ + constructor(cb?: FlateStreamHandler); + private e; + private c; + /** + * Pushes a chunk to be inflated + * @param chunk The chunk to push + * @param final Whether this is the final chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Asynchronous streaming DEFLATE decompression + */ +export declare class AsyncInflate { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of compressed bytes buffered in the stream + */ + queuedSize: number; + /** + * Creates an asynchronous DEFLATE decompression stream + * @param opts The decompression options + * @param cb The callback to call whenever data is inflated + */ + constructor(opts: InflateStreamOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous DEFLATE decompression stream + * @param cb The callback to call whenever data is inflated + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Pushes a chunk to be inflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * A method to terminate the stream's internal worker. Subsequent calls to + * push() will silently fail. + */ + terminate: AsyncTerminable; +} +/** + * Asynchronously expands DEFLATE data with no wrapper + * @param data The data to decompress + * @param opts The decompression options + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function inflate(data: Uint8Array, opts: AsyncInflateOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously expands DEFLATE data with no wrapper + * @param data The data to decompress + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function inflate(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Expands DEFLATE data with no wrapper + * @param data The data to decompress + * @returns The decompressed version of the data + */ +export declare function inflateSync(data: Uint8Array): Uint8Array; +/** + * Expands DEFLATE data with no wrapper + * @param data The data to decompress + * @param opts The decompression options + * @returns The decompressed version of the data + */ +export declare function inflateSync(data: Uint8Array, opts?: InflateOptions): Uint8Array; +/** + * Streaming GZIP compression + */ +export declare class Gzip { + private c; + private l; + private v; + private o; + private s; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + /** + * Creates a GZIP stream + * @param opts The compression options + * @param cb The callback to call whenever data is deflated + */ + constructor(opts: GzipOptions, cb?: FlateStreamHandler); + /** + * Creates a GZIP stream + * @param cb The callback to call whenever data is deflated + */ + constructor(cb?: FlateStreamHandler); + /** + * Pushes a chunk to be GZIPped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + private p; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * GZIPped output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. + */ + flush(sync?: boolean): void; +} +/** + * Asynchronous streaming GZIP compression + */ +export declare class AsyncGzip { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of uncompressed bytes buffered in the stream + */ + queuedSize: number; + /** + * Creates an asynchronous GZIP stream + * @param opts The compression options + * @param cb The callback to call whenever data is deflated + */ + constructor(opts: GzipOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous GZIP stream + * @param cb The callback to call whenever data is deflated + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Pushes a chunk to be GZIPped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * GZIPped output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. + */ + flush(sync?: boolean): void; + /** + * A method to terminate the stream's internal worker. Subsequent calls to + * push() will silently fail. + */ + terminate: AsyncTerminable; +} +/** + * Asynchronously compresses data with GZIP + * @param data The data to compress + * @param opts The compression options + * @param cb The function to be called upon compression completion + * @returns A function that can be used to immediately terminate the compression + */ +export declare function gzip(data: Uint8Array, opts: AsyncGzipOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously compresses data with GZIP + * @param data The data to compress + * @param cb The function to be called upon compression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function gzip(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Compresses data with GZIP + * @param data The data to compress + * @param opts The compression options + * @returns The gzipped version of the data + */ +export declare function gzipSync(data: Uint8Array, opts?: GzipOptions): Uint8Array; +/** + * Handler for new GZIP members in concatenated GZIP streams. Useful for building indices used to perform random-access reads on compressed files. + * @param offset The offset of the new member relative to the start of the stream + */ +export type GunzipMemberHandler = (offset: number) => void; +/** + * Streaming single or multi-member GZIP decompression + */ +export declare class Gunzip { + private v; + private r; + private o; + private p; + private s; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + /** + * The handler to call whenever a new GZIP member is found + */ + onmember?: GunzipMemberHandler; + /** + * Creates a GUNZIP stream + * @param opts The decompression options + * @param cb The callback to call whenever data is inflated + */ + constructor(opts: GunzipStreamOptions, cb?: FlateStreamHandler); + /** + * Creates a GUNZIP stream + * @param cb The callback to call whenever data is inflated + */ + constructor(cb?: FlateStreamHandler); + /** + * Pushes a chunk to be GUNZIPped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Asynchronous streaming single or multi-member GZIP decompression + */ +export declare class AsyncGunzip { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of compressed bytes buffered in the stream + */ + queuedSize: number; + /** + * The handler to call whenever a new GZIP member is found + */ + onmember?: GunzipMemberHandler; + /** + * Creates an asynchronous GUNZIP stream + * @param opts The decompression options + * @param cb The callback to call whenever data is inflated + */ + constructor(opts: GunzipStreamOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous GUNZIP stream + * @param cb The callback to call whenever data is inflated + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Pushes a chunk to be GUNZIPped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * A method to terminate the stream's internal worker. Subsequent calls to + * push() will silently fail. + */ + terminate: AsyncTerminable; +} +/** + * Asynchronously expands GZIP data + * @param data The data to decompress + * @param opts The decompression options + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function gunzip(data: Uint8Array, opts: AsyncGunzipOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously expands GZIP data + * @param data The data to decompress + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function gunzip(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Expands GZIP data + * @param data The data to decompress + * @returns The decompressed version of the data + */ +export declare function gunzipSync(data: Uint8Array): Uint8Array; +/** + * Expands GZIP data + * @param data The data to decompress + * @param opts The decompression options + * @returns The decompressed version of the data + */ +export declare function gunzipSync(data: Uint8Array, opts?: GunzipOptions): Uint8Array; +/** + * Streaming Zlib compression + */ +export declare class Zlib { + private c; + private v; + private o; + private s; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + /** + * Creates a Zlib stream + * @param opts The compression options + * @param cb The callback to call whenever data is deflated + */ + constructor(opts: ZlibOptions, cb?: FlateStreamHandler); + /** + * Creates a Zlib stream + * @param cb The callback to call whenever data is deflated + */ + constructor(cb?: FlateStreamHandler); + /** + * Pushes a chunk to be zlibbed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + private p; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * zlibbed output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. + */ + flush(sync?: boolean): void; +} +/** + * Asynchronous streaming Zlib compression + */ +export declare class AsyncZlib { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of uncompressed bytes buffered in the stream + */ + queuedSize: number; + /** + * Creates an asynchronous Zlib stream + * @param opts The compression options + * @param cb The callback to call whenever data is deflated + */ + constructor(opts: ZlibOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous Zlib stream + * @param cb The callback to call whenever data is deflated + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * zlibbed output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. + */ + flush(sync?: boolean): void; + /** + * A method to terminate the stream's internal worker. Subsequent calls to + * push() will silently fail. + */ + terminate: AsyncTerminable; +} +/** + * Asynchronously compresses data with Zlib + * @param data The data to compress + * @param opts The compression options + * @param cb The function to be called upon compression completion + */ +export declare function zlib(data: Uint8Array, opts: AsyncZlibOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously compresses data with Zlib + * @param data The data to compress + * @param cb The function to be called upon compression completion + * @returns A function that can be used to immediately terminate the compression + */ +export declare function zlib(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Compress data with Zlib + * @param data The data to compress + * @param opts The compression options + * @returns The zlib-compressed version of the data + */ +export declare function zlibSync(data: Uint8Array, opts?: ZlibOptions): Uint8Array; +/** + * Streaming Zlib decompression + */ +export declare class Unzlib { + private v; + private p; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + /** + * Creates a Zlib decompression stream + * @param opts The decompression options + * @param cb The callback to call whenever data is inflated + */ + constructor(opts: UnzlibStreamOptions, cb?: FlateStreamHandler); + /** + * Creates a Zlib decompression stream + * @param cb The callback to call whenever data is inflated + */ + constructor(cb?: FlateStreamHandler); + /** + * Pushes a chunk to be unzlibbed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Asynchronous streaming Zlib decompression + */ +export declare class AsyncUnzlib { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of compressed bytes buffered in the stream + */ + queuedSize: number; + /** + * Creates an asynchronous Zlib decompression stream + * @param opts The decompression options + * @param cb The callback to call whenever data is inflated + */ + constructor(opts: UnzlibStreamOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous Zlib decompression stream + * @param cb The callback to call whenever data is inflated + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Pushes a chunk to be decompressed from Zlib + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * A method to terminate the stream's internal worker. Subsequent calls to + * push() will silently fail. + */ + terminate: AsyncTerminable; +} +/** + * Asynchronously expands Zlib data + * @param data The data to decompress + * @param opts The decompression options + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function unzlib(data: Uint8Array, opts: AsyncUnzlibOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously expands Zlib data + * @param data The data to decompress + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function unzlib(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Expands Zlib data + * @param data The data to decompress + * @returns The decompressed version of the data + */ +export declare function unzlibSync(data: Uint8Array): Uint8Array; +/** + * Expands Zlib data + * @param data The data to decompress + * @param opts The decompression options + * @returns The decompressed version of the data + */ +export declare function unzlibSync(data: Uint8Array, opts?: UnzlibOptions): Uint8Array; +export { gzip as compress, AsyncGzip as AsyncCompress }; +export { gzipSync as compressSync, Gzip as Compress }; +/** + * Streaming GZIP, Zlib, or raw DEFLATE decompression + */ +export declare class Decompress { + private G; + private I; + private Z; + private o; + private s; + private p; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + /** + * Creates a decompression stream + * @param opts The decompression options + * @param cb The callback to call whenever data is decompressed + */ + constructor(opts: InflateStreamOptions, cb?: FlateStreamHandler); + /** + * Creates a decompression stream + * @param cb The callback to call whenever data is decompressed + */ + constructor(cb?: FlateStreamHandler); + private i; + /** + * Pushes a chunk to be decompressed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression + */ +export declare class AsyncDecompress { + private G; + private I; + private Z; + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of compressed bytes buffered in the stream + */ + queuedSize: number; + /** + * Creates an asynchronous decompression stream + * @param opts The decompression options + * @param cb The callback to call whenever data is decompressed + */ + constructor(opts: InflateStreamOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous decompression stream + * @param cb The callback to call whenever data is decompressed + */ + constructor(cb?: AsyncFlateStreamHandler); + private i; + /** + * Pushes a chunk to be decompressed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Asynchrononously expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format + * @param data The data to decompress + * @param opts The decompression options + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function decompress(data: Uint8Array, opts: AsyncInflateOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchrononously expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format + * @param data The data to decompress + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function decompress(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format + * @param data The data to decompress + * @param opts The decompression options + * @returns The decompressed version of the data + */ +export declare function decompressSync(data: Uint8Array, opts?: InflateOptions): Uint8Array; +/** + * Attributes for files added to a ZIP archive object + */ +export interface ZipAttributes { + /** + * The operating system of origin for this file. The value is defined + * by PKZIP's APPNOTE.txt, section 4.4.2.2. For example, 0 (the default) + * is MS/DOS, 3 is Unix, 19 is macOS. + */ + os?: number; + /** + * The file's attributes. These are traditionally somewhat complicated + * and platform-dependent, so using them is scarcely necessary. However, + * here is a representation of what this is, bit by bit: + * + * `TTTTugtrwxrwxrwx0000000000ADVSHR` + * + * TTTT = file type (rarely useful) + * + * u = setuid, g = setgid, t = sticky + * + * rwx = user permissions, rwx = group permissions, rwx = other permissions + * + * 0000000000 = unused + * + * A = archive, D = directory, V = volume label, S = system file, H = hidden, R = read-only + * + * If you want to set the Unix permissions, for instance, just bit shift by 16, e.g. 0o644 << 16. + * Note that attributes usually only work in conjunction with the `os` setting: you must use + * `os` = 3 (Unix) if you want to set Unix permissions + */ + attrs?: number; + /** + * Extra metadata to add to the file. This field is defined by PKZIP's APPNOTE.txt, + * section 4.4.28. At most 65,535 bytes may be used in each ID. The ID must be an + * integer between 0 and 65,535, inclusive. + * + * This field is incredibly rare and almost never needed except for compliance with + * proprietary standards and software. + */ + extra?: Record; + /** + * The comment to attach to the file. This field is defined by PKZIP's APPNOTE.txt, + * section 4.4.26. The comment must be at most 65,535 bytes long UTF-8 encoded. This + * field is not read by consumer software. + */ + comment?: string; + /** + * When the file was last modified. Defaults to the current time. + */ + mtime?: GzipOptions['mtime']; +} +/** + * Options for creating a ZIP archive + */ +export interface ZipOptions extends DeflateOptions, ZipAttributes { +} +/** + * Options for expanding a ZIP archive + */ +export interface UnzipOptions { + /** + * A filter function to extract only certain files from a ZIP archive + */ + filter?: UnzipFileFilter; +} +/** + * Options for asynchronously creating a ZIP archive + */ +export interface AsyncZipOptions extends AsyncDeflateOptions, ZipAttributes { +} +/** + * Options for asynchronously expanding a ZIP archive + */ +export interface AsyncUnzipOptions extends UnzipOptions { +} +/** + * A file that can be used to create a ZIP archive + */ +export type ZippableFile = Uint8Array | Zippable | [Uint8Array | Zippable, ZipOptions]; +/** + * A file that can be used to asynchronously create a ZIP archive + */ +export type AsyncZippableFile = Uint8Array | AsyncZippable | [Uint8Array | AsyncZippable, AsyncZipOptions]; +/** + * The complete directory structure of a ZIPpable archive + */ +export interface Zippable { + [path: string]: ZippableFile; +} +/** + * The complete directory structure of an asynchronously ZIPpable archive + */ +export interface AsyncZippable { + [path: string]: AsyncZippableFile; +} +/** + * An unzipped archive. The full path of each file is used as the key, + * and the file is the value + */ +export interface Unzipped { + [path: string]: Uint8Array; +} +/** + * Handler for string generation streams + * @param data The string output from the stream processor + * @param final Whether this is the final block + */ +export type StringStreamHandler = (data: string, final: boolean) => void; +/** + * Callback for asynchronous ZIP decompression + * @param err Any error that occurred + * @param data The decompressed ZIP archive + */ +export type UnzipCallback = (err: FlateError | null, data: Unzipped) => void; +/** + * Handler for streaming ZIP decompression + * @param file The file that was found in the archive + */ +export type UnzipFileHandler = (file: UnzipFile) => void; +/** + * Streaming UTF-8 decoding + */ +export declare class DecodeUTF8 { + private p; + private t; + /** + * Creates a UTF-8 decoding stream + * @param cb The callback to call whenever data is decoded + */ + constructor(cb?: StringStreamHandler); + /** + * Pushes a chunk to be decoded from UTF-8 binary + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * The handler to call whenever data is available + */ + ondata: StringStreamHandler; +} +/** + * Streaming UTF-8 encoding + */ +export declare class EncodeUTF8 { + private d; + /** + * Creates a UTF-8 decoding stream + * @param cb The callback to call whenever data is encoded + */ + constructor(cb?: FlateStreamHandler); + /** + * Pushes a chunk to be encoded to UTF-8 + * @param chunk The string data to push + * @param final Whether this is the last chunk + */ + push(chunk: string, final?: boolean): void; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; +} +/** + * Converts a string into a Uint8Array for use with compression/decompression methods + * @param str The string to encode + * @param latin1 Whether or not to interpret the data as Latin-1. This should + * not need to be true unless decoding a binary string. + * @returns The string encoded in UTF-8/Latin-1 binary + */ +export declare function strToU8(str: string, latin1?: boolean): Uint8Array; +/** + * Converts a Uint8Array to a string + * @param dat The data to decode to string + * @param latin1 Whether or not to interpret the data as Latin-1. This should + * not need to be true unless encoding to binary string. + * @returns The original UTF-8/Latin-1 string + */ +export declare function strFromU8(dat: Uint8Array, latin1?: boolean): string; +/** + * A stream that can be used to create a file in a ZIP archive + */ +export interface ZipInputFile extends ZipAttributes { + /** + * The filename to associate with the data provided to this stream. If you + * want a file in a subdirectory, use forward slashes as a separator (e.g. + * `directory/filename.ext`). This will still work on Windows. + */ + filename: string; + /** + * The size of the file in bytes. This attribute may be invalid after + * the file is added to the ZIP archive; it must be correct only before the + * stream completes. + * + * If you don't want to have to compute this yourself, consider extending the + * ZipPassThrough class and overriding its process() method, or using one of + * ZipDeflate or AsyncZipDeflate. + */ + size: number; + /** + * A CRC of the original file contents. This attribute may be invalid after + * the file is added to the ZIP archive; it must be correct only before the + * stream completes. + * + * If you don't want to have to generate this yourself, consider extending the + * ZipPassThrough class and overriding its process() method, or using one of + * ZipDeflate or AsyncZipDeflate. + */ + crc: number; + /** + * The compression format for the data stream. This number is determined by + * the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no + * compression, 8 = deflate, 14 = LZMA + */ + compression: number; + /** + * Bits 1 and 2 of the general purpose bit flag, specified in PKZIP's + * APPNOTE.txt, section 4.4.4. Should be between 0 and 3. This is unlikely + * to be necessary. + */ + flag?: number; + /** + * The handler to be called when data is added. After passing this stream to + * the ZIP file object, this handler will always be defined. To call it: + * + * `stream.ondata(error, chunk, final)` + * + * error = any error that occurred (null if there was no error) + * + * chunk = a Uint8Array of the data that was added (null if there was an + * error) + * + * final = boolean, whether this is the final chunk in the stream + */ + ondata?: AsyncFlateStreamHandler; + /** + * A method called when the stream is no longer needed, for clean-up + * purposes. This will not always be called after the stream completes, + * so you may wish to call this.terminate() after the final chunk is + * processed if you have clean-up logic. + */ + terminate?: AsyncTerminable; +} +/** + * A pass-through stream to keep data uncompressed in a ZIP archive. + */ +export declare class ZipPassThrough implements ZipInputFile { + filename: string; + crc: number; + size: number; + compression: number; + os?: number; + attrs?: number; + comment?: string; + extra?: Record; + mtime?: GzipOptions['mtime']; + ondata: AsyncFlateStreamHandler; + private c; + /** + * Creates a pass-through stream that can be added to ZIP archives + * @param filename The filename to associate with this data stream + */ + constructor(filename: string); + /** + * Processes a chunk and pushes to the output stream. You can override this + * method in a subclass for custom behavior, but by default this passes + * the data through. You must call this.ondata(err, chunk, final) at some + * point in this method. + * @param chunk The chunk to process + * @param final Whether this is the last chunk + */ + protected process(chunk: Uint8Array, final: boolean): void; + /** + * Pushes a chunk to be added. If you are subclassing this with a custom + * compression algorithm, note that you must push data from the source + * file only, pre-compression. + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate + * for better performance + */ +export declare class ZipDeflate implements ZipInputFile { + filename: string; + crc: number; + size: number; + compression: number; + flag: 0 | 1 | 2 | 3; + os?: number; + attrs?: number; + comment?: string; + extra?: Record; + mtime?: GzipOptions['mtime']; + ondata: AsyncFlateStreamHandler; + private d; + /** + * Creates a DEFLATE stream that can be added to ZIP archives + * @param filename The filename to associate with this data stream + * @param opts The compression options + */ + constructor(filename: string, opts?: DeflateOptions); + private process; + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Asynchronous streaming DEFLATE compression for ZIP archives + */ +export declare class AsyncZipDeflate implements ZipInputFile { + filename: string; + crc: number; + size: number; + compression: number; + flag: 0 | 1 | 2 | 3; + os?: number; + attrs?: number; + comment?: string; + extra?: Record; + mtime?: GzipOptions['mtime']; + ondata: AsyncFlateStreamHandler; + private d; + terminate: AsyncTerminable; + /** + * Creates an asynchronous DEFLATE stream that can be added to ZIP archives + * @param filename The filename to associate with this data stream + * @param opts The compression options + */ + constructor(filename: string, opts?: DeflateOptions); + private process; + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * A zippable archive to which files can incrementally be added + */ +export declare class Zip { + private u; + private d; + /** + * Creates an empty ZIP archive to which files can be added + * @param cb The callback to call whenever data for the generated ZIP archive + * is available + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Adds a file to the ZIP archive + * @param file The file stream to add + */ + add(file: ZipInputFile): void; + /** + * Ends the process of adding files and prepares to emit the final chunks. + * This *must* be called after adding all desired files for the resulting + * ZIP file to work properly. + */ + end(): void; + private e; + /** + * A method to terminate any internal workers used by the stream. Subsequent + * calls to add() will fail. + */ + terminate(): void; + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; +} +/** + * Asynchronously creates a ZIP file + * @param data The directory structure for the ZIP archive + * @param opts The main options, merged with per-file options + * @param cb The callback to call with the generated ZIP archive + * @returns A function that can be used to immediately terminate the compression + */ +export declare function zip(data: AsyncZippable, opts: AsyncZipOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously creates a ZIP file + * @param data The directory structure for the ZIP archive + * @param cb The callback to call with the generated ZIP archive + * @returns A function that can be used to immediately terminate the compression + */ +export declare function zip(data: AsyncZippable, cb: FlateCallback): AsyncTerminable; +/** + * Synchronously creates a ZIP file. Prefer using `zip` for better performance + * with more than one file. + * @param data The directory structure for the ZIP archive + * @param opts The main options, merged with per-file options + * @returns The generated ZIP archive + */ +export declare function zipSync(data: Zippable, opts?: ZipOptions): Uint8Array; +/** + * A decoder for files in ZIP streams + */ +export interface UnzipDecoder { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * Pushes a chunk to be decompressed + * @param chunk The data in this chunk. Do not consume (detach) this buffer. + * @param final Whether this is the last chunk in the data stream + */ + push(chunk: Uint8Array, final: boolean): void; + /** + * A method to terminate any internal workers used by the stream. Subsequent + * calls to push() should silently fail. + */ + terminate?: AsyncTerminable; +} +/** + * A constructor for a decoder for unzip streams + */ +export interface UnzipDecoderConstructor { + /** + * Creates an instance of the decoder + * @param filename The name of the file + * @param size The compressed size of the file + * @param originalSize The original size of the file + */ + new (filename: string, size?: number, originalSize?: number): UnzipDecoder; + /** + * The compression format for the data stream. This number is determined by + * the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no + * compression, 8 = deflate, 14 = LZMA + */ + compression: number; +} +/** + * Information about a file to be extracted from a ZIP archive + */ +export interface UnzipFileInfo { + /** + * The name of the file + */ + name: string; + /** + * The compressed size of the file + */ + size: number; + /** + * The original size of the file + */ + originalSize: number; + /** + * The compression format for the data stream. This number is determined by + * the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no + * compression, 8 = deflate, 14 = LZMA. If the filter function returns true + * but this value is not 8, the unzip function will throw. + */ + compression: number; +} +/** + * A filter for files to be extracted during the unzipping process + * @param file The info for the current file being processed + * @returns Whether or not to extract the current file + */ +export type UnzipFileFilter = (file: UnzipFileInfo) => boolean; +/** + * Streaming file extraction from ZIP archives + */ +export interface UnzipFile { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The name of the file + */ + name: string; + /** + * The compression format for the data stream. This number is determined by + * the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no + * compression, 8 = deflate, 14 = LZMA. If start() is called but there is no + * decompression stream available for this method, start() will throw. + */ + compression: number; + /** + * The compressed size of the file. Will not be present for archives created + * in a streaming fashion. + */ + size?: number; + /** + * The original size of the file. Will not be present for archives created + * in a streaming fashion. + */ + originalSize?: number; + /** + * Starts reading from the stream. Calling this function will always enable + * this stream, but ocassionally the stream will be enabled even without + * this being called. + */ + start(): void; + /** + * A method to terminate any internal workers used by the stream. ondata + * will not be called any further. + */ + terminate: AsyncTerminable; +} +/** + * Streaming pass-through decompression for ZIP archives + */ +export declare class UnzipPassThrough implements UnzipDecoder { + static compression: number; + ondata: AsyncFlateStreamHandler; + push(chunk: Uint8Array, final: boolean): void; +} +/** + * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for + * better performance. + */ +export declare class UnzipInflate implements UnzipDecoder { + static compression: number; + private i; + ondata: AsyncFlateStreamHandler; + /** + * Creates a DEFLATE decompression that can be used in ZIP archives + */ + constructor(); + push(chunk: Uint8Array, final: boolean): void; +} +/** + * Asynchronous streaming DEFLATE decompression for ZIP archives + */ +export declare class AsyncUnzipInflate implements UnzipDecoder { + static compression: number; + private i; + ondata: AsyncFlateStreamHandler; + terminate: AsyncTerminable; + /** + * Creates a DEFLATE decompression that can be used in ZIP archives + */ + constructor(_: string, sz?: number); + push(chunk: Uint8Array, final: boolean): void; +} +/** + * A ZIP archive decompression stream that emits files as they are discovered + */ +export declare class Unzip { + private d; + private c; + private p; + private k; + private o; + /** + * Creates a ZIP decompression stream + * @param cb The callback to call whenever a file in the ZIP archive is found + */ + constructor(cb?: UnzipFileHandler); + /** + * Pushes a chunk to be unzipped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * Registers a decoder with the stream, allowing for files compressed with + * the compression type provided to be expanded correctly + * @param decoder The decoder constructor + */ + register(decoder: UnzipDecoderConstructor): void; + /** + * The handler to call whenever a file is discovered + */ + onfile: UnzipFileHandler; +} +/** + * Asynchronously decompresses a ZIP archive + * @param data The raw compressed ZIP file + * @param opts The ZIP extraction options + * @param cb The callback to call with the decompressed files + * @returns A function that can be used to immediately terminate the unzipping + */ +export declare function unzip(data: Uint8Array, opts: AsyncUnzipOptions, cb: UnzipCallback): AsyncTerminable; +/** + * Asynchronously decompresses a ZIP archive + * @param data The raw compressed ZIP file + * @param cb The callback to call with the decompressed files + * @returns A function that can be used to immediately terminate the unzipping + */ +export declare function unzip(data: Uint8Array, cb: UnzipCallback): AsyncTerminable; +/** + * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better + * performance with more than one file. + * @param data The raw compressed ZIP file + * @param opts The ZIP extraction options + * @returns The decompressed files + */ +export declare function unzipSync(data: Uint8Array, opts?: UnzipOptions): Unzipped; diff --git a/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/lib/index.cjs b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/lib/index.cjs new file mode 100644 index 0000000000000000000000000000000000000000..ea4da56d93b2462ca17e4220840416d561b4a645 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/lib/index.cjs @@ -0,0 +1,2697 @@ +"use strict"; +// DEFLATE is a complex format; to read this code, you should probably check the RFC first: +// https://tools.ietf.org/html/rfc1951 +// You may also wish to take a look at the guide I made about this program: +// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad +exports.deflate = deflate; +exports.deflateSync = deflateSync; +exports.inflate = inflate; +exports.inflateSync = inflateSync; +exports.gzip = gzip; +exports.compress = gzip; +exports.gzipSync = gzipSync; +exports.compressSync = gzipSync; +exports.gunzip = gunzip; +exports.gunzipSync = gunzipSync; +exports.zlib = zlib; +exports.zlibSync = zlibSync; +exports.unzlib = unzlib; +exports.unzlibSync = unzlibSync; +exports.gzip = gzip; +exports.compress = gzip; +exports.decompress = decompress; +exports.decompressSync = decompressSync; +exports.strToU8 = strToU8; +exports.strFromU8 = strFromU8; +exports.zip = zip; +exports.zipSync = zipSync; +exports.unzip = unzip; +exports.unzipSync = unzipSync; +// Some of the following code is similar to that of UZIP.js: +// https://github.com/photopea/UZIP.js +// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size. +// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint +// is better for memory in most engines (I *think*). +var node_worker_1 = require("./node-worker.cjs"); +// aliases for shorter compressed code (most minifers don't do this) +var u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array; +// fixed length extra bits +var fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]); +// fixed distance extra bits +var fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, /* unused */ 0, 0]); +// code length index map +var clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]); +// get base, reverse index map from extra bits +var freb = function (eb, start) { + var b = new u16(31); + for (var i = 0; i < 31; ++i) { + b[i] = start += 1 << eb[i - 1]; + } + // numbers here are at max 18 bits + var r = new i32(b[30]); + for (var i = 1; i < 30; ++i) { + for (var j = b[i]; j < b[i + 1]; ++j) { + r[j] = ((j - b[i]) << 5) | i; + } + } + return { b: b, r: r }; +}; +var _a = freb(fleb, 2), fl = _a.b, revfl = _a.r; +// we can ignore the fact that the other numbers are wrong; they never happen anyway +fl[28] = 258, revfl[258] = 28; +var _b = freb(fdeb, 0), fd = _b.b, revfd = _b.r; +// map of value to reverse (assuming 16 bits) +var rev = new u16(32768); +for (var i = 0; i < 32768; ++i) { + // reverse table algorithm from SO + var x = ((i & 0xAAAA) >> 1) | ((i & 0x5555) << 1); + x = ((x & 0xCCCC) >> 2) | ((x & 0x3333) << 2); + x = ((x & 0xF0F0) >> 4) | ((x & 0x0F0F) << 4); + rev[i] = (((x & 0xFF00) >> 8) | ((x & 0x00FF) << 8)) >> 1; +} +// create huffman tree from u8 "map": index -> code length for code index +// mb (max bits) must be at most 15 +// TODO: optimize/split up? +var hMap = (function (cd, mb, r) { + var s = cd.length; + // index + var i = 0; + // u16 "map": index -> # of codes with bit length = index + var l = new u16(mb); + // length of cd must be 288 (total # of codes) + for (; i < s; ++i) { + if (cd[i]) + ++l[cd[i] - 1]; + } + // u16 "map": index -> minimum code for bit length = index + var le = new u16(mb); + for (i = 1; i < mb; ++i) { + le[i] = (le[i - 1] + l[i - 1]) << 1; + } + var co; + if (r) { + // u16 "map": index -> number of actual bits, symbol for code + co = new u16(1 << mb); + // bits to remove for reverser + var rvb = 15 - mb; + for (i = 0; i < s; ++i) { + // ignore 0 lengths + if (cd[i]) { + // num encoding both symbol and bits read + var sv = (i << 4) | cd[i]; + // free bits + var r_1 = mb - cd[i]; + // start value + var v = le[cd[i] - 1]++ << r_1; + // m is end value + for (var m = v | ((1 << r_1) - 1); v <= m; ++v) { + // every 16 bit value starting with the code yields the same result + co[rev[v] >> rvb] = sv; + } + } + } + } + else { + co = new u16(s); + for (i = 0; i < s; ++i) { + if (cd[i]) { + co[i] = rev[le[cd[i] - 1]++] >> (15 - cd[i]); + } + } + } + return co; +}); +// fixed length tree +var flt = new u8(288); +for (var i = 0; i < 144; ++i) + flt[i] = 8; +for (var i = 144; i < 256; ++i) + flt[i] = 9; +for (var i = 256; i < 280; ++i) + flt[i] = 7; +for (var i = 280; i < 288; ++i) + flt[i] = 8; +// fixed distance tree +var fdt = new u8(32); +for (var i = 0; i < 32; ++i) + fdt[i] = 5; +// fixed length map +var flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1); +// fixed distance map +var fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1); +// find max of array +var max = function (a) { + var m = a[0]; + for (var i = 1; i < a.length; ++i) { + if (a[i] > m) + m = a[i]; + } + return m; +}; +// read d, starting at bit p and mask with m +var bits = function (d, p, m) { + var o = (p / 8) | 0; + return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m; +}; +// read d, starting at bit p continuing for at least 16 bits +var bits16 = function (d, p) { + var o = (p / 8) | 0; + return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7)); +}; +// get end of byte +var shft = function (p) { return ((p + 7) / 8) | 0; }; +// typed array slice - allows garbage collector to free original reference, +// while being more compatible than .slice +var slc = function (v, s, e) { + if (s == null || s < 0) + s = 0; + if (e == null || e > v.length) + e = v.length; + // can't use .constructor in case user-supplied + return new u8(v.subarray(s, e)); +}; +/** + * Codes for errors generated within this library + */ +exports.FlateErrorCode = { + UnexpectedEOF: 0, + InvalidBlockType: 1, + InvalidLengthLiteral: 2, + InvalidDistance: 3, + StreamFinished: 4, + NoStreamHandler: 5, + InvalidHeader: 6, + NoCallback: 7, + InvalidUTF8: 8, + ExtraFieldTooLong: 9, + InvalidDate: 10, + FilenameTooLong: 11, + StreamFinishing: 12, + InvalidZipData: 13, + UnknownCompressionMethod: 14 +}; +// error codes +var ec = [ + 'unexpected EOF', + 'invalid block type', + 'invalid length/literal', + 'invalid distance', + 'stream finished', + 'no stream handler', + , // determined by compression function + 'no callback', + 'invalid UTF-8 data', + 'extra field too long', + 'date not in range 1980-2099', + 'filename too long', + 'stream finishing', + 'invalid zip data' + // determined by unknown compression method +]; +; +var err = function (ind, msg, nt) { + var e = new Error(msg || ec[ind]); + e.code = ind; + if (Error.captureStackTrace) + Error.captureStackTrace(e, err); + if (!nt) + throw e; + return e; +}; +// expands raw DEFLATE data +var inflt = function (dat, st, buf, dict) { + // source length dict length + var sl = dat.length, dl = dict ? dict.length : 0; + if (!sl || st.f && !st.l) + return buf || new u8(0); + var noBuf = !buf; + // have to estimate size + var resize = noBuf || st.i != 2; + // no state + var noSt = st.i; + // Assumes roughly 33% compression ratio average + if (noBuf) + buf = new u8(sl * 3); + // ensure buffer can fit at least l elements + var cbuf = function (l) { + var bl = buf.length; + // need to increase size to fit + if (l > bl) { + // Double or set to necessary, whichever is greater + var nbuf = new u8(Math.max(bl * 2, l)); + nbuf.set(buf); + buf = nbuf; + } + }; + // last chunk bitpos bytes + var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n; + // total bits + var tbts = sl * 8; + do { + if (!lm) { + // BFINAL - this is only 1 when last chunk is next + final = bits(dat, pos, 1); + // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman + var type = bits(dat, pos + 1, 3); + pos += 3; + if (!type) { + // go to end of byte boundary + var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l; + if (t > sl) { + if (noSt) + err(0); + break; + } + // ensure size + if (resize) + cbuf(bt + l); + // Copy over uncompressed data + buf.set(dat.subarray(s, t), bt); + // Get new bitpos, update byte count + st.b = bt += l, st.p = pos = t * 8, st.f = final; + continue; + } + else if (type == 1) + lm = flrm, dm = fdrm, lbt = 9, dbt = 5; + else if (type == 2) { + // literal lengths + var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4; + var tl = hLit + bits(dat, pos + 5, 31) + 1; + pos += 14; + // length+distance tree + var ldt = new u8(tl); + // code length tree + var clt = new u8(19); + for (var i = 0; i < hcLen; ++i) { + // use index map to get real code + clt[clim[i]] = bits(dat, pos + i * 3, 7); + } + pos += hcLen * 3; + // code lengths bits + var clb = max(clt), clbmsk = (1 << clb) - 1; + // code lengths map + var clm = hMap(clt, clb, 1); + for (var i = 0; i < tl;) { + var r = clm[bits(dat, pos, clbmsk)]; + // bits read + pos += r & 15; + // symbol + var s = r >> 4; + // code length to copy + if (s < 16) { + ldt[i++] = s; + } + else { + // copy count + var c = 0, n = 0; + if (s == 16) + n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1]; + else if (s == 17) + n = 3 + bits(dat, pos, 7), pos += 3; + else if (s == 18) + n = 11 + bits(dat, pos, 127), pos += 7; + while (n--) + ldt[i++] = c; + } + } + // length tree distance tree + var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit); + // max length bits + lbt = max(lt); + // max dist bits + dbt = max(dt); + lm = hMap(lt, lbt, 1); + dm = hMap(dt, dbt, 1); + } + else + err(1); + if (pos > tbts) { + if (noSt) + err(0); + break; + } + } + // Make sure the buffer can hold this + the largest possible addition + // Maximum chunk size (practically, theoretically infinite) is 2^17 + if (resize) + cbuf(bt + 131072); + var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1; + var lpos = pos; + for (;; lpos = pos) { + // bits read, code + var c = lm[bits16(dat, pos) & lms], sym = c >> 4; + pos += c & 15; + if (pos > tbts) { + if (noSt) + err(0); + break; + } + if (!c) + err(2); + if (sym < 256) + buf[bt++] = sym; + else if (sym == 256) { + lpos = pos, lm = null; + break; + } + else { + var add = sym - 254; + // no extra bits needed if less + if (sym > 264) { + // index + var i = sym - 257, b = fleb[i]; + add = bits(dat, pos, (1 << b) - 1) + fl[i]; + pos += b; + } + // dist + var d = dm[bits16(dat, pos) & dms], dsym = d >> 4; + if (!d) + err(3); + pos += d & 15; + var dt = fd[dsym]; + if (dsym > 3) { + var b = fdeb[dsym]; + dt += bits16(dat, pos) & (1 << b) - 1, pos += b; + } + if (pos > tbts) { + if (noSt) + err(0); + break; + } + if (resize) + cbuf(bt + 131072); + var end = bt + add; + if (bt < dt) { + var shift = dl - dt, dend = Math.min(dt, end); + if (shift + bt < 0) + err(3); + for (; bt < dend; ++bt) + buf[bt] = dict[shift + bt]; + } + for (; bt < end; ++bt) + buf[bt] = buf[bt - dt]; + } + } + st.l = lm, st.p = lpos, st.b = bt, st.f = final; + if (lm) + final = 1, st.m = lbt, st.d = dm, st.n = dbt; + } while (!final); + // don't reallocate for streams or user buffers + return bt != buf.length && noBuf ? slc(buf, 0, bt) : buf.subarray(0, bt); +}; +// starting at p, write the minimum number of bits that can hold v to d +var wbits = function (d, p, v) { + v <<= p & 7; + var o = (p / 8) | 0; + d[o] |= v; + d[o + 1] |= v >> 8; +}; +// starting at p, write the minimum number of bits (>8) that can hold v to d +var wbits16 = function (d, p, v) { + v <<= p & 7; + var o = (p / 8) | 0; + d[o] |= v; + d[o + 1] |= v >> 8; + d[o + 2] |= v >> 16; +}; +// creates code lengths from a frequency table +var hTree = function (d, mb) { + // Need extra info to make a tree + var t = []; + for (var i = 0; i < d.length; ++i) { + if (d[i]) + t.push({ s: i, f: d[i] }); + } + var s = t.length; + var t2 = t.slice(); + if (!s) + return { t: et, l: 0 }; + if (s == 1) { + var v = new u8(t[0].s + 1); + v[t[0].s] = 1; + return { t: v, l: 1 }; + } + t.sort(function (a, b) { return a.f - b.f; }); + // after i2 reaches last ind, will be stopped + // freq must be greater than largest possible number of symbols + t.push({ s: -1, f: 25001 }); + var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2; + t[0] = { s: -1, f: l.f + r.f, l: l, r: r }; + // efficient algorithm from UZIP.js + // i0 is lookbehind, i2 is lookahead - after processing two low-freq + // symbols that combined have high freq, will start processing i2 (high-freq, + // non-composite) symbols instead + // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/ + while (i1 != s - 1) { + l = t[t[i0].f < t[i2].f ? i0++ : i2++]; + r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++]; + t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r }; + } + var maxSym = t2[0].s; + for (var i = 1; i < s; ++i) { + if (t2[i].s > maxSym) + maxSym = t2[i].s; + } + // code lengths + var tr = new u16(maxSym + 1); + // max bits in tree + var mbt = ln(t[i1 - 1], tr, 0); + if (mbt > mb) { + // more algorithms from UZIP.js + // TODO: find out how this code works (debt) + // ind debt + var i = 0, dt = 0; + // left cost + var lft = mbt - mb, cst = 1 << lft; + t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; }); + for (; i < s; ++i) { + var i2_1 = t2[i].s; + if (tr[i2_1] > mb) { + dt += cst - (1 << (mbt - tr[i2_1])); + tr[i2_1] = mb; + } + else + break; + } + dt >>= lft; + while (dt > 0) { + var i2_2 = t2[i].s; + if (tr[i2_2] < mb) + dt -= 1 << (mb - tr[i2_2]++ - 1); + else + ++i; + } + for (; i >= 0 && dt; --i) { + var i2_3 = t2[i].s; + if (tr[i2_3] == mb) { + --tr[i2_3]; + ++dt; + } + } + mbt = mb; + } + return { t: new u8(tr), l: mbt }; +}; +// get the max length and assign length codes +var ln = function (n, l, d) { + return n.s == -1 + ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1)) + : (l[n.s] = d); +}; +// length codes generation +var lc = function (c) { + var s = c.length; + // Note that the semicolon was intentional + while (s && !c[--s]) + ; + var cl = new u16(++s); + // ind num streak + var cli = 0, cln = c[0], cls = 1; + var w = function (v) { cl[cli++] = v; }; + for (var i = 1; i <= s; ++i) { + if (c[i] == cln && i != s) + ++cls; + else { + if (!cln && cls > 2) { + for (; cls > 138; cls -= 138) + w(32754); + if (cls > 2) { + w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305); + cls = 0; + } + } + else if (cls > 3) { + w(cln), --cls; + for (; cls > 6; cls -= 6) + w(8304); + if (cls > 2) + w(((cls - 3) << 5) | 8208), cls = 0; + } + while (cls--) + w(cln); + cls = 1; + cln = c[i]; + } + } + return { c: cl.subarray(0, cli), n: s }; +}; +// calculate the length of output from tree, code lengths +var clen = function (cf, cl) { + var l = 0; + for (var i = 0; i < cl.length; ++i) + l += cf[i] * cl[i]; + return l; +}; +// writes a fixed block +// returns the new bit pos +var wfblk = function (out, pos, dat) { + // no need to write 00 as type: TypedArray defaults to 0 + var s = dat.length; + var o = shft(pos + 2); + out[o] = s & 255; + out[o + 1] = s >> 8; + out[o + 2] = out[o] ^ 255; + out[o + 3] = out[o + 1] ^ 255; + for (var i = 0; i < s; ++i) + out[o + i + 4] = dat[i]; + return (o + 4 + s) * 8; +}; +// writes a block +var wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) { + wbits(out, p++, final); + ++lf[256]; + var _a = hTree(lf, 15), dlt = _a.t, mlb = _a.l; + var _b = hTree(df, 15), ddt = _b.t, mdb = _b.l; + var _c = lc(dlt), lclt = _c.c, nlc = _c.n; + var _d = lc(ddt), lcdt = _d.c, ndc = _d.n; + var lcfreq = new u16(19); + for (var i = 0; i < lclt.length; ++i) + ++lcfreq[lclt[i] & 31]; + for (var i = 0; i < lcdt.length; ++i) + ++lcfreq[lcdt[i] & 31]; + var _e = hTree(lcfreq, 7), lct = _e.t, mlcb = _e.l; + var nlcc = 19; + for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc) + ; + var flen = (bl + 5) << 3; + var ftlen = clen(lf, flt) + clen(df, fdt) + eb; + var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + 2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]; + if (bs >= 0 && flen <= ftlen && flen <= dtlen) + return wfblk(out, p, dat.subarray(bs, bs + bl)); + var lm, ll, dm, dl; + wbits(out, p, 1 + (dtlen < ftlen)), p += 2; + if (dtlen < ftlen) { + lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt; + var llm = hMap(lct, mlcb, 0); + wbits(out, p, nlc - 257); + wbits(out, p + 5, ndc - 1); + wbits(out, p + 10, nlcc - 4); + p += 14; + for (var i = 0; i < nlcc; ++i) + wbits(out, p + 3 * i, lct[clim[i]]); + p += 3 * nlcc; + var lcts = [lclt, lcdt]; + for (var it = 0; it < 2; ++it) { + var clct = lcts[it]; + for (var i = 0; i < clct.length; ++i) { + var len = clct[i] & 31; + wbits(out, p, llm[len]), p += lct[len]; + if (len > 15) + wbits(out, p, (clct[i] >> 5) & 127), p += clct[i] >> 12; + } + } + } + else { + lm = flm, ll = flt, dm = fdm, dl = fdt; + } + for (var i = 0; i < li; ++i) { + var sym = syms[i]; + if (sym > 255) { + var len = (sym >> 18) & 31; + wbits16(out, p, lm[len + 257]), p += ll[len + 257]; + if (len > 7) + wbits(out, p, (sym >> 23) & 31), p += fleb[len]; + var dst = sym & 31; + wbits16(out, p, dm[dst]), p += dl[dst]; + if (dst > 3) + wbits16(out, p, (sym >> 5) & 8191), p += fdeb[dst]; + } + else { + wbits16(out, p, lm[sym]), p += ll[sym]; + } + } + wbits16(out, p, lm[256]); + return p + ll[256]; +}; +// deflate options (nice << 13) | chain +var deo = /*#__PURE__*/ new i32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]); +// empty +var et = /*#__PURE__*/ new u8(0); +// compresses data into a raw DEFLATE buffer +var dflt = function (dat, lvl, plvl, pre, post, st) { + var s = st.z || dat.length; + var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post); + // writing to this writes to the output buffer + var w = o.subarray(pre, o.length - post); + var lst = st.l; + var pos = (st.r || 0) & 7; + if (lvl) { + if (pos) + w[0] = st.r >> 3; + var opt = deo[lvl - 1]; + var n = opt >> 13, c = opt & 8191; + var msk_1 = (1 << plvl) - 1; + // prev 2-byte val map curr 2-byte val map + var prev = st.p || new u16(32768), head = st.h || new u16(msk_1 + 1); + var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1; + var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; }; + // 24576 is an arbitrary number of maximum symbols per block + // 424 buffer for last block + var syms = new i32(25000); + // length/literal freq distance freq + var lf = new u16(288), df = new u16(32); + // l/lcnt exbits index l/lind waitdx blkpos + var lc_1 = 0, eb = 0, i = st.i || 0, li = 0, wi = st.w || 0, bs = 0; + for (; i + 2 < s; ++i) { + // hash value + var hv = hsh(i); + // index mod 32768 previous index mod + var imod = i & 32767, pimod = head[hv]; + prev[imod] = pimod; + head[hv] = imod; + // We always should modify head and prev, but only add symbols if + // this data is not yet processed ("wait" for wait index) + if (wi <= i) { + // bytes remaining + var rem = s - i; + if ((lc_1 > 7000 || li > 24576) && (rem > 423 || !lst)) { + pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos); + li = lc_1 = eb = 0, bs = i; + for (var j = 0; j < 286; ++j) + lf[j] = 0; + for (var j = 0; j < 30; ++j) + df[j] = 0; + } + // len dist chain + var l = 2, d = 0, ch_1 = c, dif = imod - pimod & 32767; + if (rem > 2 && hv == hsh(i - dif)) { + var maxn = Math.min(n, rem) - 1; + var maxd = Math.min(32767, i); + // max possible length + // not capped at dif because decompressors implement "rolling" index population + var ml = Math.min(258, rem); + while (dif <= maxd && --ch_1 && imod != pimod) { + if (dat[i + l] == dat[i + l - dif]) { + var nl = 0; + for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl) + ; + if (nl > l) { + l = nl, d = dif; + // break out early when we reach "nice" (we are satisfied enough) + if (nl > maxn) + break; + // now, find the rarest 2-byte sequence within this + // length of literals and search for that instead. + // Much faster than just using the start + var mmd = Math.min(dif, nl - 2); + var md = 0; + for (var j = 0; j < mmd; ++j) { + var ti = i - dif + j & 32767; + var pti = prev[ti]; + var cd = ti - pti & 32767; + if (cd > md) + md = cd, pimod = ti; + } + } + } + // check the previous match + imod = pimod, pimod = prev[imod]; + dif += imod - pimod & 32767; + } + } + // d will be nonzero only when a match was found + if (d) { + // store both dist and len data in one int32 + // Make sure this is recognized as a len/dist with 28th bit (2^28) + syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d]; + var lin = revfl[l] & 31, din = revfd[d] & 31; + eb += fleb[lin] + fdeb[din]; + ++lf[257 + lin]; + ++df[din]; + wi = i + l; + ++lc_1; + } + else { + syms[li++] = dat[i]; + ++lf[dat[i]]; + } + } + } + for (i = Math.max(i, wi); i < s; ++i) { + syms[li++] = dat[i]; + ++lf[dat[i]]; + } + pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos); + if (!lst) { + st.r = (pos & 7) | w[(pos / 8) | 0] << 3; + // shft(pos) now 1 less if pos & 7 != 0 + pos -= 7; + st.h = head, st.p = prev, st.i = i, st.w = wi; + } + } + else { + for (var i = st.w || 0; i < s + lst; i += 65535) { + // end + var e = i + 65535; + if (e >= s) { + // write final block + w[(pos / 8) | 0] = lst; + e = s; + } + pos = wfblk(w, pos + 1, dat.subarray(i, e)); + } + st.i = s; + } + return slc(o, 0, pre + shft(pos) + post); +}; +// CRC32 table +var crct = /*#__PURE__*/ (function () { + var t = new Int32Array(256); + for (var i = 0; i < 256; ++i) { + var c = i, k = 9; + while (--k) + c = ((c & 1) && -306674912) ^ (c >>> 1); + t[i] = c; + } + return t; +})(); +// CRC32 +var crc = function () { + var c = -1; + return { + p: function (d) { + // closures have awful performance + var cr = c; + for (var i = 0; i < d.length; ++i) + cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8); + c = cr; + }, + d: function () { return ~c; } + }; +}; +// Adler32 +var adler = function () { + var a = 1, b = 0; + return { + p: function (d) { + // closures have awful performance + var n = a, m = b; + var l = d.length | 0; + for (var i = 0; i != l;) { + var e = Math.min(i + 2655, l); + for (; i < e; ++i) + m += n += d[i]; + n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16); + } + a = n, b = m; + }, + d: function () { + a %= 65521, b %= 65521; + return (a & 255) << 24 | (a & 0xFF00) << 8 | (b & 255) << 8 | (b >> 8); + } + }; +}; +; +// deflate with opts +var dopt = function (dat, opt, pre, post, st) { + if (!st) { + st = { l: 1 }; + if (opt.dictionary) { + var dict = opt.dictionary.subarray(-32768); + var newDat = new u8(dict.length + dat.length); + newDat.set(dict); + newDat.set(dat, dict.length); + dat = newDat; + st.w = dict.length; + } + } + return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? (st.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : 20) : (12 + opt.mem), pre, post, st); +}; +// Walmart object spread +var mrg = function (a, b) { + var o = {}; + for (var k in a) + o[k] = a[k]; + for (var k in b) + o[k] = b[k]; + return o; +}; +// worker clone +// This is possibly the craziest part of the entire codebase, despite how simple it may seem. +// The only parameter to this function is a closure that returns an array of variables outside of the function scope. +// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization. +// We will return an object mapping of true variable name to value (basically, the current scope as a JS object). +// The reason we can't just use the original variable names is minifiers mangling the toplevel scope. +// This took me three weeks to figure out how to do. +var wcln = function (fn, fnStr, td) { + var dt = fn(); + var st = fn.toString(); + var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/\s+/g, '').split(','); + for (var i = 0; i < dt.length; ++i) { + var v = dt[i], k = ks[i]; + if (typeof v == 'function') { + fnStr += ';' + k + '='; + var st_1 = v.toString(); + if (v.prototype) { + // for global objects + if (st_1.indexOf('[native code]') != -1) { + var spInd = st_1.indexOf(' ', 8) + 1; + fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd)); + } + else { + fnStr += st_1; + for (var t in v.prototype) + fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString(); + } + } + else + fnStr += st_1; + } + else + td[k] = v; + } + return fnStr; +}; +var ch = []; +// clone bufs +var cbfs = function (v) { + var tl = []; + for (var k in v) { + if (v[k].buffer) { + tl.push((v[k] = new v[k].constructor(v[k])).buffer); + } + } + return tl; +}; +// use a worker to execute code +var wrkr = function (fns, init, id, cb) { + if (!ch[id]) { + var fnStr = '', td_1 = {}, m = fns.length - 1; + for (var i = 0; i < m; ++i) + fnStr = wcln(fns[i], fnStr, td_1); + ch[id] = { c: wcln(fns[m], fnStr, td_1), e: td_1 }; + } + var td = mrg({}, ch[id].e); + return (0, node_worker_1.default)(ch[id].c + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb); +}; +// base async inflate fn +var bInflt = function () { return [u8, u16, i32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gopt]; }; +var bDflt = function () { return [u8, u16, i32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; }; +// gzip extra +var gze = function () { return [gzh, gzhl, wbytes, crc, crct]; }; +// gunzip extra +var guze = function () { return [gzs, gzl]; }; +// zlib extra +var zle = function () { return [zlh, wbytes, adler]; }; +// unzlib extra +var zule = function () { return [zls]; }; +// post buf +var pbf = function (msg) { return postMessage(msg, [msg.buffer]); }; +// get opts +var gopt = function (o) { return o && { + out: o.size && new u8(o.size), + dictionary: o.dictionary +}; }; +// async helper +var cbify = function (dat, opts, fns, init, id, cb) { + var w = wrkr(fns, init, id, function (err, dat) { + w.terminate(); + cb(err, dat); + }); + w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []); + return function () { w.terminate(); }; +}; +// auto stream +var astrm = function (strm) { + strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); }; + return function (ev) { + if (ev.data[0]) { + strm.push(ev.data[0], ev.data[1]); + postMessage([ev.data[0].length]); + } + else + strm.flush(ev.data[1]); + }; +}; +// async stream attach +var astrmify = function (fns, strm, opts, init, id, flush, ext) { + var t; + var w = wrkr(fns, init, id, function (err, dat) { + if (err) + w.terminate(), strm.ondata.call(strm, err); + else if (!Array.isArray(dat)) + ext(dat); + else if (dat.length == 1) { + strm.queuedSize -= dat[0]; + if (strm.ondrain) + strm.ondrain(dat[0]); + } + else { + if (dat[1]) + w.terminate(); + strm.ondata.call(strm, err, dat[0], dat[1]); + } + }); + w.postMessage(opts); + strm.queuedSize = 0; + strm.push = function (d, f) { + if (!strm.ondata) + err(5); + if (t) + strm.ondata(err(4, 0, 1), null, !!f); + strm.queuedSize += d.length; + // can fail for cross-realm Uint8Array, but ok - only a small performance penalty + w.postMessage([d, t = f], d.buffer instanceof ArrayBuffer ? [d.buffer] : []); + }; + strm.terminate = function () { w.terminate(); }; + if (flush) { + strm.flush = function (sync) { w.postMessage([0, sync]); }; + } +}; +// read 2 bytes +var b2 = function (d, b) { return d[b] | (d[b + 1] << 8); }; +// read 4 bytes +var b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; }; +// read 8 bytes +var b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); }; +// write bytes +var wbytes = function (d, b, v) { + for (; v; ++b) + d[b] = v, v >>>= 8; +}; +// gzip header +var gzh = function (c, o) { + var fn = o.filename; + c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix + if (o.mtime != 0) + wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000)); + if (fn) { + c[3] = 8; + for (var i = 0; i <= fn.length; ++i) + c[i + 10] = fn.charCodeAt(i); + } +}; +// gzip footer: -8 to -4 = CRC, -4 to -0 is length +// gzip start +var gzs = function (d) { + if (d[0] != 31 || d[1] != 139 || d[2] != 8) + err(6, 'invalid gzip data'); + var flg = d[3]; + var st = 10; + if (flg & 4) + st += (d[10] | d[11] << 8) + 2; + for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++]) + ; + return st + (flg & 2); +}; +// gzip length +var gzl = function (d) { + var l = d.length; + return (d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16 | d[l - 1] << 24) >>> 0; +}; +// gzip header length +var gzhl = function (o) { return 10 + (o.filename ? o.filename.length + 1 : 0); }; +// zlib header +var zlh = function (c, o) { + var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2; + c[0] = 120, c[1] = (fl << 6) | (o.dictionary && 32); + c[1] |= 31 - ((c[0] << 8) | c[1]) % 31; + if (o.dictionary) { + var h = adler(); + h.p(o.dictionary); + wbytes(c, 2, h.d()); + } +}; +// zlib start +var zls = function (d, dict) { + if ((d[0] & 15) != 8 || (d[0] >> 4) > 7 || ((d[0] << 8 | d[1]) % 31)) + err(6, 'invalid zlib data'); + if ((d[1] >> 5 & 1) == +!dict) + err(6, 'invalid zlib data: ' + (d[1] & 32 ? 'need' : 'unexpected') + ' dictionary'); + return (d[1] >> 3 & 4) + 2; +}; +function StrmOpt(opts, cb) { + if (typeof opts == 'function') + cb = opts, opts = {}; + this.ondata = cb; + return opts; +} +/** + * Streaming DEFLATE compression + */ +var Deflate = /*#__PURE__*/ (function () { + function Deflate(opts, cb) { + if (typeof opts == 'function') + cb = opts, opts = {}; + this.ondata = cb; + this.o = opts || {}; + this.s = { l: 0, i: 32768, w: 32768, z: 32768 }; + // Buffer length must always be 0 mod 32768 for index calculations to be correct when modifying head and prev + // 98304 = 32768 (lookback) + 65536 (common chunk size) + this.b = new u8(98304); + if (this.o.dictionary) { + var dict = this.o.dictionary.subarray(-32768); + this.b.set(dict, 32768 - dict.length); + this.s.i = 32768 - dict.length; + } + } + Deflate.prototype.p = function (c, f) { + this.ondata(dopt(c, this.o, 0, 0, this.s), f); + }; + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Deflate.prototype.push = function (chunk, final) { + if (!this.ondata) + err(5); + if (this.s.l) + err(4); + var endLen = chunk.length + this.s.z; + if (endLen > this.b.length) { + if (endLen > 2 * this.b.length - 32768) { + var newBuf = new u8(endLen & -32768); + newBuf.set(this.b.subarray(0, this.s.z)); + this.b = newBuf; + } + var split = this.b.length - this.s.z; + this.b.set(chunk.subarray(0, split), this.s.z); + this.s.z = this.b.length; + this.p(this.b, false); + this.b.set(this.b.subarray(-32768)); + this.b.set(chunk.subarray(split), 32768); + this.s.z = chunk.length - split + 32768; + this.s.i = 32766, this.s.w = 32768; + } + else { + this.b.set(chunk, this.s.z); + this.s.z += chunk.length; + } + this.s.l = final & 1; + if (this.s.z > this.s.w + 8191 || final) { + this.p(this.b, final || false); + this.s.w = this.s.i, this.s.i -= 2; + } + if (final) { + // cleanup unneeded buffers/state to reduce memory usage + this.s = this.o = {}; + this.b = et; + } + }; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * deflated output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. A separate DEFLATE stream may be concatenated + * with the current output after a sync flush. + */ + Deflate.prototype.flush = function (sync) { + if (!this.ondata) + err(5); + if (this.s.l) + err(4); + this.p(this.b, false); + this.s.w = this.s.i, this.s.i -= 2; + // could technically skip writing the type-0 block for (this.s.r & 7) == 0, + // but the deterministic trailer (00 00 FF FF) is useful in some situations + if (sync) { + var c = new u8(6); + c[0] = this.s.r >> 3; + // write empty, non-final type-0 block + var ep = wfblk(c, this.s.r, et); + this.s.r = 0; + this.ondata(c.subarray(0, ep >> 3), false); + } + }; + return Deflate; +}()); +exports.Deflate = Deflate; +/** + * Asynchronous streaming DEFLATE compression + */ +var AsyncDeflate = /*#__PURE__*/ (function () { + function AsyncDeflate(opts, cb) { + astrmify([ + bDflt, + function () { return [astrm, Deflate]; } + ], this, StrmOpt.call(this, opts, cb), function (ev) { + var strm = new Deflate(ev.data); + onmessage = astrm(strm); + }, 6, 1); + } + return AsyncDeflate; +}()); +exports.AsyncDeflate = AsyncDeflate; +function deflate(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return cbify(data, opts, [ + bDflt, + ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb); +} +/** + * Compresses data with DEFLATE without any wrapper + * @param data The data to compress + * @param opts The compression options + * @returns The deflated version of the data + */ +function deflateSync(data, opts) { + return dopt(data, opts || {}, 0, 0); +} +/** + * Streaming DEFLATE decompression + */ +var Inflate = /*#__PURE__*/ (function () { + function Inflate(opts, cb) { + // no StrmOpt here to avoid adding to workerizer + if (typeof opts == 'function') + cb = opts, opts = {}; + this.ondata = cb; + var dict = opts && opts.dictionary && opts.dictionary.subarray(-32768); + this.s = { i: 0, b: dict ? dict.length : 0 }; + this.o = new u8(32768); + this.p = new u8(0); + if (dict) + this.o.set(dict); + } + Inflate.prototype.e = function (c) { + if (!this.ondata) + err(5); + if (this.d) + err(4); + if (!this.p.length) + this.p = c; + else if (c.length) { + var n = new u8(this.p.length + c.length); + n.set(this.p), n.set(c, this.p.length), this.p = n; + } + }; + Inflate.prototype.c = function (final) { + this.s.i = +(this.d = final || false); + var bts = this.s.b; + var dt = inflt(this.p, this.s, this.o); + this.ondata(slc(dt, bts, this.s.b), this.d); + this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length; + this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7; + }; + /** + * Pushes a chunk to be inflated + * @param chunk The chunk to push + * @param final Whether this is the final chunk + */ + Inflate.prototype.push = function (chunk, final) { + this.e(chunk), this.c(final); + }; + return Inflate; +}()); +exports.Inflate = Inflate; +/** + * Asynchronous streaming DEFLATE decompression + */ +var AsyncInflate = /*#__PURE__*/ (function () { + function AsyncInflate(opts, cb) { + astrmify([ + bInflt, + function () { return [astrm, Inflate]; } + ], this, StrmOpt.call(this, opts, cb), function (ev) { + var strm = new Inflate(ev.data); + onmessage = astrm(strm); + }, 7, 0); + } + return AsyncInflate; +}()); +exports.AsyncInflate = AsyncInflate; +function inflate(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return cbify(data, opts, [ + bInflt + ], function (ev) { return pbf(inflateSync(ev.data[0], gopt(ev.data[1]))); }, 1, cb); +} +function inflateSync(data, opts) { + return inflt(data, { i: 2 }, opts && opts.out, opts && opts.dictionary); +} +// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize. +/** + * Streaming GZIP compression + */ +var Gzip = /*#__PURE__*/ (function () { + function Gzip(opts, cb) { + this.c = crc(); + this.l = 0; + this.v = 1; + Deflate.call(this, opts, cb); + } + /** + * Pushes a chunk to be GZIPped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Gzip.prototype.push = function (chunk, final) { + this.c.p(chunk); + this.l += chunk.length; + Deflate.prototype.push.call(this, chunk, final); + }; + Gzip.prototype.p = function (c, f) { + var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, this.s); + if (this.v) + gzh(raw, this.o), this.v = 0; + if (f) + wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l); + this.ondata(raw, f); + }; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * GZIPped output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. + */ + Gzip.prototype.flush = function (sync) { + Deflate.prototype.flush.call(this, sync); + }; + return Gzip; +}()); +exports.Gzip = Gzip; +exports.Compress = Gzip; +/** + * Asynchronous streaming GZIP compression + */ +var AsyncGzip = /*#__PURE__*/ (function () { + function AsyncGzip(opts, cb) { + astrmify([ + bDflt, + gze, + function () { return [astrm, Deflate, Gzip]; } + ], this, StrmOpt.call(this, opts, cb), function (ev) { + var strm = new Gzip(ev.data); + onmessage = astrm(strm); + }, 8, 1); + } + return AsyncGzip; +}()); +exports.AsyncGzip = AsyncGzip; +exports.AsyncCompress = AsyncGzip; +function gzip(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return cbify(data, opts, [ + bDflt, + gze, + function () { return [gzipSync]; } + ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb); +} +/** + * Compresses data with GZIP + * @param data The data to compress + * @param opts The compression options + * @returns The gzipped version of the data + */ +function gzipSync(data, opts) { + if (!opts) + opts = {}; + var c = crc(), l = data.length; + c.p(data); + var d = dopt(data, opts, gzhl(opts), 8), s = d.length; + return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d; +} +/** + * Streaming single or multi-member GZIP decompression + */ +var Gunzip = /*#__PURE__*/ (function () { + function Gunzip(opts, cb) { + this.v = 1; + this.r = 0; + Inflate.call(this, opts, cb); + } + /** + * Pushes a chunk to be GUNZIPped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Gunzip.prototype.push = function (chunk, final) { + Inflate.prototype.e.call(this, chunk); + this.r += chunk.length; + if (this.v) { + var p = this.p.subarray(this.v - 1); + var s = p.length > 3 ? gzs(p) : 4; + if (s > p.length) { + if (!final) + return; + } + else if (this.v > 1 && this.onmember) { + this.onmember(this.r - p.length); + } + this.p = p.subarray(s), this.v = 0; + } + // necessary to prevent TS from using the closure value + // This allows for workerization to function correctly + Inflate.prototype.c.call(this, 0); + // process concatenated GZIP + if (this.s.f && !this.s.l) { + this.v = shft(this.s.p) + 9; + this.s = { i: 0 }; + this.o = new u8(0); + this.push(new u8(0), final); + } + else if (final) { + Inflate.prototype.c.call(this, final); + } + }; + return Gunzip; +}()); +exports.Gunzip = Gunzip; +/** + * Asynchronous streaming single or multi-member GZIP decompression + */ +var AsyncGunzip = /*#__PURE__*/ (function () { + function AsyncGunzip(opts, cb) { + var _this = this; + astrmify([ + bInflt, + guze, + function () { return [astrm, Inflate, Gunzip]; } + ], this, StrmOpt.call(this, opts, cb), function (ev) { + var strm = new Gunzip(ev.data); + strm.onmember = function (offset) { return postMessage(offset); }; + onmessage = astrm(strm); + }, 9, 0, function (offset) { return _this.onmember && _this.onmember(offset); }); + } + return AsyncGunzip; +}()); +exports.AsyncGunzip = AsyncGunzip; +function gunzip(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return cbify(data, opts, [ + bInflt, + guze, + function () { return [gunzipSync]; } + ], function (ev) { return pbf(gunzipSync(ev.data[0], ev.data[1])); }, 3, cb); +} +function gunzipSync(data, opts) { + var st = gzs(data); + if (st + 8 > data.length) + err(6, 'invalid gzip data'); + return inflt(data.subarray(st, -8), { i: 2 }, opts && opts.out || new u8(gzl(data)), opts && opts.dictionary); +} +/** + * Streaming Zlib compression + */ +var Zlib = /*#__PURE__*/ (function () { + function Zlib(opts, cb) { + this.c = adler(); + this.v = 1; + Deflate.call(this, opts, cb); + } + /** + * Pushes a chunk to be zlibbed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Zlib.prototype.push = function (chunk, final) { + this.c.p(chunk); + Deflate.prototype.push.call(this, chunk, final); + }; + Zlib.prototype.p = function (c, f) { + var raw = dopt(c, this.o, this.v && (this.o.dictionary ? 6 : 2), f && 4, this.s); + if (this.v) + zlh(raw, this.o), this.v = 0; + if (f) + wbytes(raw, raw.length - 4, this.c.d()); + this.ondata(raw, f); + }; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * zlibbed output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. + */ + Zlib.prototype.flush = function (sync) { + Deflate.prototype.flush.call(this, sync); + }; + return Zlib; +}()); +exports.Zlib = Zlib; +/** + * Asynchronous streaming Zlib compression + */ +var AsyncZlib = /*#__PURE__*/ (function () { + function AsyncZlib(opts, cb) { + astrmify([ + bDflt, + zle, + function () { return [astrm, Deflate, Zlib]; } + ], this, StrmOpt.call(this, opts, cb), function (ev) { + var strm = new Zlib(ev.data); + onmessage = astrm(strm); + }, 10, 1); + } + return AsyncZlib; +}()); +exports.AsyncZlib = AsyncZlib; +function zlib(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return cbify(data, opts, [ + bDflt, + zle, + function () { return [zlibSync]; } + ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb); +} +/** + * Compress data with Zlib + * @param data The data to compress + * @param opts The compression options + * @returns The zlib-compressed version of the data + */ +function zlibSync(data, opts) { + if (!opts) + opts = {}; + var a = adler(); + a.p(data); + var d = dopt(data, opts, opts.dictionary ? 6 : 2, 4); + return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d; +} +/** + * Streaming Zlib decompression + */ +var Unzlib = /*#__PURE__*/ (function () { + function Unzlib(opts, cb) { + Inflate.call(this, opts, cb); + this.v = opts && opts.dictionary ? 2 : 1; + } + /** + * Pushes a chunk to be unzlibbed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Unzlib.prototype.push = function (chunk, final) { + Inflate.prototype.e.call(this, chunk); + if (this.v) { + if (this.p.length < 6 && !final) + return; + this.p = this.p.subarray(zls(this.p, this.v - 1)), this.v = 0; + } + if (final) { + if (this.p.length < 4) + err(6, 'invalid zlib data'); + this.p = this.p.subarray(0, -4); + } + // necessary to prevent TS from using the closure value + // This allows for workerization to function correctly + Inflate.prototype.c.call(this, final); + }; + return Unzlib; +}()); +exports.Unzlib = Unzlib; +/** + * Asynchronous streaming Zlib decompression + */ +var AsyncUnzlib = /*#__PURE__*/ (function () { + function AsyncUnzlib(opts, cb) { + astrmify([ + bInflt, + zule, + function () { return [astrm, Inflate, Unzlib]; } + ], this, StrmOpt.call(this, opts, cb), function (ev) { + var strm = new Unzlib(ev.data); + onmessage = astrm(strm); + }, 11, 0); + } + return AsyncUnzlib; +}()); +exports.AsyncUnzlib = AsyncUnzlib; +function unzlib(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return cbify(data, opts, [ + bInflt, + zule, + function () { return [unzlibSync]; } + ], function (ev) { return pbf(unzlibSync(ev.data[0], gopt(ev.data[1]))); }, 5, cb); +} +function unzlibSync(data, opts) { + return inflt(data.subarray(zls(data, opts && opts.dictionary), -4), { i: 2 }, opts && opts.out, opts && opts.dictionary); +} +/** + * Streaming GZIP, Zlib, or raw DEFLATE decompression + */ +var Decompress = /*#__PURE__*/ (function () { + function Decompress(opts, cb) { + this.o = StrmOpt.call(this, opts, cb) || {}; + this.G = Gunzip; + this.I = Inflate; + this.Z = Unzlib; + } + // init substream + // overriden by AsyncDecompress + Decompress.prototype.i = function () { + var _this = this; + this.s.ondata = function (dat, final) { + _this.ondata(dat, final); + }; + }; + /** + * Pushes a chunk to be decompressed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Decompress.prototype.push = function (chunk, final) { + if (!this.ondata) + err(5); + if (!this.s) { + if (this.p && this.p.length) { + var n = new u8(this.p.length + chunk.length); + n.set(this.p), n.set(chunk, this.p.length); + } + else + this.p = chunk; + if (this.p.length > 2) { + this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8) + ? new this.G(this.o) + : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31)) + ? new this.I(this.o) + : new this.Z(this.o); + this.i(); + this.s.push(this.p, final); + this.p = null; + } + } + else + this.s.push(chunk, final); + }; + return Decompress; +}()); +exports.Decompress = Decompress; +/** + * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression + */ +var AsyncDecompress = /*#__PURE__*/ (function () { + function AsyncDecompress(opts, cb) { + Decompress.call(this, opts, cb); + this.queuedSize = 0; + this.G = AsyncGunzip; + this.I = AsyncInflate; + this.Z = AsyncUnzlib; + } + AsyncDecompress.prototype.i = function () { + var _this = this; + this.s.ondata = function (err, dat, final) { + _this.ondata(err, dat, final); + }; + this.s.ondrain = function (size) { + _this.queuedSize -= size; + if (_this.ondrain) + _this.ondrain(size); + }; + }; + /** + * Pushes a chunk to be decompressed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + AsyncDecompress.prototype.push = function (chunk, final) { + this.queuedSize += chunk.length; + Decompress.prototype.push.call(this, chunk, final); + }; + return AsyncDecompress; +}()); +exports.AsyncDecompress = AsyncDecompress; +function decompress(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return (data[0] == 31 && data[1] == 139 && data[2] == 8) + ? gunzip(data, opts, cb) + : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31)) + ? inflate(data, opts, cb) + : unzlib(data, opts, cb); +} +/** + * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format + * @param data The data to decompress + * @param opts The decompression options + * @returns The decompressed version of the data + */ +function decompressSync(data, opts) { + return (data[0] == 31 && data[1] == 139 && data[2] == 8) + ? gunzipSync(data, opts) + : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31)) + ? inflateSync(data, opts) + : unzlibSync(data, opts); +} +// flatten a directory structure +var fltn = function (d, p, t, o) { + for (var k in d) { + var val = d[k], n = p + k, op = o; + if (Array.isArray(val)) + op = mrg(o, val[1]), val = val[0]; + if (ArrayBuffer.isView(val)) + t[n] = [val, op]; + else { + t[n += '/'] = [new u8(0), op]; + fltn(val, n, t, o); + } + } +}; +// text encoder +var te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder(); +// text decoder +var td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder(); +// text decoder stream +var tds = 0; +try { + td.decode(et, { stream: true }); + tds = 1; +} +catch (e) { } +// decode UTF8 +var dutf8 = function (d) { + for (var r = '', i = 0;;) { + var c = d[i++]; + var eb = (c > 127) + (c > 223) + (c > 239); + if (i + eb > d.length) + return { s: r, r: slc(d, i - 1) }; + if (!eb) + r += String.fromCharCode(c); + else if (eb == 3) { + c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536, + r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023)); + } + else if (eb & 1) + r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63)); + else + r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)); + } +}; +/** + * Streaming UTF-8 decoding + */ +var DecodeUTF8 = /*#__PURE__*/ (function () { + /** + * Creates a UTF-8 decoding stream + * @param cb The callback to call whenever data is decoded + */ + function DecodeUTF8(cb) { + this.ondata = cb; + if (tds) + this.t = new TextDecoder(); + else + this.p = et; + } + /** + * Pushes a chunk to be decoded from UTF-8 binary + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + DecodeUTF8.prototype.push = function (chunk, final) { + if (!this.ondata) + err(5); + final = !!final; + if (this.t) { + this.ondata(this.t.decode(chunk, { stream: true }), final); + if (final) { + if (this.t.decode().length) + err(8); + this.t = null; + } + return; + } + if (!this.p) + err(4); + var dat = new u8(this.p.length + chunk.length); + dat.set(this.p); + dat.set(chunk, this.p.length); + var _a = dutf8(dat), s = _a.s, r = _a.r; + if (final) { + if (r.length) + err(8); + this.p = null; + } + else + this.p = r; + this.ondata(s, final); + }; + return DecodeUTF8; +}()); +exports.DecodeUTF8 = DecodeUTF8; +/** + * Streaming UTF-8 encoding + */ +var EncodeUTF8 = /*#__PURE__*/ (function () { + /** + * Creates a UTF-8 decoding stream + * @param cb The callback to call whenever data is encoded + */ + function EncodeUTF8(cb) { + this.ondata = cb; + } + /** + * Pushes a chunk to be encoded to UTF-8 + * @param chunk The string data to push + * @param final Whether this is the last chunk + */ + EncodeUTF8.prototype.push = function (chunk, final) { + if (!this.ondata) + err(5); + if (this.d) + err(4); + this.ondata(strToU8(chunk), this.d = final || false); + }; + return EncodeUTF8; +}()); +exports.EncodeUTF8 = EncodeUTF8; +/** + * Converts a string into a Uint8Array for use with compression/decompression methods + * @param str The string to encode + * @param latin1 Whether or not to interpret the data as Latin-1. This should + * not need to be true unless decoding a binary string. + * @returns The string encoded in UTF-8/Latin-1 binary + */ +function strToU8(str, latin1) { + if (latin1) { + var ar_1 = new u8(str.length); + for (var i = 0; i < str.length; ++i) + ar_1[i] = str.charCodeAt(i); + return ar_1; + } + if (te) + return te.encode(str); + var l = str.length; + var ar = new u8(str.length + (str.length >> 1)); + var ai = 0; + var w = function (v) { ar[ai++] = v; }; + for (var i = 0; i < l; ++i) { + if (ai + 5 > ar.length) { + var n = new u8(ai + 8 + ((l - i) << 1)); + n.set(ar); + ar = n; + } + var c = str.charCodeAt(i); + if (c < 128 || latin1) + w(c); + else if (c < 2048) + w(192 | (c >> 6)), w(128 | (c & 63)); + else if (c > 55295 && c < 57344) + c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023), + w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63)); + else + w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63)); + } + return slc(ar, 0, ai); +} +/** + * Converts a Uint8Array to a string + * @param dat The data to decode to string + * @param latin1 Whether or not to interpret the data as Latin-1. This should + * not need to be true unless encoding to binary string. + * @returns The original UTF-8/Latin-1 string + */ +function strFromU8(dat, latin1) { + if (latin1) { + var r = ''; + for (var i = 0; i < dat.length; i += 16384) + r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384)); + return r; + } + else if (td) { + return td.decode(dat); + } + else { + var _a = dutf8(dat), s = _a.s, r = _a.r; + if (r.length) + err(8); + return s; + } +} +; +// deflate bit flag +var dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; }; +// skip local zip header +var slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); }; +// read zip header +var zh = function (d, b, z) { + var fnl = b2(d, b + 28), efl = b2(d, b + 30), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl; + var _a = z64hs(d, es, efl, z, b4(d, b + 20), b4(d, b + 24), b4(d, b + 42)), sc = _a[0], su = _a[1], off = _a[2]; + return [b2(d, b + 10), sc, su, fn, es + efl + b2(d, b + 32), off]; +}; +// read zip64 header sizes +var z64hs = function (d, b, l, z, sc, su, off) { + var nsc = sc == 4294967295, nsu = su == 4294967295, noff = off == 4294967295, e = b + l; + var nf = nsc + nsu + noff; + if (z && nf) { + for (; b + 4 < e; b += 4 + b2(d, b + 2)) { + if (b2(d, b) == 1) { + return [ + nsc ? b8(d, b + 4 + 8 * nsu) : sc, + nsu ? b8(d, b + 4) : su, + noff ? b8(d, b + 4 + 8 * (nsu + nsc)) : off, + 1 + ]; + } + } + // z == 2 for unknown whether or not zip64 + if (z < 2) + err(13); + } + return [sc, su, off, 0]; +}; +// extra field length +var exfl = function (ex) { + var le = 0; + if (ex) { + for (var k in ex) { + var l = ex[k].length; + if (l > 65535) + err(9); + le += l + 4; + } + } + return le; +}; +// write zip header +var wzh = function (d, b, f, fn, u, c, ce, co) { + var fl = fn.length, ex = f.extra, col = co && co.length; + var exl = exfl(ex); + wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4; + if (ce != null) + d[b++] = 20, d[b++] = f.os; + d[b] = 20, b += 2; // spec compliance? what's that? + d[b++] = (f.flag << 1) | (c < 0 && 8), d[b++] = u && 8; + d[b++] = f.compression & 255, d[b++] = f.compression >> 8; + var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980; + if (y < 0 || y > 119) + err(10); + wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >> 1)), b += 4; + if (c != -1) { + wbytes(d, b, f.crc); + wbytes(d, b + 4, c < 0 ? -c - 2 : c); + wbytes(d, b + 8, f.size); + } + wbytes(d, b + 12, fl); + wbytes(d, b + 14, exl), b += 16; + if (ce != null) { + wbytes(d, b, col); + wbytes(d, b + 6, f.attrs); + wbytes(d, b + 10, ce), b += 14; + } + d.set(fn, b); + b += fl; + if (exl) { + for (var k in ex) { + var exf = ex[k], l = exf.length; + wbytes(d, b, +k); + wbytes(d, b + 2, l); + d.set(exf, b + 4), b += 4 + l; + } + } + if (col) + d.set(co, b), b += col; + return b; +}; +// write zip footer (end of central directory) +var wzf = function (o, b, c, d, e) { + wbytes(o, b, 0x6054B50); // skip disk + wbytes(o, b + 8, c); + wbytes(o, b + 10, c); + wbytes(o, b + 12, d); + wbytes(o, b + 16, e); +}; +/** + * A pass-through stream to keep data uncompressed in a ZIP archive. + */ +var ZipPassThrough = /*#__PURE__*/ (function () { + /** + * Creates a pass-through stream that can be added to ZIP archives + * @param filename The filename to associate with this data stream + */ + function ZipPassThrough(filename) { + this.filename = filename; + this.c = crc(); + this.size = 0; + this.compression = 0; + } + /** + * Processes a chunk and pushes to the output stream. You can override this + * method in a subclass for custom behavior, but by default this passes + * the data through. You must call this.ondata(err, chunk, final) at some + * point in this method. + * @param chunk The chunk to process + * @param final Whether this is the last chunk + */ + ZipPassThrough.prototype.process = function (chunk, final) { + this.ondata(null, chunk, final); + }; + /** + * Pushes a chunk to be added. If you are subclassing this with a custom + * compression algorithm, note that you must push data from the source + * file only, pre-compression. + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + ZipPassThrough.prototype.push = function (chunk, final) { + if (!this.ondata) + err(5); + this.c.p(chunk); + this.size += chunk.length; + if (final) + this.crc = this.c.d(); + // we shouldn't really do this cast, but properly handling ArrayBufferLike + // makes the API unergonomic with Buffer + this.process(chunk, final || false); + }; + return ZipPassThrough; +}()); +exports.ZipPassThrough = ZipPassThrough; +// I don't extend because TypeScript extension adds 1kB of runtime bloat +/** + * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate + * for better performance + */ +var ZipDeflate = /*#__PURE__*/ (function () { + /** + * Creates a DEFLATE stream that can be added to ZIP archives + * @param filename The filename to associate with this data stream + * @param opts The compression options + */ + function ZipDeflate(filename, opts) { + var _this = this; + if (!opts) + opts = {}; + ZipPassThrough.call(this, filename); + this.d = new Deflate(opts, function (dat, final) { + _this.ondata(null, dat, final); + }); + this.compression = 8; + this.flag = dbf(opts.level); + } + ZipDeflate.prototype.process = function (chunk, final) { + try { + this.d.push(chunk, final); + } + catch (e) { + this.ondata(e, null, final); + } + }; + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + ZipDeflate.prototype.push = function (chunk, final) { + ZipPassThrough.prototype.push.call(this, chunk, final); + }; + return ZipDeflate; +}()); +exports.ZipDeflate = ZipDeflate; +/** + * Asynchronous streaming DEFLATE compression for ZIP archives + */ +var AsyncZipDeflate = /*#__PURE__*/ (function () { + /** + * Creates an asynchronous DEFLATE stream that can be added to ZIP archives + * @param filename The filename to associate with this data stream + * @param opts The compression options + */ + function AsyncZipDeflate(filename, opts) { + var _this = this; + if (!opts) + opts = {}; + ZipPassThrough.call(this, filename); + this.d = new AsyncDeflate(opts, function (err, dat, final) { + _this.ondata(err, dat, final); + }); + this.compression = 8; + this.flag = dbf(opts.level); + this.terminate = this.d.terminate; + } + AsyncZipDeflate.prototype.process = function (chunk, final) { + this.d.push(chunk, final); + }; + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + AsyncZipDeflate.prototype.push = function (chunk, final) { + ZipPassThrough.prototype.push.call(this, chunk, final); + }; + return AsyncZipDeflate; +}()); +exports.AsyncZipDeflate = AsyncZipDeflate; +// TODO: Better tree shaking +/** + * A zippable archive to which files can incrementally be added + */ +var Zip = /*#__PURE__*/ (function () { + /** + * Creates an empty ZIP archive to which files can be added + * @param cb The callback to call whenever data for the generated ZIP archive + * is available + */ + function Zip(cb) { + this.ondata = cb; + this.u = []; + this.d = 1; + } + /** + * Adds a file to the ZIP archive + * @param file The file stream to add + */ + Zip.prototype.add = function (file) { + var _this = this; + if (!this.ondata) + err(5); + // finishing or finished + if (this.d & 2) + this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false); + else { + var f = strToU8(file.filename), fl_1 = f.length; + var com = file.comment, o = com && strToU8(com); + var u = fl_1 != file.filename.length || (o && (com.length != o.length)); + var hl_1 = fl_1 + exfl(file.extra) + 30; + if (fl_1 > 65535) + this.ondata(err(11, 0, 1), null, false); + var header = new u8(hl_1); + wzh(header, 0, file, f, u, -1); + var chks_1 = [header]; + var pAll_1 = function () { + for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) { + var chk = chks_2[_i]; + _this.ondata(null, chk, false); + } + chks_1 = []; + }; + var tr_1 = this.d; + this.d = 0; + var ind_1 = this.u.length; + var uf_1 = mrg(file, { + f: f, + u: u, + o: o, + t: function () { + if (file.terminate) + file.terminate(); + }, + r: function () { + pAll_1(); + if (tr_1) { + var nxt = _this.u[ind_1 + 1]; + if (nxt) + nxt.r(); + else + _this.d = 1; + } + tr_1 = 1; + } + }); + var cl_1 = 0; + file.ondata = function (err, dat, final) { + if (err) { + _this.ondata(err, dat, final); + _this.terminate(); + } + else { + cl_1 += dat.length; + chks_1.push(dat); + if (final) { + var dd = new u8(16); + wbytes(dd, 0, 0x8074B50); + wbytes(dd, 4, file.crc); + wbytes(dd, 8, cl_1); + wbytes(dd, 12, file.size); + chks_1.push(dd); + uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size; + if (tr_1) + uf_1.r(); + tr_1 = 1; + } + else if (tr_1) + pAll_1(); + } + }; + this.u.push(uf_1); + } + }; + /** + * Ends the process of adding files and prepares to emit the final chunks. + * This *must* be called after adding all desired files for the resulting + * ZIP file to work properly. + */ + Zip.prototype.end = function () { + var _this = this; + if (this.d & 2) { + this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true); + return; + } + if (this.d) + this.e(); + else + this.u.push({ + r: function () { + if (!(_this.d & 1)) + return; + _this.u.splice(-1, 1); + _this.e(); + }, + t: function () { } + }); + this.d = 3; + }; + Zip.prototype.e = function () { + var bt = 0, l = 0, tl = 0; + for (var _i = 0, _a = this.u; _i < _a.length; _i++) { + var f = _a[_i]; + tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0); + } + var out = new u8(tl + 22); + for (var _b = 0, _c = this.u; _b < _c.length; _b++) { + var f = _c[_b]; + wzh(out, bt, f, f.f, f.u, -f.c - 2, l, f.o); + bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b; + } + wzf(out, bt, this.u.length, tl, l); + this.ondata(null, out, true); + this.d = 2; + }; + /** + * A method to terminate any internal workers used by the stream. Subsequent + * calls to add() will fail. + */ + Zip.prototype.terminate = function () { + for (var _i = 0, _a = this.u; _i < _a.length; _i++) { + var f = _a[_i]; + f.t(); + } + this.d = 2; + }; + return Zip; +}()); +exports.Zip = Zip; +function zip(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + var r = {}; + fltn(data, '', r, opts); + var k = Object.keys(r); + var lft = k.length, o = 0, tot = 0; + var slft = lft, files = new Array(lft); + var term = []; + var tAll = function () { + for (var i = 0; i < term.length; ++i) + term[i](); + }; + var cbd = function (a, b) { + mt(function () { cb(a, b); }); + }; + mt(function () { cbd = cb; }); + var cbf = function () { + var out = new u8(tot + 22), oe = o, cdl = tot - o; + tot = 0; + for (var i = 0; i < slft; ++i) { + var f = files[i]; + try { + var l = f.c.length; + wzh(out, tot, f, f.f, f.u, l); + var badd = 30 + f.f.length + exfl(f.extra); + var loc = tot + badd; + out.set(f.c, loc); + wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l; + } + catch (e) { + return cbd(e, null); + } + } + wzf(out, o, files.length, cdl, oe); + cbd(null, out); + }; + if (!lft) + cbf(); + var _loop_1 = function (i) { + var fn = k[i]; + var _a = r[fn], file = _a[0], p = _a[1]; + var c = crc(), size = file.length; + c.p(file); + var f = strToU8(fn), s = f.length; + var com = p.comment, m = com && strToU8(com), ms = m && m.length; + var exl = exfl(p.extra); + var compression = p.level == 0 ? 0 : 8; + var cbl = function (e, d) { + if (e) { + tAll(); + cbd(e, null); + } + else { + var l = d.length; + files[i] = mrg(p, { + size: size, + crc: c.d(), + c: d, + f: f, + m: m, + u: s != fn.length || (m && (com.length != ms)), + compression: compression + }); + o += 30 + s + exl + l; + tot += 76 + 2 * (s + exl) + (ms || 0) + l; + if (!--lft) + cbf(); + } + }; + if (s > 65535) + cbl(err(11, 0, 1), null); + if (!compression) + cbl(null, file); + else if (size < 160000) { + try { + cbl(null, deflateSync(file, p)); + } + catch (e) { + cbl(e, null); + } + } + else + term.push(deflate(file, p, cbl)); + }; + // Cannot use lft because it can decrease + for (var i = 0; i < slft; ++i) { + _loop_1(i); + } + return tAll; +} +/** + * Synchronously creates a ZIP file. Prefer using `zip` for better performance + * with more than one file. + * @param data The directory structure for the ZIP archive + * @param opts The main options, merged with per-file options + * @returns The generated ZIP archive + */ +function zipSync(data, opts) { + if (!opts) + opts = {}; + var r = {}; + var files = []; + fltn(data, '', r, opts); + var o = 0; + var tot = 0; + for (var fn in r) { + var _a = r[fn], file = _a[0], p = _a[1]; + var compression = p.level == 0 ? 0 : 8; + var f = strToU8(fn), s = f.length; + var com = p.comment, m = com && strToU8(com), ms = m && m.length; + var exl = exfl(p.extra); + if (s > 65535) + err(11); + var d = compression ? deflateSync(file, p) : file, l = d.length; + var c = crc(); + c.p(file); + files.push(mrg(p, { + size: file.length, + crc: c.d(), + c: d, + f: f, + m: m, + u: s != fn.length || (m && (com.length != ms)), + o: o, + compression: compression + })); + o += 30 + s + exl + l; + tot += 76 + 2 * (s + exl) + (ms || 0) + l; + } + var out = new u8(tot + 22), oe = o, cdl = tot - o; + for (var i = 0; i < files.length; ++i) { + var f = files[i]; + wzh(out, f.o, f, f.f, f.u, f.c.length); + var badd = 30 + f.f.length + exfl(f.extra); + out.set(f.c, f.o + badd); + wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0); + } + wzf(out, o, files.length, cdl, oe); + return out; +} +/** + * Streaming pass-through decompression for ZIP archives + */ +var UnzipPassThrough = /*#__PURE__*/ (function () { + function UnzipPassThrough() { + } + UnzipPassThrough.prototype.push = function (chunk, final) { + // same as ZipPassThrough: cast to retain Buffer ergonomics + this.ondata(null, chunk, final); + }; + UnzipPassThrough.compression = 0; + return UnzipPassThrough; +}()); +exports.UnzipPassThrough = UnzipPassThrough; +/** + * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for + * better performance. + */ +var UnzipInflate = /*#__PURE__*/ (function () { + /** + * Creates a DEFLATE decompression that can be used in ZIP archives + */ + function UnzipInflate() { + var _this = this; + this.i = new Inflate(function (dat, final) { + _this.ondata(null, dat, final); + }); + } + UnzipInflate.prototype.push = function (chunk, final) { + try { + this.i.push(chunk, final); + } + catch (e) { + this.ondata(e, null, final); + } + }; + UnzipInflate.compression = 8; + return UnzipInflate; +}()); +exports.UnzipInflate = UnzipInflate; +/** + * Asynchronous streaming DEFLATE decompression for ZIP archives + */ +var AsyncUnzipInflate = /*#__PURE__*/ (function () { + /** + * Creates a DEFLATE decompression that can be used in ZIP archives + */ + function AsyncUnzipInflate(_, sz) { + var _this = this; + if (sz < 320000) { + this.i = new Inflate(function (dat, final) { + _this.ondata(null, dat, final); + }); + } + else { + this.i = new AsyncInflate(function (err, dat, final) { + _this.ondata(err, dat, final); + }); + this.terminate = this.i.terminate; + } + } + AsyncUnzipInflate.prototype.push = function (chunk, final) { + if (this.i.terminate) + chunk = slc(chunk, 0); + this.i.push(chunk, final); + }; + AsyncUnzipInflate.compression = 8; + return AsyncUnzipInflate; +}()); +exports.AsyncUnzipInflate = AsyncUnzipInflate; +/** + * A ZIP archive decompression stream that emits files as they are discovered + */ +var Unzip = /*#__PURE__*/ (function () { + /** + * Creates a ZIP decompression stream + * @param cb The callback to call whenever a file in the ZIP archive is found + */ + function Unzip(cb) { + this.onfile = cb; + this.k = []; + this.o = { + 0: UnzipPassThrough + }; + this.p = et; + } + /** + * Pushes a chunk to be unzipped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Unzip.prototype.push = function (chunk, final) { + var _this = this; + if (!this.onfile) + err(5); + if (!this.p) + err(4); + if (this.c > 0) { + var len = Math.min(this.c, chunk.length); + var toAdd = chunk.subarray(0, len); + this.c -= len; + if (this.d) + this.d.push(toAdd, !this.c); + else + this.k[0].push(toAdd); + chunk = chunk.subarray(len); + if (chunk.length) + return this.push(chunk, final); + } + else { + var f = 0, i = 0, is = void 0, buf = void 0; + if (!this.p.length) + buf = chunk; + else if (!chunk.length) + buf = this.p; + else { + buf = new u8(this.p.length + chunk.length); + buf.set(this.p), buf.set(chunk, this.p.length); + } + var l = buf.length, oc = this.c, add = oc && this.d; + var _loop_2 = function () { + var sig = b4(buf, i); + if (sig == 0x4034B50) { + f = 1, is = i; + this_1.d = null; + this_1.c = 0; + var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28); + if (l > i + 30 + fnl + es) { + var chks_3 = []; + this_1.k.unshift(chks_3); + f = 2; + var lsc = b4(buf, i + 18), lsu = b4(buf, i + 22); + var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u); + var _a = z64hs(buf, i, es, 2, lsc, lsu, 0), sc_1 = _a[0], su_1 = _a[1], z64 = _a[3]; + if (dd) + sc_1 = -1 - z64; + i += es; + this_1.c = sc_1; + var d_1; + var file_1 = { + name: fn_1, + compression: cmp_1, + start: function () { + if (!file_1.ondata) + err(5); + if (!sc_1) + file_1.ondata(null, et, true); + else { + var ctr = _this.o[cmp_1]; + if (!ctr) + file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false); + d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1); + d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); }; + for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) { + var dat = chks_4[_i]; + d_1.push(dat, false); + } + if (_this.k[0] == chks_3 && _this.c) + _this.d = d_1; + else + d_1.push(et, true); + } + }, + terminate: function () { + if (d_1 && d_1.terminate) + d_1.terminate(); + } + }; + if (sc_1 >= 0) + file_1.size = sc_1, file_1.originalSize = su_1; + this_1.onfile(file_1); + } + return "break"; + } + else if (oc) { + if (sig == 0x8074B50) { + is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0; + return "break"; + } + else if (sig == 0x2014B50) { + is = i -= 4, f = 3, this_1.c = 0; + return "break"; + } + } + }; + var this_1 = this; + for (; i < l - 4; ++i) { + var state_1 = _loop_2(); + if (state_1 === "break") + break; + } + this.p = et; + if (oc < 0) { + var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i); + if (add) + add.push(dat, !!f); + else + this.k[+(f == 2)].push(dat); + } + if (f & 2) + return this.push(buf.subarray(i), final); + this.p = buf.subarray(i); + } + if (final) { + if (this.c) + err(13); + this.p = null; + } + }; + /** + * Registers a decoder with the stream, allowing for files compressed with + * the compression type provided to be expanded correctly + * @param decoder The decoder constructor + */ + Unzip.prototype.register = function (decoder) { + this.o[decoder.compression] = decoder; + }; + return Unzip; +}()); +exports.Unzip = Unzip; +var mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); }; +function unzip(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + var term = []; + var tAll = function () { + for (var i = 0; i < term.length; ++i) + term[i](); + }; + var files = {}; + var cbd = function (a, b) { + mt(function () { cb(a, b); }); + }; + mt(function () { cbd = cb; }); + var e = data.length - 22; + for (; b4(data, e) != 0x6054B50; --e) { + if (!e || data.length - e > 65558) { + cbd(err(13, 0, 1), null); + return tAll; + } + } + ; + var lft = b2(data, e + 8); + if (lft) { + var c = lft; + var o = b4(data, e + 16); + var z = b4(data, e - 20) == 0x7064B50; + if (z) { + var ze = b4(data, e - 12); + z = b4(data, ze) == 0x6064B50; + if (z) { + c = lft = b4(data, ze + 32); + o = b4(data, ze + 48); + } + } + var fltr = opts && opts.filter; + var _loop_3 = function (i) { + var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off); + o = no; + var cbl = function (e, d) { + if (e) { + tAll(); + cbd(e, null); + } + else { + if (d) + files[fn] = d; + if (!--lft) + cbd(null, files); + } + }; + if (!fltr || fltr({ + name: fn, + size: sc, + originalSize: su, + compression: c_1 + })) { + if (!c_1) + cbl(null, slc(data, b, b + sc)); + else if (c_1 == 8) { + var infl = data.subarray(b, b + sc); + // Synchronously decompress under 512KB, or barely-compressed data + if (su < 524288 || sc > 0.8 * su) { + try { + cbl(null, inflateSync(infl, { out: new u8(su) })); + } + catch (e) { + cbl(e, null); + } + } + else + term.push(inflate(infl, { size: su }, cbl)); + } + else + cbl(err(14, 'unknown compression type ' + c_1, 1), null); + } + else + cbl(null, null); + }; + for (var i = 0; i < c; ++i) { + _loop_3(i); + } + } + else + cbd(null, {}); + return tAll; +} +/** + * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better + * performance with more than one file. + * @param data The raw compressed ZIP file + * @param opts The ZIP extraction options + * @returns The decompressed files + */ +function unzipSync(data, opts) { + var files = {}; + var e = data.length - 22; + for (; b4(data, e) != 0x6054B50; --e) { + if (!e || data.length - e > 65558) + err(13); + } + ; + var c = b2(data, e + 8); + if (!c) + return {}; + var o = b4(data, e + 16); + var z = b4(data, e - 20) == 0x7064B50; + if (z) { + var ze = b4(data, e - 12); + z = b4(data, ze) == 0x6064B50; + if (z) { + c = b4(data, ze + 32); + o = b4(data, ze + 48); + } + } + var fltr = opts && opts.filter; + for (var i = 0; i < c; ++i) { + var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off); + o = no; + if (!fltr || fltr({ + name: fn, + size: sc, + originalSize: su, + compression: c_2 + })) { + if (!c_2) + files[fn] = slc(data, b, b + sc); + else if (c_2 == 8) + files[fn] = inflateSync(data.subarray(b, b + sc), { out: new u8(su) }); + else + err(14, 'unknown compression type ' + c_2); + } + } + return files; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/lib/index.d.ts b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d430faf2b555c978d66c89f46155b72c2c45a971 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/lib/index.d.ts @@ -0,0 +1,1539 @@ +/** + * Codes for errors generated within this library + */ +export declare const FlateErrorCode: { + readonly UnexpectedEOF: 0; + readonly InvalidBlockType: 1; + readonly InvalidLengthLiteral: 2; + readonly InvalidDistance: 3; + readonly StreamFinished: 4; + readonly NoStreamHandler: 5; + readonly InvalidHeader: 6; + readonly NoCallback: 7; + readonly InvalidUTF8: 8; + readonly ExtraFieldTooLong: 9; + readonly InvalidDate: 10; + readonly FilenameTooLong: 11; + readonly StreamFinishing: 12; + readonly InvalidZipData: 13; + readonly UnknownCompressionMethod: 14; +}; +/** + * An error generated within this library + */ +export interface FlateError extends Error { + /** + * The code associated with this error + */ + code: number; +} +/** + * Options for decompressing a DEFLATE stream + */ +export interface InflateStreamOptions { + /** + * The dictionary used to compress the original data. If no dictionary was used during compression, this option has no effect. + * + * Supplying the wrong dictionary during decompression usually yields corrupt output or causes an invalid distance error. + */ + dictionary?: Uint8Array; +} +/** + * Options for decompressing DEFLATE data + */ +export interface InflateOptions extends InflateStreamOptions { + /** + * The buffer into which to write the decompressed data. Saves memory if you know the decompressed size in advance. + * + * Note that if the decompression result is larger than the size of this buffer, it will be truncated to fit. + */ + out?: Uint8Array; +} +/** + * Options for decompressing a GZIP stream + */ +export interface GunzipStreamOptions extends InflateStreamOptions { +} +/** + * Options for decompressing GZIP data + */ +export interface GunzipOptions extends InflateStreamOptions { + /** + * The buffer into which to write the decompressed data. GZIP already encodes the output size, so providing this doesn't save memory. + * + * Note that if the decompression result is larger than the size of this buffer, it will be truncated to fit. + */ + out?: Uint8Array; +} +/** + * Options for decompressing a Zlib stream + */ +export interface UnzlibStreamOptions extends InflateStreamOptions { +} +/** + * Options for decompressing Zlib data + */ +export interface UnzlibOptions extends InflateOptions { +} +/** + * Options for compressing data into a DEFLATE format + */ +export interface DeflateOptions { + /** + * The level of compression to use, ranging from 0-9. + * + * 0 will store the data without compression. + * 1 is fastest but compresses the worst, 9 is slowest but compresses the best. + * The default level is 6. + * + * Typically, binary data benefits much more from higher values than text data. + * In both cases, higher values usually take disproportionately longer than the reduction in final size that results. + * + * For example, a 1 MB text file could: + * - become 1.01 MB with level 0 in 1ms + * - become 400 kB with level 1 in 10ms + * - become 320 kB with level 9 in 100ms + */ + level?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; + /** + * The memory level to use, ranging from 0-12. Increasing this increases speed and compression ratio at the cost of memory. + * + * Note that this is exponential: while level 0 uses 8 kB, level 4 uses 128 kB, level 8 uses 2 MB, and level 12 uses 32 MB. + * It is recommended not to lower the value below 4, since that tends to hurt performance. + * In addition, values above 8 tend to help very little on most data and can even hurt performance. + * + * The default value is automatically determined based on the size of the input data. + */ + mem?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12; + /** + * A buffer containing common byte sequences in the input data that can be used to significantly improve compression ratios. + * + * Dictionaries should be 32kB or smaller and include strings or byte sequences likely to appear in the input. + * The decompressor must supply the same dictionary as the compressor to extract the original data. + * + * Dictionaries only improve aggregate compression ratio when reused across multiple small inputs. They should typically not be used otherwise. + * + * Avoid using dictionaries with GZIP and ZIP to maximize software compatibility. + */ + dictionary?: Uint8Array; +} +/** + * Options for compressing data into a GZIP format + */ +export interface GzipOptions extends DeflateOptions { + /** + * When the file was last modified. Defaults to the current time. + * Set this to 0 to avoid revealing a modification date entirely. + */ + mtime?: Date | string | number; + /** + * The filename of the data. If the `gunzip` command is used to decompress the data, it will output a file + * with this name instead of the name of the compressed file. + */ + filename?: string; +} +/** + * Options for compressing data into a Zlib format + */ +export interface ZlibOptions extends DeflateOptions { +} +/** + * Handler for data (de)compression streams + * @param data The data output from the stream processor + * @param final Whether this is the final block + */ +export type FlateStreamHandler = (data: Uint8Array, final: boolean) => void; +/** + * Handler for asynchronous data (de)compression streams + * @param err Any error that occurred + * @param data The data output from the stream processor + * @param final Whether this is the final block + */ +export type AsyncFlateStreamHandler = (err: FlateError | null, data: Uint8Array, final: boolean) => void; +/** + * Handler for the asynchronous completion of (de)compression for a data chunk + * @param size The number of bytes that were processed. This is measured in terms of the input + * (i.e. compressed bytes for decompression, uncompressed bytes for compression.) + */ +export type AsyncFlateDrainHandler = (size: number) => void; +/** + * Callback for asynchronous (de)compression methods + * @param err Any error that occurred + * @param data The resulting data. Only present if `err` is null + */ +export type FlateCallback = (err: FlateError | null, data: Uint8Array) => void; +interface AsyncOptions { + /** + * Whether or not to "consume" the source data. This will make the typed array/buffer you pass in + * unusable but will increase performance and reduce memory usage. + */ + consume?: boolean; +} +/** + * Options for compressing data asynchronously into a DEFLATE format + */ +export interface AsyncDeflateOptions extends DeflateOptions, AsyncOptions { +} +/** + * Options for decompressing DEFLATE data asynchronously + */ +export interface AsyncInflateOptions extends AsyncOptions, InflateStreamOptions { + /** + * The original size of the data. Currently, the asynchronous API disallows + * writing into a buffer you provide; the best you can do is provide the + * size in bytes and be given back a new typed array. + */ + size?: number; +} +/** + * Options for compressing data asynchronously into a GZIP format + */ +export interface AsyncGzipOptions extends GzipOptions, AsyncOptions { +} +/** + * Options for decompressing GZIP data asynchronously + */ +export interface AsyncGunzipOptions extends AsyncOptions, InflateStreamOptions { +} +/** + * Options for compressing data asynchronously into a Zlib format + */ +export interface AsyncZlibOptions extends ZlibOptions, AsyncOptions { +} +/** + * Options for decompressing Zlib data asynchronously + */ +export interface AsyncUnzlibOptions extends AsyncInflateOptions { +} +/** + * A terminable compression/decompression process + */ +export interface AsyncTerminable { + /** + * Terminates the worker thread immediately. The callback will not be called. + */ + (): void; +} +/** + * Streaming DEFLATE compression + */ +export declare class Deflate { + /** + * Creates a DEFLATE stream + * @param opts The compression options + * @param cb The callback to call whenever data is deflated + */ + constructor(opts: DeflateOptions, cb?: FlateStreamHandler); + /** + * Creates a DEFLATE stream + * @param cb The callback to call whenever data is deflated + */ + constructor(cb?: FlateStreamHandler); + private b; + private s; + private o; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + private p; + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * deflated output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. A separate DEFLATE stream may be concatenated + * with the current output after a sync flush. + */ + flush(sync?: boolean): void; +} +/** + * Asynchronous streaming DEFLATE compression + */ +export declare class AsyncDeflate { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of uncompressed bytes buffered in the stream + */ + queuedSize: number; + /** + * Creates an asynchronous DEFLATE stream + * @param opts The compression options + * @param cb The callback to call whenever data is deflated + */ + constructor(opts: DeflateOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous DEFLATE stream + * @param cb The callback to call whenever data is deflated + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * deflated output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. A separate DEFLATE stream may be concatenated + * with the current output after a sync flush. + */ + flush(sync?: boolean): void; + /** + * A method to terminate the stream's internal worker. Subsequent calls to + * push() will silently fail. + */ + terminate: AsyncTerminable; +} +/** + * Asynchronously compresses data with DEFLATE without any wrapper + * @param data The data to compress + * @param opts The compression options + * @param cb The function to be called upon compression completion + * @returns A function that can be used to immediately terminate the compression + */ +export declare function deflate(data: Uint8Array, opts: AsyncDeflateOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously compresses data with DEFLATE without any wrapper + * @param data The data to compress + * @param cb The function to be called upon compression completion + */ +export declare function deflate(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Compresses data with DEFLATE without any wrapper + * @param data The data to compress + * @param opts The compression options + * @returns The deflated version of the data + */ +export declare function deflateSync(data: Uint8Array, opts?: DeflateOptions): Uint8Array; +/** + * Streaming DEFLATE decompression + */ +export declare class Inflate { + private s; + private o; + private p; + private d; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + /** + * Creates a DEFLATE decompression stream + * @param opts The decompression options + * @param cb The callback to call whenever data is inflated + */ + constructor(opts: InflateStreamOptions, cb?: FlateStreamHandler); + /** + * Creates a DEFLATE decompression stream + * @param cb The callback to call whenever data is inflated + */ + constructor(cb?: FlateStreamHandler); + private e; + private c; + /** + * Pushes a chunk to be inflated + * @param chunk The chunk to push + * @param final Whether this is the final chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Asynchronous streaming DEFLATE decompression + */ +export declare class AsyncInflate { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of compressed bytes buffered in the stream + */ + queuedSize: number; + /** + * Creates an asynchronous DEFLATE decompression stream + * @param opts The decompression options + * @param cb The callback to call whenever data is inflated + */ + constructor(opts: InflateStreamOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous DEFLATE decompression stream + * @param cb The callback to call whenever data is inflated + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Pushes a chunk to be inflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * A method to terminate the stream's internal worker. Subsequent calls to + * push() will silently fail. + */ + terminate: AsyncTerminable; +} +/** + * Asynchronously expands DEFLATE data with no wrapper + * @param data The data to decompress + * @param opts The decompression options + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function inflate(data: Uint8Array, opts: AsyncInflateOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously expands DEFLATE data with no wrapper + * @param data The data to decompress + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function inflate(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Expands DEFLATE data with no wrapper + * @param data The data to decompress + * @returns The decompressed version of the data + */ +export declare function inflateSync(data: Uint8Array): Uint8Array; +/** + * Expands DEFLATE data with no wrapper + * @param data The data to decompress + * @param opts The decompression options + * @returns The decompressed version of the data + */ +export declare function inflateSync(data: Uint8Array, opts?: InflateOptions): Uint8Array; +/** + * Streaming GZIP compression + */ +export declare class Gzip { + private c; + private l; + private v; + private o; + private s; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + /** + * Creates a GZIP stream + * @param opts The compression options + * @param cb The callback to call whenever data is deflated + */ + constructor(opts: GzipOptions, cb?: FlateStreamHandler); + /** + * Creates a GZIP stream + * @param cb The callback to call whenever data is deflated + */ + constructor(cb?: FlateStreamHandler); + /** + * Pushes a chunk to be GZIPped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + private p; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * GZIPped output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. + */ + flush(sync?: boolean): void; +} +/** + * Asynchronous streaming GZIP compression + */ +export declare class AsyncGzip { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of uncompressed bytes buffered in the stream + */ + queuedSize: number; + /** + * Creates an asynchronous GZIP stream + * @param opts The compression options + * @param cb The callback to call whenever data is deflated + */ + constructor(opts: GzipOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous GZIP stream + * @param cb The callback to call whenever data is deflated + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Pushes a chunk to be GZIPped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * GZIPped output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. + */ + flush(sync?: boolean): void; + /** + * A method to terminate the stream's internal worker. Subsequent calls to + * push() will silently fail. + */ + terminate: AsyncTerminable; +} +/** + * Asynchronously compresses data with GZIP + * @param data The data to compress + * @param opts The compression options + * @param cb The function to be called upon compression completion + * @returns A function that can be used to immediately terminate the compression + */ +export declare function gzip(data: Uint8Array, opts: AsyncGzipOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously compresses data with GZIP + * @param data The data to compress + * @param cb The function to be called upon compression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function gzip(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Compresses data with GZIP + * @param data The data to compress + * @param opts The compression options + * @returns The gzipped version of the data + */ +export declare function gzipSync(data: Uint8Array, opts?: GzipOptions): Uint8Array; +/** + * Handler for new GZIP members in concatenated GZIP streams. Useful for building indices used to perform random-access reads on compressed files. + * @param offset The offset of the new member relative to the start of the stream + */ +export type GunzipMemberHandler = (offset: number) => void; +/** + * Streaming single or multi-member GZIP decompression + */ +export declare class Gunzip { + private v; + private r; + private o; + private p; + private s; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + /** + * The handler to call whenever a new GZIP member is found + */ + onmember?: GunzipMemberHandler; + /** + * Creates a GUNZIP stream + * @param opts The decompression options + * @param cb The callback to call whenever data is inflated + */ + constructor(opts: GunzipStreamOptions, cb?: FlateStreamHandler); + /** + * Creates a GUNZIP stream + * @param cb The callback to call whenever data is inflated + */ + constructor(cb?: FlateStreamHandler); + /** + * Pushes a chunk to be GUNZIPped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Asynchronous streaming single or multi-member GZIP decompression + */ +export declare class AsyncGunzip { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of compressed bytes buffered in the stream + */ + queuedSize: number; + /** + * The handler to call whenever a new GZIP member is found + */ + onmember?: GunzipMemberHandler; + /** + * Creates an asynchronous GUNZIP stream + * @param opts The decompression options + * @param cb The callback to call whenever data is inflated + */ + constructor(opts: GunzipStreamOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous GUNZIP stream + * @param cb The callback to call whenever data is inflated + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Pushes a chunk to be GUNZIPped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * A method to terminate the stream's internal worker. Subsequent calls to + * push() will silently fail. + */ + terminate: AsyncTerminable; +} +/** + * Asynchronously expands GZIP data + * @param data The data to decompress + * @param opts The decompression options + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function gunzip(data: Uint8Array, opts: AsyncGunzipOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously expands GZIP data + * @param data The data to decompress + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function gunzip(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Expands GZIP data + * @param data The data to decompress + * @returns The decompressed version of the data + */ +export declare function gunzipSync(data: Uint8Array): Uint8Array; +/** + * Expands GZIP data + * @param data The data to decompress + * @param opts The decompression options + * @returns The decompressed version of the data + */ +export declare function gunzipSync(data: Uint8Array, opts?: GunzipOptions): Uint8Array; +/** + * Streaming Zlib compression + */ +export declare class Zlib { + private c; + private v; + private o; + private s; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + /** + * Creates a Zlib stream + * @param opts The compression options + * @param cb The callback to call whenever data is deflated + */ + constructor(opts: ZlibOptions, cb?: FlateStreamHandler); + /** + * Creates a Zlib stream + * @param cb The callback to call whenever data is deflated + */ + constructor(cb?: FlateStreamHandler); + /** + * Pushes a chunk to be zlibbed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + private p; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * zlibbed output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. + */ + flush(sync?: boolean): void; +} +/** + * Asynchronous streaming Zlib compression + */ +export declare class AsyncZlib { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of uncompressed bytes buffered in the stream + */ + queuedSize: number; + /** + * Creates an asynchronous Zlib stream + * @param opts The compression options + * @param cb The callback to call whenever data is deflated + */ + constructor(opts: ZlibOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous Zlib stream + * @param cb The callback to call whenever data is deflated + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * zlibbed output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. + */ + flush(sync?: boolean): void; + /** + * A method to terminate the stream's internal worker. Subsequent calls to + * push() will silently fail. + */ + terminate: AsyncTerminable; +} +/** + * Asynchronously compresses data with Zlib + * @param data The data to compress + * @param opts The compression options + * @param cb The function to be called upon compression completion + */ +export declare function zlib(data: Uint8Array, opts: AsyncZlibOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously compresses data with Zlib + * @param data The data to compress + * @param cb The function to be called upon compression completion + * @returns A function that can be used to immediately terminate the compression + */ +export declare function zlib(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Compress data with Zlib + * @param data The data to compress + * @param opts The compression options + * @returns The zlib-compressed version of the data + */ +export declare function zlibSync(data: Uint8Array, opts?: ZlibOptions): Uint8Array; +/** + * Streaming Zlib decompression + */ +export declare class Unzlib { + private v; + private p; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + /** + * Creates a Zlib decompression stream + * @param opts The decompression options + * @param cb The callback to call whenever data is inflated + */ + constructor(opts: UnzlibStreamOptions, cb?: FlateStreamHandler); + /** + * Creates a Zlib decompression stream + * @param cb The callback to call whenever data is inflated + */ + constructor(cb?: FlateStreamHandler); + /** + * Pushes a chunk to be unzlibbed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Asynchronous streaming Zlib decompression + */ +export declare class AsyncUnzlib { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of compressed bytes buffered in the stream + */ + queuedSize: number; + /** + * Creates an asynchronous Zlib decompression stream + * @param opts The decompression options + * @param cb The callback to call whenever data is inflated + */ + constructor(opts: UnzlibStreamOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous Zlib decompression stream + * @param cb The callback to call whenever data is inflated + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Pushes a chunk to be decompressed from Zlib + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * A method to terminate the stream's internal worker. Subsequent calls to + * push() will silently fail. + */ + terminate: AsyncTerminable; +} +/** + * Asynchronously expands Zlib data + * @param data The data to decompress + * @param opts The decompression options + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function unzlib(data: Uint8Array, opts: AsyncUnzlibOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously expands Zlib data + * @param data The data to decompress + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function unzlib(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Expands Zlib data + * @param data The data to decompress + * @returns The decompressed version of the data + */ +export declare function unzlibSync(data: Uint8Array): Uint8Array; +/** + * Expands Zlib data + * @param data The data to decompress + * @param opts The decompression options + * @returns The decompressed version of the data + */ +export declare function unzlibSync(data: Uint8Array, opts?: UnzlibOptions): Uint8Array; +export { gzip as compress, AsyncGzip as AsyncCompress }; +export { gzipSync as compressSync, Gzip as Compress }; +/** + * Streaming GZIP, Zlib, or raw DEFLATE decompression + */ +export declare class Decompress { + private G; + private I; + private Z; + private o; + private s; + private p; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + /** + * Creates a decompression stream + * @param opts The decompression options + * @param cb The callback to call whenever data is decompressed + */ + constructor(opts: InflateStreamOptions, cb?: FlateStreamHandler); + /** + * Creates a decompression stream + * @param cb The callback to call whenever data is decompressed + */ + constructor(cb?: FlateStreamHandler); + private i; + /** + * Pushes a chunk to be decompressed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression + */ +export declare class AsyncDecompress { + private G; + private I; + private Z; + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of compressed bytes buffered in the stream + */ + queuedSize: number; + /** + * Creates an asynchronous decompression stream + * @param opts The decompression options + * @param cb The callback to call whenever data is decompressed + */ + constructor(opts: InflateStreamOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous decompression stream + * @param cb The callback to call whenever data is decompressed + */ + constructor(cb?: AsyncFlateStreamHandler); + private i; + /** + * Pushes a chunk to be decompressed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Asynchrononously expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format + * @param data The data to decompress + * @param opts The decompression options + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function decompress(data: Uint8Array, opts: AsyncInflateOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchrononously expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format + * @param data The data to decompress + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function decompress(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format + * @param data The data to decompress + * @param opts The decompression options + * @returns The decompressed version of the data + */ +export declare function decompressSync(data: Uint8Array, opts?: InflateOptions): Uint8Array; +/** + * Attributes for files added to a ZIP archive object + */ +export interface ZipAttributes { + /** + * The operating system of origin for this file. The value is defined + * by PKZIP's APPNOTE.txt, section 4.4.2.2. For example, 0 (the default) + * is MS/DOS, 3 is Unix, 19 is macOS. + */ + os?: number; + /** + * The file's attributes. These are traditionally somewhat complicated + * and platform-dependent, so using them is scarcely necessary. However, + * here is a representation of what this is, bit by bit: + * + * `TTTTugtrwxrwxrwx0000000000ADVSHR` + * + * TTTT = file type (rarely useful) + * + * u = setuid, g = setgid, t = sticky + * + * rwx = user permissions, rwx = group permissions, rwx = other permissions + * + * 0000000000 = unused + * + * A = archive, D = directory, V = volume label, S = system file, H = hidden, R = read-only + * + * If you want to set the Unix permissions, for instance, just bit shift by 16, e.g. 0o644 << 16. + * Note that attributes usually only work in conjunction with the `os` setting: you must use + * `os` = 3 (Unix) if you want to set Unix permissions + */ + attrs?: number; + /** + * Extra metadata to add to the file. This field is defined by PKZIP's APPNOTE.txt, + * section 4.4.28. At most 65,535 bytes may be used in each ID. The ID must be an + * integer between 0 and 65,535, inclusive. + * + * This field is incredibly rare and almost never needed except for compliance with + * proprietary standards and software. + */ + extra?: Record; + /** + * The comment to attach to the file. This field is defined by PKZIP's APPNOTE.txt, + * section 4.4.26. The comment must be at most 65,535 bytes long UTF-8 encoded. This + * field is not read by consumer software. + */ + comment?: string; + /** + * When the file was last modified. Defaults to the current time. + */ + mtime?: GzipOptions['mtime']; +} +/** + * Options for creating a ZIP archive + */ +export interface ZipOptions extends DeflateOptions, ZipAttributes { +} +/** + * Options for expanding a ZIP archive + */ +export interface UnzipOptions { + /** + * A filter function to extract only certain files from a ZIP archive + */ + filter?: UnzipFileFilter; +} +/** + * Options for asynchronously creating a ZIP archive + */ +export interface AsyncZipOptions extends AsyncDeflateOptions, ZipAttributes { +} +/** + * Options for asynchronously expanding a ZIP archive + */ +export interface AsyncUnzipOptions extends UnzipOptions { +} +/** + * A file that can be used to create a ZIP archive + */ +export type ZippableFile = Uint8Array | Zippable | [Uint8Array | Zippable, ZipOptions]; +/** + * A file that can be used to asynchronously create a ZIP archive + */ +export type AsyncZippableFile = Uint8Array | AsyncZippable | [Uint8Array | AsyncZippable, AsyncZipOptions]; +/** + * The complete directory structure of a ZIPpable archive + */ +export interface Zippable { + [path: string]: ZippableFile; +} +/** + * The complete directory structure of an asynchronously ZIPpable archive + */ +export interface AsyncZippable { + [path: string]: AsyncZippableFile; +} +/** + * An unzipped archive. The full path of each file is used as the key, + * and the file is the value + */ +export interface Unzipped { + [path: string]: Uint8Array; +} +/** + * Handler for string generation streams + * @param data The string output from the stream processor + * @param final Whether this is the final block + */ +export type StringStreamHandler = (data: string, final: boolean) => void; +/** + * Callback for asynchronous ZIP decompression + * @param err Any error that occurred + * @param data The decompressed ZIP archive + */ +export type UnzipCallback = (err: FlateError | null, data: Unzipped) => void; +/** + * Handler for streaming ZIP decompression + * @param file The file that was found in the archive + */ +export type UnzipFileHandler = (file: UnzipFile) => void; +/** + * Streaming UTF-8 decoding + */ +export declare class DecodeUTF8 { + private p; + private t; + /** + * Creates a UTF-8 decoding stream + * @param cb The callback to call whenever data is decoded + */ + constructor(cb?: StringStreamHandler); + /** + * Pushes a chunk to be decoded from UTF-8 binary + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * The handler to call whenever data is available + */ + ondata: StringStreamHandler; +} +/** + * Streaming UTF-8 encoding + */ +export declare class EncodeUTF8 { + private d; + /** + * Creates a UTF-8 decoding stream + * @param cb The callback to call whenever data is encoded + */ + constructor(cb?: FlateStreamHandler); + /** + * Pushes a chunk to be encoded to UTF-8 + * @param chunk The string data to push + * @param final Whether this is the last chunk + */ + push(chunk: string, final?: boolean): void; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; +} +/** + * Converts a string into a Uint8Array for use with compression/decompression methods + * @param str The string to encode + * @param latin1 Whether or not to interpret the data as Latin-1. This should + * not need to be true unless decoding a binary string. + * @returns The string encoded in UTF-8/Latin-1 binary + */ +export declare function strToU8(str: string, latin1?: boolean): Uint8Array; +/** + * Converts a Uint8Array to a string + * @param dat The data to decode to string + * @param latin1 Whether or not to interpret the data as Latin-1. This should + * not need to be true unless encoding to binary string. + * @returns The original UTF-8/Latin-1 string + */ +export declare function strFromU8(dat: Uint8Array, latin1?: boolean): string; +/** + * A stream that can be used to create a file in a ZIP archive + */ +export interface ZipInputFile extends ZipAttributes { + /** + * The filename to associate with the data provided to this stream. If you + * want a file in a subdirectory, use forward slashes as a separator (e.g. + * `directory/filename.ext`). This will still work on Windows. + */ + filename: string; + /** + * The size of the file in bytes. This attribute may be invalid after + * the file is added to the ZIP archive; it must be correct only before the + * stream completes. + * + * If you don't want to have to compute this yourself, consider extending the + * ZipPassThrough class and overriding its process() method, or using one of + * ZipDeflate or AsyncZipDeflate. + */ + size: number; + /** + * A CRC of the original file contents. This attribute may be invalid after + * the file is added to the ZIP archive; it must be correct only before the + * stream completes. + * + * If you don't want to have to generate this yourself, consider extending the + * ZipPassThrough class and overriding its process() method, or using one of + * ZipDeflate or AsyncZipDeflate. + */ + crc: number; + /** + * The compression format for the data stream. This number is determined by + * the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no + * compression, 8 = deflate, 14 = LZMA + */ + compression: number; + /** + * Bits 1 and 2 of the general purpose bit flag, specified in PKZIP's + * APPNOTE.txt, section 4.4.4. Should be between 0 and 3. This is unlikely + * to be necessary. + */ + flag?: number; + /** + * The handler to be called when data is added. After passing this stream to + * the ZIP file object, this handler will always be defined. To call it: + * + * `stream.ondata(error, chunk, final)` + * + * error = any error that occurred (null if there was no error) + * + * chunk = a Uint8Array of the data that was added (null if there was an + * error) + * + * final = boolean, whether this is the final chunk in the stream + */ + ondata?: AsyncFlateStreamHandler; + /** + * A method called when the stream is no longer needed, for clean-up + * purposes. This will not always be called after the stream completes, + * so you may wish to call this.terminate() after the final chunk is + * processed if you have clean-up logic. + */ + terminate?: AsyncTerminable; +} +/** + * A pass-through stream to keep data uncompressed in a ZIP archive. + */ +export declare class ZipPassThrough implements ZipInputFile { + filename: string; + crc: number; + size: number; + compression: number; + os?: number; + attrs?: number; + comment?: string; + extra?: Record; + mtime?: GzipOptions['mtime']; + ondata: AsyncFlateStreamHandler; + private c; + /** + * Creates a pass-through stream that can be added to ZIP archives + * @param filename The filename to associate with this data stream + */ + constructor(filename: string); + /** + * Processes a chunk and pushes to the output stream. You can override this + * method in a subclass for custom behavior, but by default this passes + * the data through. You must call this.ondata(err, chunk, final) at some + * point in this method. + * @param chunk The chunk to process + * @param final Whether this is the last chunk + */ + protected process(chunk: Uint8Array, final: boolean): void; + /** + * Pushes a chunk to be added. If you are subclassing this with a custom + * compression algorithm, note that you must push data from the source + * file only, pre-compression. + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate + * for better performance + */ +export declare class ZipDeflate implements ZipInputFile { + filename: string; + crc: number; + size: number; + compression: number; + flag: 0 | 1 | 2 | 3; + os?: number; + attrs?: number; + comment?: string; + extra?: Record; + mtime?: GzipOptions['mtime']; + ondata: AsyncFlateStreamHandler; + private d; + /** + * Creates a DEFLATE stream that can be added to ZIP archives + * @param filename The filename to associate with this data stream + * @param opts The compression options + */ + constructor(filename: string, opts?: DeflateOptions); + private process; + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Asynchronous streaming DEFLATE compression for ZIP archives + */ +export declare class AsyncZipDeflate implements ZipInputFile { + filename: string; + crc: number; + size: number; + compression: number; + flag: 0 | 1 | 2 | 3; + os?: number; + attrs?: number; + comment?: string; + extra?: Record; + mtime?: GzipOptions['mtime']; + ondata: AsyncFlateStreamHandler; + private d; + terminate: AsyncTerminable; + /** + * Creates an asynchronous DEFLATE stream that can be added to ZIP archives + * @param filename The filename to associate with this data stream + * @param opts The compression options + */ + constructor(filename: string, opts?: DeflateOptions); + private process; + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * A zippable archive to which files can incrementally be added + */ +export declare class Zip { + private u; + private d; + /** + * Creates an empty ZIP archive to which files can be added + * @param cb The callback to call whenever data for the generated ZIP archive + * is available + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Adds a file to the ZIP archive + * @param file The file stream to add + */ + add(file: ZipInputFile): void; + /** + * Ends the process of adding files and prepares to emit the final chunks. + * This *must* be called after adding all desired files for the resulting + * ZIP file to work properly. + */ + end(): void; + private e; + /** + * A method to terminate any internal workers used by the stream. Subsequent + * calls to add() will fail. + */ + terminate(): void; + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; +} +/** + * Asynchronously creates a ZIP file + * @param data The directory structure for the ZIP archive + * @param opts The main options, merged with per-file options + * @param cb The callback to call with the generated ZIP archive + * @returns A function that can be used to immediately terminate the compression + */ +export declare function zip(data: AsyncZippable, opts: AsyncZipOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously creates a ZIP file + * @param data The directory structure for the ZIP archive + * @param cb The callback to call with the generated ZIP archive + * @returns A function that can be used to immediately terminate the compression + */ +export declare function zip(data: AsyncZippable, cb: FlateCallback): AsyncTerminable; +/** + * Synchronously creates a ZIP file. Prefer using `zip` for better performance + * with more than one file. + * @param data The directory structure for the ZIP archive + * @param opts The main options, merged with per-file options + * @returns The generated ZIP archive + */ +export declare function zipSync(data: Zippable, opts?: ZipOptions): Uint8Array; +/** + * A decoder for files in ZIP streams + */ +export interface UnzipDecoder { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * Pushes a chunk to be decompressed + * @param chunk The data in this chunk. Do not consume (detach) this buffer. + * @param final Whether this is the last chunk in the data stream + */ + push(chunk: Uint8Array, final: boolean): void; + /** + * A method to terminate any internal workers used by the stream. Subsequent + * calls to push() should silently fail. + */ + terminate?: AsyncTerminable; +} +/** + * A constructor for a decoder for unzip streams + */ +export interface UnzipDecoderConstructor { + /** + * Creates an instance of the decoder + * @param filename The name of the file + * @param size The compressed size of the file + * @param originalSize The original size of the file + */ + new (filename: string, size?: number, originalSize?: number): UnzipDecoder; + /** + * The compression format for the data stream. This number is determined by + * the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no + * compression, 8 = deflate, 14 = LZMA + */ + compression: number; +} +/** + * Information about a file to be extracted from a ZIP archive + */ +export interface UnzipFileInfo { + /** + * The name of the file + */ + name: string; + /** + * The compressed size of the file + */ + size: number; + /** + * The original size of the file + */ + originalSize: number; + /** + * The compression format for the data stream. This number is determined by + * the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no + * compression, 8 = deflate, 14 = LZMA. If the filter function returns true + * but this value is not 8, the unzip function will throw. + */ + compression: number; +} +/** + * A filter for files to be extracted during the unzipping process + * @param file The info for the current file being processed + * @returns Whether or not to extract the current file + */ +export type UnzipFileFilter = (file: UnzipFileInfo) => boolean; +/** + * Streaming file extraction from ZIP archives + */ +export interface UnzipFile { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The name of the file + */ + name: string; + /** + * The compression format for the data stream. This number is determined by + * the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no + * compression, 8 = deflate, 14 = LZMA. If start() is called but there is no + * decompression stream available for this method, start() will throw. + */ + compression: number; + /** + * The compressed size of the file. Will not be present for archives created + * in a streaming fashion. + */ + size?: number; + /** + * The original size of the file. Will not be present for archives created + * in a streaming fashion. + */ + originalSize?: number; + /** + * Starts reading from the stream. Calling this function will always enable + * this stream, but ocassionally the stream will be enabled even without + * this being called. + */ + start(): void; + /** + * A method to terminate any internal workers used by the stream. ondata + * will not be called any further. + */ + terminate: AsyncTerminable; +} +/** + * Streaming pass-through decompression for ZIP archives + */ +export declare class UnzipPassThrough implements UnzipDecoder { + static compression: number; + ondata: AsyncFlateStreamHandler; + push(chunk: Uint8Array, final: boolean): void; +} +/** + * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for + * better performance. + */ +export declare class UnzipInflate implements UnzipDecoder { + static compression: number; + private i; + ondata: AsyncFlateStreamHandler; + /** + * Creates a DEFLATE decompression that can be used in ZIP archives + */ + constructor(); + push(chunk: Uint8Array, final: boolean): void; +} +/** + * Asynchronous streaming DEFLATE decompression for ZIP archives + */ +export declare class AsyncUnzipInflate implements UnzipDecoder { + static compression: number; + private i; + ondata: AsyncFlateStreamHandler; + terminate: AsyncTerminable; + /** + * Creates a DEFLATE decompression that can be used in ZIP archives + */ + constructor(_: string, sz?: number); + push(chunk: Uint8Array, final: boolean): void; +} +/** + * A ZIP archive decompression stream that emits files as they are discovered + */ +export declare class Unzip { + private d; + private c; + private p; + private k; + private o; + /** + * Creates a ZIP decompression stream + * @param cb The callback to call whenever a file in the ZIP archive is found + */ + constructor(cb?: UnzipFileHandler); + /** + * Pushes a chunk to be unzipped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * Registers a decoder with the stream, allowing for files compressed with + * the compression type provided to be expanded correctly + * @param decoder The decoder constructor + */ + register(decoder: UnzipDecoderConstructor): void; + /** + * The handler to call whenever a file is discovered + */ + onfile: UnzipFileHandler; +} +/** + * Asynchronously decompresses a ZIP archive + * @param data The raw compressed ZIP file + * @param opts The ZIP extraction options + * @param cb The callback to call with the decompressed files + * @returns A function that can be used to immediately terminate the unzipping + */ +export declare function unzip(data: Uint8Array, opts: AsyncUnzipOptions, cb: UnzipCallback): AsyncTerminable; +/** + * Asynchronously decompresses a ZIP archive + * @param data The raw compressed ZIP file + * @param cb The callback to call with the decompressed files + * @returns A function that can be used to immediately terminate the unzipping + */ +export declare function unzip(data: Uint8Array, cb: UnzipCallback): AsyncTerminable; +/** + * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better + * performance with more than one file. + * @param data The raw compressed ZIP file + * @param opts The ZIP extraction options + * @returns The decompressed files + */ +export declare function unzipSync(data: Uint8Array, opts?: UnzipOptions): Unzipped; diff --git a/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/lib/node-worker.cjs b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/lib/node-worker.cjs new file mode 100644 index 0000000000000000000000000000000000000000..6546f8e8d7aa05fd379331631cbba0271764952c --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/lib/node-worker.cjs @@ -0,0 +1,36 @@ +"use strict"; +var _a; +// Mediocre shim +var Worker; +var isMarkedAsUntransferable; +var workerAdd = ";var __w=require('worker_threads');__w.parentPort.on('message',function(m){onmessage({data:m})}),postMessage=function(m,t){__w.parentPort.postMessage(m,t)},close=process.exit;self=global"; +try { + (_a = require('worker_threads'), Worker = _a.Worker, isMarkedAsUntransferable = _a.isMarkedAsUntransferable); +} +catch (e) { +} +exports.default = Worker ? function (c, _, msg, transfer, cb) { + var done = false; + var w = new Worker(c + workerAdd, { eval: true }) + .on('error', function (e) { return cb(e, null); }) + .on('message', function (m) { return cb(null, m); }) + .on('exit', function (c) { + if (c && !done) + cb(new Error('exited with code ' + c), null); + }); + if (isMarkedAsUntransferable) + transfer = transfer.filter(function (t) { return !isMarkedAsUntransferable(t); }); + w.postMessage(msg, transfer); + w.terminate = function () { + done = true; + return Worker.prototype.terminate.call(w); + }; + return w; +} : function (_, __, ___, ____, cb) { + setImmediate(function () { return cb(new Error('async operations unsupported - update to Node 12+ (or Node 10-11 with the --experimental-worker CLI flag)'), null); }); + var NOP = function () { }; + return { + terminate: NOP, + postMessage: NOP + }; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/lib/node.cjs b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/lib/node.cjs new file mode 100644 index 0000000000000000000000000000000000000000..2af184ee06114ac0939176ed868915d2d48a903a --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/lib/node.cjs @@ -0,0 +1,2733 @@ +"use strict"; +// DEFLATE is a complex format; to read this code, you should probably check the RFC first: +// https://tools.ietf.org/html/rfc1951 +// You may also wish to take a look at the guide I made about this program: +// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad +exports.deflate = deflate; +exports.deflateSync = deflateSync; +exports.inflate = inflate; +exports.inflateSync = inflateSync; +exports.gzip = gzip; +exports.compress = gzip; +exports.gzipSync = gzipSync; +exports.compressSync = gzipSync; +exports.gunzip = gunzip; +exports.gunzipSync = gunzipSync; +exports.zlib = zlib; +exports.zlibSync = zlibSync; +exports.unzlib = unzlib; +exports.unzlibSync = unzlibSync; +exports.gzip = gzip; +exports.compress = gzip; +exports.decompress = decompress; +exports.decompressSync = decompressSync; +exports.strToU8 = strToU8; +exports.strFromU8 = strFromU8; +exports.zip = zip; +exports.zipSync = zipSync; +exports.unzip = unzip; +exports.unzipSync = unzipSync; +// Some of the following code is similar to that of UZIP.js: +// https://github.com/photopea/UZIP.js +// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size. +// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint +// is better for memory in most engines (I *think*). +var _a; +// Mediocre shim +var Worker; +var isMarkedAsUntransferable; +var workerAdd = ";var __w=require('worker_threads');__w.parentPort.on('message',function(m){onmessage({data:m})}),postMessage=function(m,t){__w.parentPort.postMessage(m,t)},close=process.exit;self=global"; +try { + (_a = require('worker_threads'), Worker = _a.Worker, isMarkedAsUntransferable = _a.isMarkedAsUntransferable); +} +catch (e) { +} +var node_worker_1 = {}; +node_worker_1["default"] = Worker ? function (c, _, msg, transfer, cb) { + var done = false; + var w = new Worker(c + workerAdd, { eval: true }) + .on('error', function (e) { return cb(e, null); }) + .on('message', function (m) { return cb(null, m); }) + .on('exit', function (c) { + if (c && !done) + cb(new Error('exited with code ' + c), null); + }); + if (isMarkedAsUntransferable) + transfer = transfer.filter(function (t) { return !isMarkedAsUntransferable(t); }); + w.postMessage(msg, transfer); + w.terminate = function () { + done = true; + return Worker.prototype.terminate.call(w); + }; + return w; +} : function (_, __, ___, ____, cb) { + setImmediate(function () { return cb(new Error('async operations unsupported - update to Node 12+ (or Node 10-11 with the --experimental-worker CLI flag)'), null); }); + var NOP = function () { }; + return { + terminate: NOP, + postMessage: NOP + }; +}; + +// aliases for shorter compressed code (most minifers don't do this) +var u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array; +// fixed length extra bits +var fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]); +// fixed distance extra bits +var fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, /* unused */ 0, 0]); +// code length index map +var clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]); +// get base, reverse index map from extra bits +var freb = function (eb, start) { + var b = new u16(31); + for (var i = 0; i < 31; ++i) { + b[i] = start += 1 << eb[i - 1]; + } + // numbers here are at max 18 bits + var r = new i32(b[30]); + for (var i = 1; i < 30; ++i) { + for (var j = b[i]; j < b[i + 1]; ++j) { + r[j] = ((j - b[i]) << 5) | i; + } + } + return { b: b, r: r }; +}; +var _a = freb(fleb, 2), fl = _a.b, revfl = _a.r; +// we can ignore the fact that the other numbers are wrong; they never happen anyway +fl[28] = 258, revfl[258] = 28; +var _b = freb(fdeb, 0), fd = _b.b, revfd = _b.r; +// map of value to reverse (assuming 16 bits) +var rev = new u16(32768); +for (var i = 0; i < 32768; ++i) { + // reverse table algorithm from SO + var x = ((i & 0xAAAA) >> 1) | ((i & 0x5555) << 1); + x = ((x & 0xCCCC) >> 2) | ((x & 0x3333) << 2); + x = ((x & 0xF0F0) >> 4) | ((x & 0x0F0F) << 4); + rev[i] = (((x & 0xFF00) >> 8) | ((x & 0x00FF) << 8)) >> 1; +} +// create huffman tree from u8 "map": index -> code length for code index +// mb (max bits) must be at most 15 +// TODO: optimize/split up? +var hMap = (function (cd, mb, r) { + var s = cd.length; + // index + var i = 0; + // u16 "map": index -> # of codes with bit length = index + var l = new u16(mb); + // length of cd must be 288 (total # of codes) + for (; i < s; ++i) { + if (cd[i]) + ++l[cd[i] - 1]; + } + // u16 "map": index -> minimum code for bit length = index + var le = new u16(mb); + for (i = 1; i < mb; ++i) { + le[i] = (le[i - 1] + l[i - 1]) << 1; + } + var co; + if (r) { + // u16 "map": index -> number of actual bits, symbol for code + co = new u16(1 << mb); + // bits to remove for reverser + var rvb = 15 - mb; + for (i = 0; i < s; ++i) { + // ignore 0 lengths + if (cd[i]) { + // num encoding both symbol and bits read + var sv = (i << 4) | cd[i]; + // free bits + var r_1 = mb - cd[i]; + // start value + var v = le[cd[i] - 1]++ << r_1; + // m is end value + for (var m = v | ((1 << r_1) - 1); v <= m; ++v) { + // every 16 bit value starting with the code yields the same result + co[rev[v] >> rvb] = sv; + } + } + } + } + else { + co = new u16(s); + for (i = 0; i < s; ++i) { + if (cd[i]) { + co[i] = rev[le[cd[i] - 1]++] >> (15 - cd[i]); + } + } + } + return co; +}); +// fixed length tree +var flt = new u8(288); +for (var i = 0; i < 144; ++i) + flt[i] = 8; +for (var i = 144; i < 256; ++i) + flt[i] = 9; +for (var i = 256; i < 280; ++i) + flt[i] = 7; +for (var i = 280; i < 288; ++i) + flt[i] = 8; +// fixed distance tree +var fdt = new u8(32); +for (var i = 0; i < 32; ++i) + fdt[i] = 5; +// fixed length map +var flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1); +// fixed distance map +var fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1); +// find max of array +var max = function (a) { + var m = a[0]; + for (var i = 1; i < a.length; ++i) { + if (a[i] > m) + m = a[i]; + } + return m; +}; +// read d, starting at bit p and mask with m +var bits = function (d, p, m) { + var o = (p / 8) | 0; + return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m; +}; +// read d, starting at bit p continuing for at least 16 bits +var bits16 = function (d, p) { + var o = (p / 8) | 0; + return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7)); +}; +// get end of byte +var shft = function (p) { return ((p + 7) / 8) | 0; }; +// typed array slice - allows garbage collector to free original reference, +// while being more compatible than .slice +var slc = function (v, s, e) { + if (s == null || s < 0) + s = 0; + if (e == null || e > v.length) + e = v.length; + // can't use .constructor in case user-supplied + return new u8(v.subarray(s, e)); +}; +/** + * Codes for errors generated within this library + */ +exports.FlateErrorCode = { + UnexpectedEOF: 0, + InvalidBlockType: 1, + InvalidLengthLiteral: 2, + InvalidDistance: 3, + StreamFinished: 4, + NoStreamHandler: 5, + InvalidHeader: 6, + NoCallback: 7, + InvalidUTF8: 8, + ExtraFieldTooLong: 9, + InvalidDate: 10, + FilenameTooLong: 11, + StreamFinishing: 12, + InvalidZipData: 13, + UnknownCompressionMethod: 14 +}; +// error codes +var ec = [ + 'unexpected EOF', + 'invalid block type', + 'invalid length/literal', + 'invalid distance', + 'stream finished', + 'no stream handler', + , // determined by compression function + 'no callback', + 'invalid UTF-8 data', + 'extra field too long', + 'date not in range 1980-2099', + 'filename too long', + 'stream finishing', + 'invalid zip data' + // determined by unknown compression method +]; +; +var err = function (ind, msg, nt) { + var e = new Error(msg || ec[ind]); + e.code = ind; + if (Error.captureStackTrace) + Error.captureStackTrace(e, err); + if (!nt) + throw e; + return e; +}; +// expands raw DEFLATE data +var inflt = function (dat, st, buf, dict) { + // source length dict length + var sl = dat.length, dl = dict ? dict.length : 0; + if (!sl || st.f && !st.l) + return buf || new u8(0); + var noBuf = !buf; + // have to estimate size + var resize = noBuf || st.i != 2; + // no state + var noSt = st.i; + // Assumes roughly 33% compression ratio average + if (noBuf) + buf = new u8(sl * 3); + // ensure buffer can fit at least l elements + var cbuf = function (l) { + var bl = buf.length; + // need to increase size to fit + if (l > bl) { + // Double or set to necessary, whichever is greater + var nbuf = new u8(Math.max(bl * 2, l)); + nbuf.set(buf); + buf = nbuf; + } + }; + // last chunk bitpos bytes + var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n; + // total bits + var tbts = sl * 8; + do { + if (!lm) { + // BFINAL - this is only 1 when last chunk is next + final = bits(dat, pos, 1); + // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman + var type = bits(dat, pos + 1, 3); + pos += 3; + if (!type) { + // go to end of byte boundary + var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l; + if (t > sl) { + if (noSt) + err(0); + break; + } + // ensure size + if (resize) + cbuf(bt + l); + // Copy over uncompressed data + buf.set(dat.subarray(s, t), bt); + // Get new bitpos, update byte count + st.b = bt += l, st.p = pos = t * 8, st.f = final; + continue; + } + else if (type == 1) + lm = flrm, dm = fdrm, lbt = 9, dbt = 5; + else if (type == 2) { + // literal lengths + var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4; + var tl = hLit + bits(dat, pos + 5, 31) + 1; + pos += 14; + // length+distance tree + var ldt = new u8(tl); + // code length tree + var clt = new u8(19); + for (var i = 0; i < hcLen; ++i) { + // use index map to get real code + clt[clim[i]] = bits(dat, pos + i * 3, 7); + } + pos += hcLen * 3; + // code lengths bits + var clb = max(clt), clbmsk = (1 << clb) - 1; + // code lengths map + var clm = hMap(clt, clb, 1); + for (var i = 0; i < tl;) { + var r = clm[bits(dat, pos, clbmsk)]; + // bits read + pos += r & 15; + // symbol + var s = r >> 4; + // code length to copy + if (s < 16) { + ldt[i++] = s; + } + else { + // copy count + var c = 0, n = 0; + if (s == 16) + n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1]; + else if (s == 17) + n = 3 + bits(dat, pos, 7), pos += 3; + else if (s == 18) + n = 11 + bits(dat, pos, 127), pos += 7; + while (n--) + ldt[i++] = c; + } + } + // length tree distance tree + var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit); + // max length bits + lbt = max(lt); + // max dist bits + dbt = max(dt); + lm = hMap(lt, lbt, 1); + dm = hMap(dt, dbt, 1); + } + else + err(1); + if (pos > tbts) { + if (noSt) + err(0); + break; + } + } + // Make sure the buffer can hold this + the largest possible addition + // Maximum chunk size (practically, theoretically infinite) is 2^17 + if (resize) + cbuf(bt + 131072); + var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1; + var lpos = pos; + for (;; lpos = pos) { + // bits read, code + var c = lm[bits16(dat, pos) & lms], sym = c >> 4; + pos += c & 15; + if (pos > tbts) { + if (noSt) + err(0); + break; + } + if (!c) + err(2); + if (sym < 256) + buf[bt++] = sym; + else if (sym == 256) { + lpos = pos, lm = null; + break; + } + else { + var add = sym - 254; + // no extra bits needed if less + if (sym > 264) { + // index + var i = sym - 257, b = fleb[i]; + add = bits(dat, pos, (1 << b) - 1) + fl[i]; + pos += b; + } + // dist + var d = dm[bits16(dat, pos) & dms], dsym = d >> 4; + if (!d) + err(3); + pos += d & 15; + var dt = fd[dsym]; + if (dsym > 3) { + var b = fdeb[dsym]; + dt += bits16(dat, pos) & (1 << b) - 1, pos += b; + } + if (pos > tbts) { + if (noSt) + err(0); + break; + } + if (resize) + cbuf(bt + 131072); + var end = bt + add; + if (bt < dt) { + var shift = dl - dt, dend = Math.min(dt, end); + if (shift + bt < 0) + err(3); + for (; bt < dend; ++bt) + buf[bt] = dict[shift + bt]; + } + for (; bt < end; ++bt) + buf[bt] = buf[bt - dt]; + } + } + st.l = lm, st.p = lpos, st.b = bt, st.f = final; + if (lm) + final = 1, st.m = lbt, st.d = dm, st.n = dbt; + } while (!final); + // don't reallocate for streams or user buffers + return bt != buf.length && noBuf ? slc(buf, 0, bt) : buf.subarray(0, bt); +}; +// starting at p, write the minimum number of bits that can hold v to d +var wbits = function (d, p, v) { + v <<= p & 7; + var o = (p / 8) | 0; + d[o] |= v; + d[o + 1] |= v >> 8; +}; +// starting at p, write the minimum number of bits (>8) that can hold v to d +var wbits16 = function (d, p, v) { + v <<= p & 7; + var o = (p / 8) | 0; + d[o] |= v; + d[o + 1] |= v >> 8; + d[o + 2] |= v >> 16; +}; +// creates code lengths from a frequency table +var hTree = function (d, mb) { + // Need extra info to make a tree + var t = []; + for (var i = 0; i < d.length; ++i) { + if (d[i]) + t.push({ s: i, f: d[i] }); + } + var s = t.length; + var t2 = t.slice(); + if (!s) + return { t: et, l: 0 }; + if (s == 1) { + var v = new u8(t[0].s + 1); + v[t[0].s] = 1; + return { t: v, l: 1 }; + } + t.sort(function (a, b) { return a.f - b.f; }); + // after i2 reaches last ind, will be stopped + // freq must be greater than largest possible number of symbols + t.push({ s: -1, f: 25001 }); + var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2; + t[0] = { s: -1, f: l.f + r.f, l: l, r: r }; + // efficient algorithm from UZIP.js + // i0 is lookbehind, i2 is lookahead - after processing two low-freq + // symbols that combined have high freq, will start processing i2 (high-freq, + // non-composite) symbols instead + // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/ + while (i1 != s - 1) { + l = t[t[i0].f < t[i2].f ? i0++ : i2++]; + r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++]; + t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r }; + } + var maxSym = t2[0].s; + for (var i = 1; i < s; ++i) { + if (t2[i].s > maxSym) + maxSym = t2[i].s; + } + // code lengths + var tr = new u16(maxSym + 1); + // max bits in tree + var mbt = ln(t[i1 - 1], tr, 0); + if (mbt > mb) { + // more algorithms from UZIP.js + // TODO: find out how this code works (debt) + // ind debt + var i = 0, dt = 0; + // left cost + var lft = mbt - mb, cst = 1 << lft; + t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; }); + for (; i < s; ++i) { + var i2_1 = t2[i].s; + if (tr[i2_1] > mb) { + dt += cst - (1 << (mbt - tr[i2_1])); + tr[i2_1] = mb; + } + else + break; + } + dt >>= lft; + while (dt > 0) { + var i2_2 = t2[i].s; + if (tr[i2_2] < mb) + dt -= 1 << (mb - tr[i2_2]++ - 1); + else + ++i; + } + for (; i >= 0 && dt; --i) { + var i2_3 = t2[i].s; + if (tr[i2_3] == mb) { + --tr[i2_3]; + ++dt; + } + } + mbt = mb; + } + return { t: new u8(tr), l: mbt }; +}; +// get the max length and assign length codes +var ln = function (n, l, d) { + return n.s == -1 + ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1)) + : (l[n.s] = d); +}; +// length codes generation +var lc = function (c) { + var s = c.length; + // Note that the semicolon was intentional + while (s && !c[--s]) + ; + var cl = new u16(++s); + // ind num streak + var cli = 0, cln = c[0], cls = 1; + var w = function (v) { cl[cli++] = v; }; + for (var i = 1; i <= s; ++i) { + if (c[i] == cln && i != s) + ++cls; + else { + if (!cln && cls > 2) { + for (; cls > 138; cls -= 138) + w(32754); + if (cls > 2) { + w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305); + cls = 0; + } + } + else if (cls > 3) { + w(cln), --cls; + for (; cls > 6; cls -= 6) + w(8304); + if (cls > 2) + w(((cls - 3) << 5) | 8208), cls = 0; + } + while (cls--) + w(cln); + cls = 1; + cln = c[i]; + } + } + return { c: cl.subarray(0, cli), n: s }; +}; +// calculate the length of output from tree, code lengths +var clen = function (cf, cl) { + var l = 0; + for (var i = 0; i < cl.length; ++i) + l += cf[i] * cl[i]; + return l; +}; +// writes a fixed block +// returns the new bit pos +var wfblk = function (out, pos, dat) { + // no need to write 00 as type: TypedArray defaults to 0 + var s = dat.length; + var o = shft(pos + 2); + out[o] = s & 255; + out[o + 1] = s >> 8; + out[o + 2] = out[o] ^ 255; + out[o + 3] = out[o + 1] ^ 255; + for (var i = 0; i < s; ++i) + out[o + i + 4] = dat[i]; + return (o + 4 + s) * 8; +}; +// writes a block +var wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) { + wbits(out, p++, final); + ++lf[256]; + var _a = hTree(lf, 15), dlt = _a.t, mlb = _a.l; + var _b = hTree(df, 15), ddt = _b.t, mdb = _b.l; + var _c = lc(dlt), lclt = _c.c, nlc = _c.n; + var _d = lc(ddt), lcdt = _d.c, ndc = _d.n; + var lcfreq = new u16(19); + for (var i = 0; i < lclt.length; ++i) + ++lcfreq[lclt[i] & 31]; + for (var i = 0; i < lcdt.length; ++i) + ++lcfreq[lcdt[i] & 31]; + var _e = hTree(lcfreq, 7), lct = _e.t, mlcb = _e.l; + var nlcc = 19; + for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc) + ; + var flen = (bl + 5) << 3; + var ftlen = clen(lf, flt) + clen(df, fdt) + eb; + var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + 2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]; + if (bs >= 0 && flen <= ftlen && flen <= dtlen) + return wfblk(out, p, dat.subarray(bs, bs + bl)); + var lm, ll, dm, dl; + wbits(out, p, 1 + (dtlen < ftlen)), p += 2; + if (dtlen < ftlen) { + lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt; + var llm = hMap(lct, mlcb, 0); + wbits(out, p, nlc - 257); + wbits(out, p + 5, ndc - 1); + wbits(out, p + 10, nlcc - 4); + p += 14; + for (var i = 0; i < nlcc; ++i) + wbits(out, p + 3 * i, lct[clim[i]]); + p += 3 * nlcc; + var lcts = [lclt, lcdt]; + for (var it = 0; it < 2; ++it) { + var clct = lcts[it]; + for (var i = 0; i < clct.length; ++i) { + var len = clct[i] & 31; + wbits(out, p, llm[len]), p += lct[len]; + if (len > 15) + wbits(out, p, (clct[i] >> 5) & 127), p += clct[i] >> 12; + } + } + } + else { + lm = flm, ll = flt, dm = fdm, dl = fdt; + } + for (var i = 0; i < li; ++i) { + var sym = syms[i]; + if (sym > 255) { + var len = (sym >> 18) & 31; + wbits16(out, p, lm[len + 257]), p += ll[len + 257]; + if (len > 7) + wbits(out, p, (sym >> 23) & 31), p += fleb[len]; + var dst = sym & 31; + wbits16(out, p, dm[dst]), p += dl[dst]; + if (dst > 3) + wbits16(out, p, (sym >> 5) & 8191), p += fdeb[dst]; + } + else { + wbits16(out, p, lm[sym]), p += ll[sym]; + } + } + wbits16(out, p, lm[256]); + return p + ll[256]; +}; +// deflate options (nice << 13) | chain +var deo = /*#__PURE__*/ new i32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]); +// empty +var et = /*#__PURE__*/ new u8(0); +// compresses data into a raw DEFLATE buffer +var dflt = function (dat, lvl, plvl, pre, post, st) { + var s = st.z || dat.length; + var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post); + // writing to this writes to the output buffer + var w = o.subarray(pre, o.length - post); + var lst = st.l; + var pos = (st.r || 0) & 7; + if (lvl) { + if (pos) + w[0] = st.r >> 3; + var opt = deo[lvl - 1]; + var n = opt >> 13, c = opt & 8191; + var msk_1 = (1 << plvl) - 1; + // prev 2-byte val map curr 2-byte val map + var prev = st.p || new u16(32768), head = st.h || new u16(msk_1 + 1); + var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1; + var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; }; + // 24576 is an arbitrary number of maximum symbols per block + // 424 buffer for last block + var syms = new i32(25000); + // length/literal freq distance freq + var lf = new u16(288), df = new u16(32); + // l/lcnt exbits index l/lind waitdx blkpos + var lc_1 = 0, eb = 0, i = st.i || 0, li = 0, wi = st.w || 0, bs = 0; + for (; i + 2 < s; ++i) { + // hash value + var hv = hsh(i); + // index mod 32768 previous index mod + var imod = i & 32767, pimod = head[hv]; + prev[imod] = pimod; + head[hv] = imod; + // We always should modify head and prev, but only add symbols if + // this data is not yet processed ("wait" for wait index) + if (wi <= i) { + // bytes remaining + var rem = s - i; + if ((lc_1 > 7000 || li > 24576) && (rem > 423 || !lst)) { + pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos); + li = lc_1 = eb = 0, bs = i; + for (var j = 0; j < 286; ++j) + lf[j] = 0; + for (var j = 0; j < 30; ++j) + df[j] = 0; + } + // len dist chain + var l = 2, d = 0, ch_1 = c, dif = imod - pimod & 32767; + if (rem > 2 && hv == hsh(i - dif)) { + var maxn = Math.min(n, rem) - 1; + var maxd = Math.min(32767, i); + // max possible length + // not capped at dif because decompressors implement "rolling" index population + var ml = Math.min(258, rem); + while (dif <= maxd && --ch_1 && imod != pimod) { + if (dat[i + l] == dat[i + l - dif]) { + var nl = 0; + for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl) + ; + if (nl > l) { + l = nl, d = dif; + // break out early when we reach "nice" (we are satisfied enough) + if (nl > maxn) + break; + // now, find the rarest 2-byte sequence within this + // length of literals and search for that instead. + // Much faster than just using the start + var mmd = Math.min(dif, nl - 2); + var md = 0; + for (var j = 0; j < mmd; ++j) { + var ti = i - dif + j & 32767; + var pti = prev[ti]; + var cd = ti - pti & 32767; + if (cd > md) + md = cd, pimod = ti; + } + } + } + // check the previous match + imod = pimod, pimod = prev[imod]; + dif += imod - pimod & 32767; + } + } + // d will be nonzero only when a match was found + if (d) { + // store both dist and len data in one int32 + // Make sure this is recognized as a len/dist with 28th bit (2^28) + syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d]; + var lin = revfl[l] & 31, din = revfd[d] & 31; + eb += fleb[lin] + fdeb[din]; + ++lf[257 + lin]; + ++df[din]; + wi = i + l; + ++lc_1; + } + else { + syms[li++] = dat[i]; + ++lf[dat[i]]; + } + } + } + for (i = Math.max(i, wi); i < s; ++i) { + syms[li++] = dat[i]; + ++lf[dat[i]]; + } + pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos); + if (!lst) { + st.r = (pos & 7) | w[(pos / 8) | 0] << 3; + // shft(pos) now 1 less if pos & 7 != 0 + pos -= 7; + st.h = head, st.p = prev, st.i = i, st.w = wi; + } + } + else { + for (var i = st.w || 0; i < s + lst; i += 65535) { + // end + var e = i + 65535; + if (e >= s) { + // write final block + w[(pos / 8) | 0] = lst; + e = s; + } + pos = wfblk(w, pos + 1, dat.subarray(i, e)); + } + st.i = s; + } + return slc(o, 0, pre + shft(pos) + post); +}; +// CRC32 table +var crct = /*#__PURE__*/ (function () { + var t = new Int32Array(256); + for (var i = 0; i < 256; ++i) { + var c = i, k = 9; + while (--k) + c = ((c & 1) && -306674912) ^ (c >>> 1); + t[i] = c; + } + return t; +})(); +// CRC32 +var crc = function () { + var c = -1; + return { + p: function (d) { + // closures have awful performance + var cr = c; + for (var i = 0; i < d.length; ++i) + cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8); + c = cr; + }, + d: function () { return ~c; } + }; +}; +// Adler32 +var adler = function () { + var a = 1, b = 0; + return { + p: function (d) { + // closures have awful performance + var n = a, m = b; + var l = d.length | 0; + for (var i = 0; i != l;) { + var e = Math.min(i + 2655, l); + for (; i < e; ++i) + m += n += d[i]; + n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16); + } + a = n, b = m; + }, + d: function () { + a %= 65521, b %= 65521; + return (a & 255) << 24 | (a & 0xFF00) << 8 | (b & 255) << 8 | (b >> 8); + } + }; +}; +; +// deflate with opts +var dopt = function (dat, opt, pre, post, st) { + if (!st) { + st = { l: 1 }; + if (opt.dictionary) { + var dict = opt.dictionary.subarray(-32768); + var newDat = new u8(dict.length + dat.length); + newDat.set(dict); + newDat.set(dat, dict.length); + dat = newDat; + st.w = dict.length; + } + } + return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? (st.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : 20) : (12 + opt.mem), pre, post, st); +}; +// Walmart object spread +var mrg = function (a, b) { + var o = {}; + for (var k in a) + o[k] = a[k]; + for (var k in b) + o[k] = b[k]; + return o; +}; +// worker clone +// This is possibly the craziest part of the entire codebase, despite how simple it may seem. +// The only parameter to this function is a closure that returns an array of variables outside of the function scope. +// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization. +// We will return an object mapping of true variable name to value (basically, the current scope as a JS object). +// The reason we can't just use the original variable names is minifiers mangling the toplevel scope. +// This took me three weeks to figure out how to do. +var wcln = function (fn, fnStr, td) { + var dt = fn(); + var st = fn.toString(); + var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/\s+/g, '').split(','); + for (var i = 0; i < dt.length; ++i) { + var v = dt[i], k = ks[i]; + if (typeof v == 'function') { + fnStr += ';' + k + '='; + var st_1 = v.toString(); + if (v.prototype) { + // for global objects + if (st_1.indexOf('[native code]') != -1) { + var spInd = st_1.indexOf(' ', 8) + 1; + fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd)); + } + else { + fnStr += st_1; + for (var t in v.prototype) + fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString(); + } + } + else + fnStr += st_1; + } + else + td[k] = v; + } + return fnStr; +}; +var ch = []; +// clone bufs +var cbfs = function (v) { + var tl = []; + for (var k in v) { + if (v[k].buffer) { + tl.push((v[k] = new v[k].constructor(v[k])).buffer); + } + } + return tl; +}; +// use a worker to execute code +var wrkr = function (fns, init, id, cb) { + if (!ch[id]) { + var fnStr = '', td_1 = {}, m = fns.length - 1; + for (var i = 0; i < m; ++i) + fnStr = wcln(fns[i], fnStr, td_1); + ch[id] = { c: wcln(fns[m], fnStr, td_1), e: td_1 }; + } + var td = mrg({}, ch[id].e); + return (0, node_worker_1.default)(ch[id].c + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb); +}; +// base async inflate fn +var bInflt = function () { return [u8, u16, i32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gopt]; }; +var bDflt = function () { return [u8, u16, i32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; }; +// gzip extra +var gze = function () { return [gzh, gzhl, wbytes, crc, crct]; }; +// gunzip extra +var guze = function () { return [gzs, gzl]; }; +// zlib extra +var zle = function () { return [zlh, wbytes, adler]; }; +// unzlib extra +var zule = function () { return [zls]; }; +// post buf +var pbf = function (msg) { return postMessage(msg, [msg.buffer]); }; +// get opts +var gopt = function (o) { return o && { + out: o.size && new u8(o.size), + dictionary: o.dictionary +}; }; +// async helper +var cbify = function (dat, opts, fns, init, id, cb) { + var w = wrkr(fns, init, id, function (err, dat) { + w.terminate(); + cb(err, dat); + }); + w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []); + return function () { w.terminate(); }; +}; +// auto stream +var astrm = function (strm) { + strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); }; + return function (ev) { + if (ev.data[0]) { + strm.push(ev.data[0], ev.data[1]); + postMessage([ev.data[0].length]); + } + else + strm.flush(ev.data[1]); + }; +}; +// async stream attach +var astrmify = function (fns, strm, opts, init, id, flush, ext) { + var t; + var w = wrkr(fns, init, id, function (err, dat) { + if (err) + w.terminate(), strm.ondata.call(strm, err); + else if (!Array.isArray(dat)) + ext(dat); + else if (dat.length == 1) { + strm.queuedSize -= dat[0]; + if (strm.ondrain) + strm.ondrain(dat[0]); + } + else { + if (dat[1]) + w.terminate(); + strm.ondata.call(strm, err, dat[0], dat[1]); + } + }); + w.postMessage(opts); + strm.queuedSize = 0; + strm.push = function (d, f) { + if (!strm.ondata) + err(5); + if (t) + strm.ondata(err(4, 0, 1), null, !!f); + strm.queuedSize += d.length; + // can fail for cross-realm Uint8Array, but ok - only a small performance penalty + w.postMessage([d, t = f], d.buffer instanceof ArrayBuffer ? [d.buffer] : []); + }; + strm.terminate = function () { w.terminate(); }; + if (flush) { + strm.flush = function (sync) { w.postMessage([0, sync]); }; + } +}; +// read 2 bytes +var b2 = function (d, b) { return d[b] | (d[b + 1] << 8); }; +// read 4 bytes +var b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; }; +// read 8 bytes +var b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); }; +// write bytes +var wbytes = function (d, b, v) { + for (; v; ++b) + d[b] = v, v >>>= 8; +}; +// gzip header +var gzh = function (c, o) { + var fn = o.filename; + c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix + if (o.mtime != 0) + wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000)); + if (fn) { + c[3] = 8; + for (var i = 0; i <= fn.length; ++i) + c[i + 10] = fn.charCodeAt(i); + } +}; +// gzip footer: -8 to -4 = CRC, -4 to -0 is length +// gzip start +var gzs = function (d) { + if (d[0] != 31 || d[1] != 139 || d[2] != 8) + err(6, 'invalid gzip data'); + var flg = d[3]; + var st = 10; + if (flg & 4) + st += (d[10] | d[11] << 8) + 2; + for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++]) + ; + return st + (flg & 2); +}; +// gzip length +var gzl = function (d) { + var l = d.length; + return (d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16 | d[l - 1] << 24) >>> 0; +}; +// gzip header length +var gzhl = function (o) { return 10 + (o.filename ? o.filename.length + 1 : 0); }; +// zlib header +var zlh = function (c, o) { + var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2; + c[0] = 120, c[1] = (fl << 6) | (o.dictionary && 32); + c[1] |= 31 - ((c[0] << 8) | c[1]) % 31; + if (o.dictionary) { + var h = adler(); + h.p(o.dictionary); + wbytes(c, 2, h.d()); + } +}; +// zlib start +var zls = function (d, dict) { + if ((d[0] & 15) != 8 || (d[0] >> 4) > 7 || ((d[0] << 8 | d[1]) % 31)) + err(6, 'invalid zlib data'); + if ((d[1] >> 5 & 1) == +!dict) + err(6, 'invalid zlib data: ' + (d[1] & 32 ? 'need' : 'unexpected') + ' dictionary'); + return (d[1] >> 3 & 4) + 2; +}; +function StrmOpt(opts, cb) { + if (typeof opts == 'function') + cb = opts, opts = {}; + this.ondata = cb; + return opts; +} +/** + * Streaming DEFLATE compression + */ +var Deflate = /*#__PURE__*/ (function () { + function Deflate(opts, cb) { + if (typeof opts == 'function') + cb = opts, opts = {}; + this.ondata = cb; + this.o = opts || {}; + this.s = { l: 0, i: 32768, w: 32768, z: 32768 }; + // Buffer length must always be 0 mod 32768 for index calculations to be correct when modifying head and prev + // 98304 = 32768 (lookback) + 65536 (common chunk size) + this.b = new u8(98304); + if (this.o.dictionary) { + var dict = this.o.dictionary.subarray(-32768); + this.b.set(dict, 32768 - dict.length); + this.s.i = 32768 - dict.length; + } + } + Deflate.prototype.p = function (c, f) { + this.ondata(dopt(c, this.o, 0, 0, this.s), f); + }; + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Deflate.prototype.push = function (chunk, final) { + if (!this.ondata) + err(5); + if (this.s.l) + err(4); + var endLen = chunk.length + this.s.z; + if (endLen > this.b.length) { + if (endLen > 2 * this.b.length - 32768) { + var newBuf = new u8(endLen & -32768); + newBuf.set(this.b.subarray(0, this.s.z)); + this.b = newBuf; + } + var split = this.b.length - this.s.z; + this.b.set(chunk.subarray(0, split), this.s.z); + this.s.z = this.b.length; + this.p(this.b, false); + this.b.set(this.b.subarray(-32768)); + this.b.set(chunk.subarray(split), 32768); + this.s.z = chunk.length - split + 32768; + this.s.i = 32766, this.s.w = 32768; + } + else { + this.b.set(chunk, this.s.z); + this.s.z += chunk.length; + } + this.s.l = final & 1; + if (this.s.z > this.s.w + 8191 || final) { + this.p(this.b, final || false); + this.s.w = this.s.i, this.s.i -= 2; + } + if (final) { + // cleanup unneeded buffers/state to reduce memory usage + this.s = this.o = {}; + this.b = et; + } + }; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * deflated output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. A separate DEFLATE stream may be concatenated + * with the current output after a sync flush. + */ + Deflate.prototype.flush = function (sync) { + if (!this.ondata) + err(5); + if (this.s.l) + err(4); + this.p(this.b, false); + this.s.w = this.s.i, this.s.i -= 2; + // could technically skip writing the type-0 block for (this.s.r & 7) == 0, + // but the deterministic trailer (00 00 FF FF) is useful in some situations + if (sync) { + var c = new u8(6); + c[0] = this.s.r >> 3; + // write empty, non-final type-0 block + var ep = wfblk(c, this.s.r, et); + this.s.r = 0; + this.ondata(c.subarray(0, ep >> 3), false); + } + }; + return Deflate; +}()); +exports.Deflate = Deflate; +/** + * Asynchronous streaming DEFLATE compression + */ +var AsyncDeflate = /*#__PURE__*/ (function () { + function AsyncDeflate(opts, cb) { + astrmify([ + bDflt, + function () { return [astrm, Deflate]; } + ], this, StrmOpt.call(this, opts, cb), function (ev) { + var strm = new Deflate(ev.data); + onmessage = astrm(strm); + }, 6, 1); + } + return AsyncDeflate; +}()); +exports.AsyncDeflate = AsyncDeflate; +function deflate(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return cbify(data, opts, [ + bDflt, + ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb); +} +/** + * Compresses data with DEFLATE without any wrapper + * @param data The data to compress + * @param opts The compression options + * @returns The deflated version of the data + */ +function deflateSync(data, opts) { + return dopt(data, opts || {}, 0, 0); +} +/** + * Streaming DEFLATE decompression + */ +var Inflate = /*#__PURE__*/ (function () { + function Inflate(opts, cb) { + // no StrmOpt here to avoid adding to workerizer + if (typeof opts == 'function') + cb = opts, opts = {}; + this.ondata = cb; + var dict = opts && opts.dictionary && opts.dictionary.subarray(-32768); + this.s = { i: 0, b: dict ? dict.length : 0 }; + this.o = new u8(32768); + this.p = new u8(0); + if (dict) + this.o.set(dict); + } + Inflate.prototype.e = function (c) { + if (!this.ondata) + err(5); + if (this.d) + err(4); + if (!this.p.length) + this.p = c; + else if (c.length) { + var n = new u8(this.p.length + c.length); + n.set(this.p), n.set(c, this.p.length), this.p = n; + } + }; + Inflate.prototype.c = function (final) { + this.s.i = +(this.d = final || false); + var bts = this.s.b; + var dt = inflt(this.p, this.s, this.o); + this.ondata(slc(dt, bts, this.s.b), this.d); + this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length; + this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7; + }; + /** + * Pushes a chunk to be inflated + * @param chunk The chunk to push + * @param final Whether this is the final chunk + */ + Inflate.prototype.push = function (chunk, final) { + this.e(chunk), this.c(final); + }; + return Inflate; +}()); +exports.Inflate = Inflate; +/** + * Asynchronous streaming DEFLATE decompression + */ +var AsyncInflate = /*#__PURE__*/ (function () { + function AsyncInflate(opts, cb) { + astrmify([ + bInflt, + function () { return [astrm, Inflate]; } + ], this, StrmOpt.call(this, opts, cb), function (ev) { + var strm = new Inflate(ev.data); + onmessage = astrm(strm); + }, 7, 0); + } + return AsyncInflate; +}()); +exports.AsyncInflate = AsyncInflate; +function inflate(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return cbify(data, opts, [ + bInflt + ], function (ev) { return pbf(inflateSync(ev.data[0], gopt(ev.data[1]))); }, 1, cb); +} +function inflateSync(data, opts) { + return inflt(data, { i: 2 }, opts && opts.out, opts && opts.dictionary); +} +// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize. +/** + * Streaming GZIP compression + */ +var Gzip = /*#__PURE__*/ (function () { + function Gzip(opts, cb) { + this.c = crc(); + this.l = 0; + this.v = 1; + Deflate.call(this, opts, cb); + } + /** + * Pushes a chunk to be GZIPped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Gzip.prototype.push = function (chunk, final) { + this.c.p(chunk); + this.l += chunk.length; + Deflate.prototype.push.call(this, chunk, final); + }; + Gzip.prototype.p = function (c, f) { + var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, this.s); + if (this.v) + gzh(raw, this.o), this.v = 0; + if (f) + wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l); + this.ondata(raw, f); + }; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * GZIPped output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. + */ + Gzip.prototype.flush = function (sync) { + Deflate.prototype.flush.call(this, sync); + }; + return Gzip; +}()); +exports.Gzip = Gzip; +exports.Compress = Gzip; +/** + * Asynchronous streaming GZIP compression + */ +var AsyncGzip = /*#__PURE__*/ (function () { + function AsyncGzip(opts, cb) { + astrmify([ + bDflt, + gze, + function () { return [astrm, Deflate, Gzip]; } + ], this, StrmOpt.call(this, opts, cb), function (ev) { + var strm = new Gzip(ev.data); + onmessage = astrm(strm); + }, 8, 1); + } + return AsyncGzip; +}()); +exports.AsyncGzip = AsyncGzip; +exports.AsyncCompress = AsyncGzip; +function gzip(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return cbify(data, opts, [ + bDflt, + gze, + function () { return [gzipSync]; } + ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb); +} +/** + * Compresses data with GZIP + * @param data The data to compress + * @param opts The compression options + * @returns The gzipped version of the data + */ +function gzipSync(data, opts) { + if (!opts) + opts = {}; + var c = crc(), l = data.length; + c.p(data); + var d = dopt(data, opts, gzhl(opts), 8), s = d.length; + return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d; +} +/** + * Streaming single or multi-member GZIP decompression + */ +var Gunzip = /*#__PURE__*/ (function () { + function Gunzip(opts, cb) { + this.v = 1; + this.r = 0; + Inflate.call(this, opts, cb); + } + /** + * Pushes a chunk to be GUNZIPped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Gunzip.prototype.push = function (chunk, final) { + Inflate.prototype.e.call(this, chunk); + this.r += chunk.length; + if (this.v) { + var p = this.p.subarray(this.v - 1); + var s = p.length > 3 ? gzs(p) : 4; + if (s > p.length) { + if (!final) + return; + } + else if (this.v > 1 && this.onmember) { + this.onmember(this.r - p.length); + } + this.p = p.subarray(s), this.v = 0; + } + // necessary to prevent TS from using the closure value + // This allows for workerization to function correctly + Inflate.prototype.c.call(this, 0); + // process concatenated GZIP + if (this.s.f && !this.s.l) { + this.v = shft(this.s.p) + 9; + this.s = { i: 0 }; + this.o = new u8(0); + this.push(new u8(0), final); + } + else if (final) { + Inflate.prototype.c.call(this, final); + } + }; + return Gunzip; +}()); +exports.Gunzip = Gunzip; +/** + * Asynchronous streaming single or multi-member GZIP decompression + */ +var AsyncGunzip = /*#__PURE__*/ (function () { + function AsyncGunzip(opts, cb) { + var _this = this; + astrmify([ + bInflt, + guze, + function () { return [astrm, Inflate, Gunzip]; } + ], this, StrmOpt.call(this, opts, cb), function (ev) { + var strm = new Gunzip(ev.data); + strm.onmember = function (offset) { return postMessage(offset); }; + onmessage = astrm(strm); + }, 9, 0, function (offset) { return _this.onmember && _this.onmember(offset); }); + } + return AsyncGunzip; +}()); +exports.AsyncGunzip = AsyncGunzip; +function gunzip(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return cbify(data, opts, [ + bInflt, + guze, + function () { return [gunzipSync]; } + ], function (ev) { return pbf(gunzipSync(ev.data[0], ev.data[1])); }, 3, cb); +} +function gunzipSync(data, opts) { + var st = gzs(data); + if (st + 8 > data.length) + err(6, 'invalid gzip data'); + return inflt(data.subarray(st, -8), { i: 2 }, opts && opts.out || new u8(gzl(data)), opts && opts.dictionary); +} +/** + * Streaming Zlib compression + */ +var Zlib = /*#__PURE__*/ (function () { + function Zlib(opts, cb) { + this.c = adler(); + this.v = 1; + Deflate.call(this, opts, cb); + } + /** + * Pushes a chunk to be zlibbed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Zlib.prototype.push = function (chunk, final) { + this.c.p(chunk); + Deflate.prototype.push.call(this, chunk, final); + }; + Zlib.prototype.p = function (c, f) { + var raw = dopt(c, this.o, this.v && (this.o.dictionary ? 6 : 2), f && 4, this.s); + if (this.v) + zlh(raw, this.o), this.v = 0; + if (f) + wbytes(raw, raw.length - 4, this.c.d()); + this.ondata(raw, f); + }; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * zlibbed output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. + */ + Zlib.prototype.flush = function (sync) { + Deflate.prototype.flush.call(this, sync); + }; + return Zlib; +}()); +exports.Zlib = Zlib; +/** + * Asynchronous streaming Zlib compression + */ +var AsyncZlib = /*#__PURE__*/ (function () { + function AsyncZlib(opts, cb) { + astrmify([ + bDflt, + zle, + function () { return [astrm, Deflate, Zlib]; } + ], this, StrmOpt.call(this, opts, cb), function (ev) { + var strm = new Zlib(ev.data); + onmessage = astrm(strm); + }, 10, 1); + } + return AsyncZlib; +}()); +exports.AsyncZlib = AsyncZlib; +function zlib(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return cbify(data, opts, [ + bDflt, + zle, + function () { return [zlibSync]; } + ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb); +} +/** + * Compress data with Zlib + * @param data The data to compress + * @param opts The compression options + * @returns The zlib-compressed version of the data + */ +function zlibSync(data, opts) { + if (!opts) + opts = {}; + var a = adler(); + a.p(data); + var d = dopt(data, opts, opts.dictionary ? 6 : 2, 4); + return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d; +} +/** + * Streaming Zlib decompression + */ +var Unzlib = /*#__PURE__*/ (function () { + function Unzlib(opts, cb) { + Inflate.call(this, opts, cb); + this.v = opts && opts.dictionary ? 2 : 1; + } + /** + * Pushes a chunk to be unzlibbed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Unzlib.prototype.push = function (chunk, final) { + Inflate.prototype.e.call(this, chunk); + if (this.v) { + if (this.p.length < 6 && !final) + return; + this.p = this.p.subarray(zls(this.p, this.v - 1)), this.v = 0; + } + if (final) { + if (this.p.length < 4) + err(6, 'invalid zlib data'); + this.p = this.p.subarray(0, -4); + } + // necessary to prevent TS from using the closure value + // This allows for workerization to function correctly + Inflate.prototype.c.call(this, final); + }; + return Unzlib; +}()); +exports.Unzlib = Unzlib; +/** + * Asynchronous streaming Zlib decompression + */ +var AsyncUnzlib = /*#__PURE__*/ (function () { + function AsyncUnzlib(opts, cb) { + astrmify([ + bInflt, + zule, + function () { return [astrm, Inflate, Unzlib]; } + ], this, StrmOpt.call(this, opts, cb), function (ev) { + var strm = new Unzlib(ev.data); + onmessage = astrm(strm); + }, 11, 0); + } + return AsyncUnzlib; +}()); +exports.AsyncUnzlib = AsyncUnzlib; +function unzlib(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return cbify(data, opts, [ + bInflt, + zule, + function () { return [unzlibSync]; } + ], function (ev) { return pbf(unzlibSync(ev.data[0], gopt(ev.data[1]))); }, 5, cb); +} +function unzlibSync(data, opts) { + return inflt(data.subarray(zls(data, opts && opts.dictionary), -4), { i: 2 }, opts && opts.out, opts && opts.dictionary); +} +/** + * Streaming GZIP, Zlib, or raw DEFLATE decompression + */ +var Decompress = /*#__PURE__*/ (function () { + function Decompress(opts, cb) { + this.o = StrmOpt.call(this, opts, cb) || {}; + this.G = Gunzip; + this.I = Inflate; + this.Z = Unzlib; + } + // init substream + // overriden by AsyncDecompress + Decompress.prototype.i = function () { + var _this = this; + this.s.ondata = function (dat, final) { + _this.ondata(dat, final); + }; + }; + /** + * Pushes a chunk to be decompressed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Decompress.prototype.push = function (chunk, final) { + if (!this.ondata) + err(5); + if (!this.s) { + if (this.p && this.p.length) { + var n = new u8(this.p.length + chunk.length); + n.set(this.p), n.set(chunk, this.p.length); + } + else + this.p = chunk; + if (this.p.length > 2) { + this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8) + ? new this.G(this.o) + : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31)) + ? new this.I(this.o) + : new this.Z(this.o); + this.i(); + this.s.push(this.p, final); + this.p = null; + } + } + else + this.s.push(chunk, final); + }; + return Decompress; +}()); +exports.Decompress = Decompress; +/** + * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression + */ +var AsyncDecompress = /*#__PURE__*/ (function () { + function AsyncDecompress(opts, cb) { + Decompress.call(this, opts, cb); + this.queuedSize = 0; + this.G = AsyncGunzip; + this.I = AsyncInflate; + this.Z = AsyncUnzlib; + } + AsyncDecompress.prototype.i = function () { + var _this = this; + this.s.ondata = function (err, dat, final) { + _this.ondata(err, dat, final); + }; + this.s.ondrain = function (size) { + _this.queuedSize -= size; + if (_this.ondrain) + _this.ondrain(size); + }; + }; + /** + * Pushes a chunk to be decompressed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + AsyncDecompress.prototype.push = function (chunk, final) { + this.queuedSize += chunk.length; + Decompress.prototype.push.call(this, chunk, final); + }; + return AsyncDecompress; +}()); +exports.AsyncDecompress = AsyncDecompress; +function decompress(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + return (data[0] == 31 && data[1] == 139 && data[2] == 8) + ? gunzip(data, opts, cb) + : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31)) + ? inflate(data, opts, cb) + : unzlib(data, opts, cb); +} +/** + * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format + * @param data The data to decompress + * @param opts The decompression options + * @returns The decompressed version of the data + */ +function decompressSync(data, opts) { + return (data[0] == 31 && data[1] == 139 && data[2] == 8) + ? gunzipSync(data, opts) + : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31)) + ? inflateSync(data, opts) + : unzlibSync(data, opts); +} +// flatten a directory structure +var fltn = function (d, p, t, o) { + for (var k in d) { + var val = d[k], n = p + k, op = o; + if (Array.isArray(val)) + op = mrg(o, val[1]), val = val[0]; + if (ArrayBuffer.isView(val)) + t[n] = [val, op]; + else { + t[n += '/'] = [new u8(0), op]; + fltn(val, n, t, o); + } + } +}; +// text encoder +var te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder(); +// text decoder +var td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder(); +// text decoder stream +var tds = 0; +try { + td.decode(et, { stream: true }); + tds = 1; +} +catch (e) { } +// decode UTF8 +var dutf8 = function (d) { + for (var r = '', i = 0;;) { + var c = d[i++]; + var eb = (c > 127) + (c > 223) + (c > 239); + if (i + eb > d.length) + return { s: r, r: slc(d, i - 1) }; + if (!eb) + r += String.fromCharCode(c); + else if (eb == 3) { + c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536, + r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023)); + } + else if (eb & 1) + r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63)); + else + r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)); + } +}; +/** + * Streaming UTF-8 decoding + */ +var DecodeUTF8 = /*#__PURE__*/ (function () { + /** + * Creates a UTF-8 decoding stream + * @param cb The callback to call whenever data is decoded + */ + function DecodeUTF8(cb) { + this.ondata = cb; + if (tds) + this.t = new TextDecoder(); + else + this.p = et; + } + /** + * Pushes a chunk to be decoded from UTF-8 binary + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + DecodeUTF8.prototype.push = function (chunk, final) { + if (!this.ondata) + err(5); + final = !!final; + if (this.t) { + this.ondata(this.t.decode(chunk, { stream: true }), final); + if (final) { + if (this.t.decode().length) + err(8); + this.t = null; + } + return; + } + if (!this.p) + err(4); + var dat = new u8(this.p.length + chunk.length); + dat.set(this.p); + dat.set(chunk, this.p.length); + var _a = dutf8(dat), s = _a.s, r = _a.r; + if (final) { + if (r.length) + err(8); + this.p = null; + } + else + this.p = r; + this.ondata(s, final); + }; + return DecodeUTF8; +}()); +exports.DecodeUTF8 = DecodeUTF8; +/** + * Streaming UTF-8 encoding + */ +var EncodeUTF8 = /*#__PURE__*/ (function () { + /** + * Creates a UTF-8 decoding stream + * @param cb The callback to call whenever data is encoded + */ + function EncodeUTF8(cb) { + this.ondata = cb; + } + /** + * Pushes a chunk to be encoded to UTF-8 + * @param chunk The string data to push + * @param final Whether this is the last chunk + */ + EncodeUTF8.prototype.push = function (chunk, final) { + if (!this.ondata) + err(5); + if (this.d) + err(4); + this.ondata(strToU8(chunk), this.d = final || false); + }; + return EncodeUTF8; +}()); +exports.EncodeUTF8 = EncodeUTF8; +/** + * Converts a string into a Uint8Array for use with compression/decompression methods + * @param str The string to encode + * @param latin1 Whether or not to interpret the data as Latin-1. This should + * not need to be true unless decoding a binary string. + * @returns The string encoded in UTF-8/Latin-1 binary + */ +function strToU8(str, latin1) { + if (latin1) { + var ar_1 = new u8(str.length); + for (var i = 0; i < str.length; ++i) + ar_1[i] = str.charCodeAt(i); + return ar_1; + } + if (te) + return te.encode(str); + var l = str.length; + var ar = new u8(str.length + (str.length >> 1)); + var ai = 0; + var w = function (v) { ar[ai++] = v; }; + for (var i = 0; i < l; ++i) { + if (ai + 5 > ar.length) { + var n = new u8(ai + 8 + ((l - i) << 1)); + n.set(ar); + ar = n; + } + var c = str.charCodeAt(i); + if (c < 128 || latin1) + w(c); + else if (c < 2048) + w(192 | (c >> 6)), w(128 | (c & 63)); + else if (c > 55295 && c < 57344) + c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023), + w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63)); + else + w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63)); + } + return slc(ar, 0, ai); +} +/** + * Converts a Uint8Array to a string + * @param dat The data to decode to string + * @param latin1 Whether or not to interpret the data as Latin-1. This should + * not need to be true unless encoding to binary string. + * @returns The original UTF-8/Latin-1 string + */ +function strFromU8(dat, latin1) { + if (latin1) { + var r = ''; + for (var i = 0; i < dat.length; i += 16384) + r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384)); + return r; + } + else if (td) { + return td.decode(dat); + } + else { + var _a = dutf8(dat), s = _a.s, r = _a.r; + if (r.length) + err(8); + return s; + } +} +; +// deflate bit flag +var dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; }; +// skip local zip header +var slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); }; +// read zip header +var zh = function (d, b, z) { + var fnl = b2(d, b + 28), efl = b2(d, b + 30), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl; + var _a = z64hs(d, es, efl, z, b4(d, b + 20), b4(d, b + 24), b4(d, b + 42)), sc = _a[0], su = _a[1], off = _a[2]; + return [b2(d, b + 10), sc, su, fn, es + efl + b2(d, b + 32), off]; +}; +// read zip64 header sizes +var z64hs = function (d, b, l, z, sc, su, off) { + var nsc = sc == 4294967295, nsu = su == 4294967295, noff = off == 4294967295, e = b + l; + var nf = nsc + nsu + noff; + if (z && nf) { + for (; b + 4 < e; b += 4 + b2(d, b + 2)) { + if (b2(d, b) == 1) { + return [ + nsc ? b8(d, b + 4 + 8 * nsu) : sc, + nsu ? b8(d, b + 4) : su, + noff ? b8(d, b + 4 + 8 * (nsu + nsc)) : off, + 1 + ]; + } + } + // z == 2 for unknown whether or not zip64 + if (z < 2) + err(13); + } + return [sc, su, off, 0]; +}; +// extra field length +var exfl = function (ex) { + var le = 0; + if (ex) { + for (var k in ex) { + var l = ex[k].length; + if (l > 65535) + err(9); + le += l + 4; + } + } + return le; +}; +// write zip header +var wzh = function (d, b, f, fn, u, c, ce, co) { + var fl = fn.length, ex = f.extra, col = co && co.length; + var exl = exfl(ex); + wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4; + if (ce != null) + d[b++] = 20, d[b++] = f.os; + d[b] = 20, b += 2; // spec compliance? what's that? + d[b++] = (f.flag << 1) | (c < 0 && 8), d[b++] = u && 8; + d[b++] = f.compression & 255, d[b++] = f.compression >> 8; + var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980; + if (y < 0 || y > 119) + err(10); + wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >> 1)), b += 4; + if (c != -1) { + wbytes(d, b, f.crc); + wbytes(d, b + 4, c < 0 ? -c - 2 : c); + wbytes(d, b + 8, f.size); + } + wbytes(d, b + 12, fl); + wbytes(d, b + 14, exl), b += 16; + if (ce != null) { + wbytes(d, b, col); + wbytes(d, b + 6, f.attrs); + wbytes(d, b + 10, ce), b += 14; + } + d.set(fn, b); + b += fl; + if (exl) { + for (var k in ex) { + var exf = ex[k], l = exf.length; + wbytes(d, b, +k); + wbytes(d, b + 2, l); + d.set(exf, b + 4), b += 4 + l; + } + } + if (col) + d.set(co, b), b += col; + return b; +}; +// write zip footer (end of central directory) +var wzf = function (o, b, c, d, e) { + wbytes(o, b, 0x6054B50); // skip disk + wbytes(o, b + 8, c); + wbytes(o, b + 10, c); + wbytes(o, b + 12, d); + wbytes(o, b + 16, e); +}; +/** + * A pass-through stream to keep data uncompressed in a ZIP archive. + */ +var ZipPassThrough = /*#__PURE__*/ (function () { + /** + * Creates a pass-through stream that can be added to ZIP archives + * @param filename The filename to associate with this data stream + */ + function ZipPassThrough(filename) { + this.filename = filename; + this.c = crc(); + this.size = 0; + this.compression = 0; + } + /** + * Processes a chunk and pushes to the output stream. You can override this + * method in a subclass for custom behavior, but by default this passes + * the data through. You must call this.ondata(err, chunk, final) at some + * point in this method. + * @param chunk The chunk to process + * @param final Whether this is the last chunk + */ + ZipPassThrough.prototype.process = function (chunk, final) { + this.ondata(null, chunk, final); + }; + /** + * Pushes a chunk to be added. If you are subclassing this with a custom + * compression algorithm, note that you must push data from the source + * file only, pre-compression. + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + ZipPassThrough.prototype.push = function (chunk, final) { + if (!this.ondata) + err(5); + this.c.p(chunk); + this.size += chunk.length; + if (final) + this.crc = this.c.d(); + // we shouldn't really do this cast, but properly handling ArrayBufferLike + // makes the API unergonomic with Buffer + this.process(chunk, final || false); + }; + return ZipPassThrough; +}()); +exports.ZipPassThrough = ZipPassThrough; +// I don't extend because TypeScript extension adds 1kB of runtime bloat +/** + * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate + * for better performance + */ +var ZipDeflate = /*#__PURE__*/ (function () { + /** + * Creates a DEFLATE stream that can be added to ZIP archives + * @param filename The filename to associate with this data stream + * @param opts The compression options + */ + function ZipDeflate(filename, opts) { + var _this = this; + if (!opts) + opts = {}; + ZipPassThrough.call(this, filename); + this.d = new Deflate(opts, function (dat, final) { + _this.ondata(null, dat, final); + }); + this.compression = 8; + this.flag = dbf(opts.level); + } + ZipDeflate.prototype.process = function (chunk, final) { + try { + this.d.push(chunk, final); + } + catch (e) { + this.ondata(e, null, final); + } + }; + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + ZipDeflate.prototype.push = function (chunk, final) { + ZipPassThrough.prototype.push.call(this, chunk, final); + }; + return ZipDeflate; +}()); +exports.ZipDeflate = ZipDeflate; +/** + * Asynchronous streaming DEFLATE compression for ZIP archives + */ +var AsyncZipDeflate = /*#__PURE__*/ (function () { + /** + * Creates an asynchronous DEFLATE stream that can be added to ZIP archives + * @param filename The filename to associate with this data stream + * @param opts The compression options + */ + function AsyncZipDeflate(filename, opts) { + var _this = this; + if (!opts) + opts = {}; + ZipPassThrough.call(this, filename); + this.d = new AsyncDeflate(opts, function (err, dat, final) { + _this.ondata(err, dat, final); + }); + this.compression = 8; + this.flag = dbf(opts.level); + this.terminate = this.d.terminate; + } + AsyncZipDeflate.prototype.process = function (chunk, final) { + this.d.push(chunk, final); + }; + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + AsyncZipDeflate.prototype.push = function (chunk, final) { + ZipPassThrough.prototype.push.call(this, chunk, final); + }; + return AsyncZipDeflate; +}()); +exports.AsyncZipDeflate = AsyncZipDeflate; +// TODO: Better tree shaking +/** + * A zippable archive to which files can incrementally be added + */ +var Zip = /*#__PURE__*/ (function () { + /** + * Creates an empty ZIP archive to which files can be added + * @param cb The callback to call whenever data for the generated ZIP archive + * is available + */ + function Zip(cb) { + this.ondata = cb; + this.u = []; + this.d = 1; + } + /** + * Adds a file to the ZIP archive + * @param file The file stream to add + */ + Zip.prototype.add = function (file) { + var _this = this; + if (!this.ondata) + err(5); + // finishing or finished + if (this.d & 2) + this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false); + else { + var f = strToU8(file.filename), fl_1 = f.length; + var com = file.comment, o = com && strToU8(com); + var u = fl_1 != file.filename.length || (o && (com.length != o.length)); + var hl_1 = fl_1 + exfl(file.extra) + 30; + if (fl_1 > 65535) + this.ondata(err(11, 0, 1), null, false); + var header = new u8(hl_1); + wzh(header, 0, file, f, u, -1); + var chks_1 = [header]; + var pAll_1 = function () { + for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) { + var chk = chks_2[_i]; + _this.ondata(null, chk, false); + } + chks_1 = []; + }; + var tr_1 = this.d; + this.d = 0; + var ind_1 = this.u.length; + var uf_1 = mrg(file, { + f: f, + u: u, + o: o, + t: function () { + if (file.terminate) + file.terminate(); + }, + r: function () { + pAll_1(); + if (tr_1) { + var nxt = _this.u[ind_1 + 1]; + if (nxt) + nxt.r(); + else + _this.d = 1; + } + tr_1 = 1; + } + }); + var cl_1 = 0; + file.ondata = function (err, dat, final) { + if (err) { + _this.ondata(err, dat, final); + _this.terminate(); + } + else { + cl_1 += dat.length; + chks_1.push(dat); + if (final) { + var dd = new u8(16); + wbytes(dd, 0, 0x8074B50); + wbytes(dd, 4, file.crc); + wbytes(dd, 8, cl_1); + wbytes(dd, 12, file.size); + chks_1.push(dd); + uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size; + if (tr_1) + uf_1.r(); + tr_1 = 1; + } + else if (tr_1) + pAll_1(); + } + }; + this.u.push(uf_1); + } + }; + /** + * Ends the process of adding files and prepares to emit the final chunks. + * This *must* be called after adding all desired files for the resulting + * ZIP file to work properly. + */ + Zip.prototype.end = function () { + var _this = this; + if (this.d & 2) { + this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true); + return; + } + if (this.d) + this.e(); + else + this.u.push({ + r: function () { + if (!(_this.d & 1)) + return; + _this.u.splice(-1, 1); + _this.e(); + }, + t: function () { } + }); + this.d = 3; + }; + Zip.prototype.e = function () { + var bt = 0, l = 0, tl = 0; + for (var _i = 0, _a = this.u; _i < _a.length; _i++) { + var f = _a[_i]; + tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0); + } + var out = new u8(tl + 22); + for (var _b = 0, _c = this.u; _b < _c.length; _b++) { + var f = _c[_b]; + wzh(out, bt, f, f.f, f.u, -f.c - 2, l, f.o); + bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b; + } + wzf(out, bt, this.u.length, tl, l); + this.ondata(null, out, true); + this.d = 2; + }; + /** + * A method to terminate any internal workers used by the stream. Subsequent + * calls to add() will fail. + */ + Zip.prototype.terminate = function () { + for (var _i = 0, _a = this.u; _i < _a.length; _i++) { + var f = _a[_i]; + f.t(); + } + this.d = 2; + }; + return Zip; +}()); +exports.Zip = Zip; +function zip(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + var r = {}; + fltn(data, '', r, opts); + var k = Object.keys(r); + var lft = k.length, o = 0, tot = 0; + var slft = lft, files = new Array(lft); + var term = []; + var tAll = function () { + for (var i = 0; i < term.length; ++i) + term[i](); + }; + var cbd = function (a, b) { + mt(function () { cb(a, b); }); + }; + mt(function () { cbd = cb; }); + var cbf = function () { + var out = new u8(tot + 22), oe = o, cdl = tot - o; + tot = 0; + for (var i = 0; i < slft; ++i) { + var f = files[i]; + try { + var l = f.c.length; + wzh(out, tot, f, f.f, f.u, l); + var badd = 30 + f.f.length + exfl(f.extra); + var loc = tot + badd; + out.set(f.c, loc); + wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l; + } + catch (e) { + return cbd(e, null); + } + } + wzf(out, o, files.length, cdl, oe); + cbd(null, out); + }; + if (!lft) + cbf(); + var _loop_1 = function (i) { + var fn = k[i]; + var _a = r[fn], file = _a[0], p = _a[1]; + var c = crc(), size = file.length; + c.p(file); + var f = strToU8(fn), s = f.length; + var com = p.comment, m = com && strToU8(com), ms = m && m.length; + var exl = exfl(p.extra); + var compression = p.level == 0 ? 0 : 8; + var cbl = function (e, d) { + if (e) { + tAll(); + cbd(e, null); + } + else { + var l = d.length; + files[i] = mrg(p, { + size: size, + crc: c.d(), + c: d, + f: f, + m: m, + u: s != fn.length || (m && (com.length != ms)), + compression: compression + }); + o += 30 + s + exl + l; + tot += 76 + 2 * (s + exl) + (ms || 0) + l; + if (!--lft) + cbf(); + } + }; + if (s > 65535) + cbl(err(11, 0, 1), null); + if (!compression) + cbl(null, file); + else if (size < 160000) { + try { + cbl(null, deflateSync(file, p)); + } + catch (e) { + cbl(e, null); + } + } + else + term.push(deflate(file, p, cbl)); + }; + // Cannot use lft because it can decrease + for (var i = 0; i < slft; ++i) { + _loop_1(i); + } + return tAll; +} +/** + * Synchronously creates a ZIP file. Prefer using `zip` for better performance + * with more than one file. + * @param data The directory structure for the ZIP archive + * @param opts The main options, merged with per-file options + * @returns The generated ZIP archive + */ +function zipSync(data, opts) { + if (!opts) + opts = {}; + var r = {}; + var files = []; + fltn(data, '', r, opts); + var o = 0; + var tot = 0; + for (var fn in r) { + var _a = r[fn], file = _a[0], p = _a[1]; + var compression = p.level == 0 ? 0 : 8; + var f = strToU8(fn), s = f.length; + var com = p.comment, m = com && strToU8(com), ms = m && m.length; + var exl = exfl(p.extra); + if (s > 65535) + err(11); + var d = compression ? deflateSync(file, p) : file, l = d.length; + var c = crc(); + c.p(file); + files.push(mrg(p, { + size: file.length, + crc: c.d(), + c: d, + f: f, + m: m, + u: s != fn.length || (m && (com.length != ms)), + o: o, + compression: compression + })); + o += 30 + s + exl + l; + tot += 76 + 2 * (s + exl) + (ms || 0) + l; + } + var out = new u8(tot + 22), oe = o, cdl = tot - o; + for (var i = 0; i < files.length; ++i) { + var f = files[i]; + wzh(out, f.o, f, f.f, f.u, f.c.length); + var badd = 30 + f.f.length + exfl(f.extra); + out.set(f.c, f.o + badd); + wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0); + } + wzf(out, o, files.length, cdl, oe); + return out; +} +/** + * Streaming pass-through decompression for ZIP archives + */ +var UnzipPassThrough = /*#__PURE__*/ (function () { + function UnzipPassThrough() { + } + UnzipPassThrough.prototype.push = function (chunk, final) { + // same as ZipPassThrough: cast to retain Buffer ergonomics + this.ondata(null, chunk, final); + }; + UnzipPassThrough.compression = 0; + return UnzipPassThrough; +}()); +exports.UnzipPassThrough = UnzipPassThrough; +/** + * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for + * better performance. + */ +var UnzipInflate = /*#__PURE__*/ (function () { + /** + * Creates a DEFLATE decompression that can be used in ZIP archives + */ + function UnzipInflate() { + var _this = this; + this.i = new Inflate(function (dat, final) { + _this.ondata(null, dat, final); + }); + } + UnzipInflate.prototype.push = function (chunk, final) { + try { + this.i.push(chunk, final); + } + catch (e) { + this.ondata(e, null, final); + } + }; + UnzipInflate.compression = 8; + return UnzipInflate; +}()); +exports.UnzipInflate = UnzipInflate; +/** + * Asynchronous streaming DEFLATE decompression for ZIP archives + */ +var AsyncUnzipInflate = /*#__PURE__*/ (function () { + /** + * Creates a DEFLATE decompression that can be used in ZIP archives + */ + function AsyncUnzipInflate(_, sz) { + var _this = this; + if (sz < 320000) { + this.i = new Inflate(function (dat, final) { + _this.ondata(null, dat, final); + }); + } + else { + this.i = new AsyncInflate(function (err, dat, final) { + _this.ondata(err, dat, final); + }); + this.terminate = this.i.terminate; + } + } + AsyncUnzipInflate.prototype.push = function (chunk, final) { + if (this.i.terminate) + chunk = slc(chunk, 0); + this.i.push(chunk, final); + }; + AsyncUnzipInflate.compression = 8; + return AsyncUnzipInflate; +}()); +exports.AsyncUnzipInflate = AsyncUnzipInflate; +/** + * A ZIP archive decompression stream that emits files as they are discovered + */ +var Unzip = /*#__PURE__*/ (function () { + /** + * Creates a ZIP decompression stream + * @param cb The callback to call whenever a file in the ZIP archive is found + */ + function Unzip(cb) { + this.onfile = cb; + this.k = []; + this.o = { + 0: UnzipPassThrough + }; + this.p = et; + } + /** + * Pushes a chunk to be unzipped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + Unzip.prototype.push = function (chunk, final) { + var _this = this; + if (!this.onfile) + err(5); + if (!this.p) + err(4); + if (this.c > 0) { + var len = Math.min(this.c, chunk.length); + var toAdd = chunk.subarray(0, len); + this.c -= len; + if (this.d) + this.d.push(toAdd, !this.c); + else + this.k[0].push(toAdd); + chunk = chunk.subarray(len); + if (chunk.length) + return this.push(chunk, final); + } + else { + var f = 0, i = 0, is = void 0, buf = void 0; + if (!this.p.length) + buf = chunk; + else if (!chunk.length) + buf = this.p; + else { + buf = new u8(this.p.length + chunk.length); + buf.set(this.p), buf.set(chunk, this.p.length); + } + var l = buf.length, oc = this.c, add = oc && this.d; + var _loop_2 = function () { + var sig = b4(buf, i); + if (sig == 0x4034B50) { + f = 1, is = i; + this_1.d = null; + this_1.c = 0; + var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28); + if (l > i + 30 + fnl + es) { + var chks_3 = []; + this_1.k.unshift(chks_3); + f = 2; + var lsc = b4(buf, i + 18), lsu = b4(buf, i + 22); + var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u); + var _a = z64hs(buf, i, es, 2, lsc, lsu, 0), sc_1 = _a[0], su_1 = _a[1], z64 = _a[3]; + if (dd) + sc_1 = -1 - z64; + i += es; + this_1.c = sc_1; + var d_1; + var file_1 = { + name: fn_1, + compression: cmp_1, + start: function () { + if (!file_1.ondata) + err(5); + if (!sc_1) + file_1.ondata(null, et, true); + else { + var ctr = _this.o[cmp_1]; + if (!ctr) + file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false); + d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1); + d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); }; + for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) { + var dat = chks_4[_i]; + d_1.push(dat, false); + } + if (_this.k[0] == chks_3 && _this.c) + _this.d = d_1; + else + d_1.push(et, true); + } + }, + terminate: function () { + if (d_1 && d_1.terminate) + d_1.terminate(); + } + }; + if (sc_1 >= 0) + file_1.size = sc_1, file_1.originalSize = su_1; + this_1.onfile(file_1); + } + return "break"; + } + else if (oc) { + if (sig == 0x8074B50) { + is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0; + return "break"; + } + else if (sig == 0x2014B50) { + is = i -= 4, f = 3, this_1.c = 0; + return "break"; + } + } + }; + var this_1 = this; + for (; i < l - 4; ++i) { + var state_1 = _loop_2(); + if (state_1 === "break") + break; + } + this.p = et; + if (oc < 0) { + var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i); + if (add) + add.push(dat, !!f); + else + this.k[+(f == 2)].push(dat); + } + if (f & 2) + return this.push(buf.subarray(i), final); + this.p = buf.subarray(i); + } + if (final) { + if (this.c) + err(13); + this.p = null; + } + }; + /** + * Registers a decoder with the stream, allowing for files compressed with + * the compression type provided to be expanded correctly + * @param decoder The decoder constructor + */ + Unzip.prototype.register = function (decoder) { + this.o[decoder.compression] = decoder; + }; + return Unzip; +}()); +exports.Unzip = Unzip; +var mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); }; +function unzip(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != 'function') + err(7); + var term = []; + var tAll = function () { + for (var i = 0; i < term.length; ++i) + term[i](); + }; + var files = {}; + var cbd = function (a, b) { + mt(function () { cb(a, b); }); + }; + mt(function () { cbd = cb; }); + var e = data.length - 22; + for (; b4(data, e) != 0x6054B50; --e) { + if (!e || data.length - e > 65558) { + cbd(err(13, 0, 1), null); + return tAll; + } + } + ; + var lft = b2(data, e + 8); + if (lft) { + var c = lft; + var o = b4(data, e + 16); + var z = b4(data, e - 20) == 0x7064B50; + if (z) { + var ze = b4(data, e - 12); + z = b4(data, ze) == 0x6064B50; + if (z) { + c = lft = b4(data, ze + 32); + o = b4(data, ze + 48); + } + } + var fltr = opts && opts.filter; + var _loop_3 = function (i) { + var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off); + o = no; + var cbl = function (e, d) { + if (e) { + tAll(); + cbd(e, null); + } + else { + if (d) + files[fn] = d; + if (!--lft) + cbd(null, files); + } + }; + if (!fltr || fltr({ + name: fn, + size: sc, + originalSize: su, + compression: c_1 + })) { + if (!c_1) + cbl(null, slc(data, b, b + sc)); + else if (c_1 == 8) { + var infl = data.subarray(b, b + sc); + // Synchronously decompress under 512KB, or barely-compressed data + if (su < 524288 || sc > 0.8 * su) { + try { + cbl(null, inflateSync(infl, { out: new u8(su) })); + } + catch (e) { + cbl(e, null); + } + } + else + term.push(inflate(infl, { size: su }, cbl)); + } + else + cbl(err(14, 'unknown compression type ' + c_1, 1), null); + } + else + cbl(null, null); + }; + for (var i = 0; i < c; ++i) { + _loop_3(i); + } + } + else + cbd(null, {}); + return tAll; +} +/** + * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better + * performance with more than one file. + * @param data The raw compressed ZIP file + * @param opts The ZIP extraction options + * @returns The decompressed files + */ +function unzipSync(data, opts) { + var files = {}; + var e = data.length - 22; + for (; b4(data, e) != 0x6054B50; --e) { + if (!e || data.length - e > 65558) + err(13); + } + ; + var c = b2(data, e + 8); + if (!c) + return {}; + var o = b4(data, e + 16); + var z = b4(data, e - 20) == 0x7064B50; + if (z) { + var ze = b4(data, e - 12); + z = b4(data, ze) == 0x6064B50; + if (z) { + c = b4(data, ze + 32); + o = b4(data, ze + 48); + } + } + var fltr = opts && opts.filter; + for (var i = 0; i < c; ++i) { + var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off); + o = no; + if (!fltr || fltr({ + name: fn, + size: sc, + originalSize: su, + compression: c_2 + })) { + if (!c_2) + files[fn] = slc(data, b, b + sc); + else if (c_2 == 8) + files[fn] = inflateSync(data.subarray(b, b + sc), { out: new u8(su) }); + else + err(14, 'unknown compression type ' + c_2); + } + } + return files; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/lib/node.d.cts b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/lib/node.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..d430faf2b555c978d66c89f46155b72c2c45a971 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/lib/node.d.cts @@ -0,0 +1,1539 @@ +/** + * Codes for errors generated within this library + */ +export declare const FlateErrorCode: { + readonly UnexpectedEOF: 0; + readonly InvalidBlockType: 1; + readonly InvalidLengthLiteral: 2; + readonly InvalidDistance: 3; + readonly StreamFinished: 4; + readonly NoStreamHandler: 5; + readonly InvalidHeader: 6; + readonly NoCallback: 7; + readonly InvalidUTF8: 8; + readonly ExtraFieldTooLong: 9; + readonly InvalidDate: 10; + readonly FilenameTooLong: 11; + readonly StreamFinishing: 12; + readonly InvalidZipData: 13; + readonly UnknownCompressionMethod: 14; +}; +/** + * An error generated within this library + */ +export interface FlateError extends Error { + /** + * The code associated with this error + */ + code: number; +} +/** + * Options for decompressing a DEFLATE stream + */ +export interface InflateStreamOptions { + /** + * The dictionary used to compress the original data. If no dictionary was used during compression, this option has no effect. + * + * Supplying the wrong dictionary during decompression usually yields corrupt output or causes an invalid distance error. + */ + dictionary?: Uint8Array; +} +/** + * Options for decompressing DEFLATE data + */ +export interface InflateOptions extends InflateStreamOptions { + /** + * The buffer into which to write the decompressed data. Saves memory if you know the decompressed size in advance. + * + * Note that if the decompression result is larger than the size of this buffer, it will be truncated to fit. + */ + out?: Uint8Array; +} +/** + * Options for decompressing a GZIP stream + */ +export interface GunzipStreamOptions extends InflateStreamOptions { +} +/** + * Options for decompressing GZIP data + */ +export interface GunzipOptions extends InflateStreamOptions { + /** + * The buffer into which to write the decompressed data. GZIP already encodes the output size, so providing this doesn't save memory. + * + * Note that if the decompression result is larger than the size of this buffer, it will be truncated to fit. + */ + out?: Uint8Array; +} +/** + * Options for decompressing a Zlib stream + */ +export interface UnzlibStreamOptions extends InflateStreamOptions { +} +/** + * Options for decompressing Zlib data + */ +export interface UnzlibOptions extends InflateOptions { +} +/** + * Options for compressing data into a DEFLATE format + */ +export interface DeflateOptions { + /** + * The level of compression to use, ranging from 0-9. + * + * 0 will store the data without compression. + * 1 is fastest but compresses the worst, 9 is slowest but compresses the best. + * The default level is 6. + * + * Typically, binary data benefits much more from higher values than text data. + * In both cases, higher values usually take disproportionately longer than the reduction in final size that results. + * + * For example, a 1 MB text file could: + * - become 1.01 MB with level 0 in 1ms + * - become 400 kB with level 1 in 10ms + * - become 320 kB with level 9 in 100ms + */ + level?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; + /** + * The memory level to use, ranging from 0-12. Increasing this increases speed and compression ratio at the cost of memory. + * + * Note that this is exponential: while level 0 uses 8 kB, level 4 uses 128 kB, level 8 uses 2 MB, and level 12 uses 32 MB. + * It is recommended not to lower the value below 4, since that tends to hurt performance. + * In addition, values above 8 tend to help very little on most data and can even hurt performance. + * + * The default value is automatically determined based on the size of the input data. + */ + mem?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12; + /** + * A buffer containing common byte sequences in the input data that can be used to significantly improve compression ratios. + * + * Dictionaries should be 32kB or smaller and include strings or byte sequences likely to appear in the input. + * The decompressor must supply the same dictionary as the compressor to extract the original data. + * + * Dictionaries only improve aggregate compression ratio when reused across multiple small inputs. They should typically not be used otherwise. + * + * Avoid using dictionaries with GZIP and ZIP to maximize software compatibility. + */ + dictionary?: Uint8Array; +} +/** + * Options for compressing data into a GZIP format + */ +export interface GzipOptions extends DeflateOptions { + /** + * When the file was last modified. Defaults to the current time. + * Set this to 0 to avoid revealing a modification date entirely. + */ + mtime?: Date | string | number; + /** + * The filename of the data. If the `gunzip` command is used to decompress the data, it will output a file + * with this name instead of the name of the compressed file. + */ + filename?: string; +} +/** + * Options for compressing data into a Zlib format + */ +export interface ZlibOptions extends DeflateOptions { +} +/** + * Handler for data (de)compression streams + * @param data The data output from the stream processor + * @param final Whether this is the final block + */ +export type FlateStreamHandler = (data: Uint8Array, final: boolean) => void; +/** + * Handler for asynchronous data (de)compression streams + * @param err Any error that occurred + * @param data The data output from the stream processor + * @param final Whether this is the final block + */ +export type AsyncFlateStreamHandler = (err: FlateError | null, data: Uint8Array, final: boolean) => void; +/** + * Handler for the asynchronous completion of (de)compression for a data chunk + * @param size The number of bytes that were processed. This is measured in terms of the input + * (i.e. compressed bytes for decompression, uncompressed bytes for compression.) + */ +export type AsyncFlateDrainHandler = (size: number) => void; +/** + * Callback for asynchronous (de)compression methods + * @param err Any error that occurred + * @param data The resulting data. Only present if `err` is null + */ +export type FlateCallback = (err: FlateError | null, data: Uint8Array) => void; +interface AsyncOptions { + /** + * Whether or not to "consume" the source data. This will make the typed array/buffer you pass in + * unusable but will increase performance and reduce memory usage. + */ + consume?: boolean; +} +/** + * Options for compressing data asynchronously into a DEFLATE format + */ +export interface AsyncDeflateOptions extends DeflateOptions, AsyncOptions { +} +/** + * Options for decompressing DEFLATE data asynchronously + */ +export interface AsyncInflateOptions extends AsyncOptions, InflateStreamOptions { + /** + * The original size of the data. Currently, the asynchronous API disallows + * writing into a buffer you provide; the best you can do is provide the + * size in bytes and be given back a new typed array. + */ + size?: number; +} +/** + * Options for compressing data asynchronously into a GZIP format + */ +export interface AsyncGzipOptions extends GzipOptions, AsyncOptions { +} +/** + * Options for decompressing GZIP data asynchronously + */ +export interface AsyncGunzipOptions extends AsyncOptions, InflateStreamOptions { +} +/** + * Options for compressing data asynchronously into a Zlib format + */ +export interface AsyncZlibOptions extends ZlibOptions, AsyncOptions { +} +/** + * Options for decompressing Zlib data asynchronously + */ +export interface AsyncUnzlibOptions extends AsyncInflateOptions { +} +/** + * A terminable compression/decompression process + */ +export interface AsyncTerminable { + /** + * Terminates the worker thread immediately. The callback will not be called. + */ + (): void; +} +/** + * Streaming DEFLATE compression + */ +export declare class Deflate { + /** + * Creates a DEFLATE stream + * @param opts The compression options + * @param cb The callback to call whenever data is deflated + */ + constructor(opts: DeflateOptions, cb?: FlateStreamHandler); + /** + * Creates a DEFLATE stream + * @param cb The callback to call whenever data is deflated + */ + constructor(cb?: FlateStreamHandler); + private b; + private s; + private o; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + private p; + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * deflated output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. A separate DEFLATE stream may be concatenated + * with the current output after a sync flush. + */ + flush(sync?: boolean): void; +} +/** + * Asynchronous streaming DEFLATE compression + */ +export declare class AsyncDeflate { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of uncompressed bytes buffered in the stream + */ + queuedSize: number; + /** + * Creates an asynchronous DEFLATE stream + * @param opts The compression options + * @param cb The callback to call whenever data is deflated + */ + constructor(opts: DeflateOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous DEFLATE stream + * @param cb The callback to call whenever data is deflated + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * deflated output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. A separate DEFLATE stream may be concatenated + * with the current output after a sync flush. + */ + flush(sync?: boolean): void; + /** + * A method to terminate the stream's internal worker. Subsequent calls to + * push() will silently fail. + */ + terminate: AsyncTerminable; +} +/** + * Asynchronously compresses data with DEFLATE without any wrapper + * @param data The data to compress + * @param opts The compression options + * @param cb The function to be called upon compression completion + * @returns A function that can be used to immediately terminate the compression + */ +export declare function deflate(data: Uint8Array, opts: AsyncDeflateOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously compresses data with DEFLATE without any wrapper + * @param data The data to compress + * @param cb The function to be called upon compression completion + */ +export declare function deflate(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Compresses data with DEFLATE without any wrapper + * @param data The data to compress + * @param opts The compression options + * @returns The deflated version of the data + */ +export declare function deflateSync(data: Uint8Array, opts?: DeflateOptions): Uint8Array; +/** + * Streaming DEFLATE decompression + */ +export declare class Inflate { + private s; + private o; + private p; + private d; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + /** + * Creates a DEFLATE decompression stream + * @param opts The decompression options + * @param cb The callback to call whenever data is inflated + */ + constructor(opts: InflateStreamOptions, cb?: FlateStreamHandler); + /** + * Creates a DEFLATE decompression stream + * @param cb The callback to call whenever data is inflated + */ + constructor(cb?: FlateStreamHandler); + private e; + private c; + /** + * Pushes a chunk to be inflated + * @param chunk The chunk to push + * @param final Whether this is the final chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Asynchronous streaming DEFLATE decompression + */ +export declare class AsyncInflate { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of compressed bytes buffered in the stream + */ + queuedSize: number; + /** + * Creates an asynchronous DEFLATE decompression stream + * @param opts The decompression options + * @param cb The callback to call whenever data is inflated + */ + constructor(opts: InflateStreamOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous DEFLATE decompression stream + * @param cb The callback to call whenever data is inflated + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Pushes a chunk to be inflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * A method to terminate the stream's internal worker. Subsequent calls to + * push() will silently fail. + */ + terminate: AsyncTerminable; +} +/** + * Asynchronously expands DEFLATE data with no wrapper + * @param data The data to decompress + * @param opts The decompression options + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function inflate(data: Uint8Array, opts: AsyncInflateOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously expands DEFLATE data with no wrapper + * @param data The data to decompress + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function inflate(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Expands DEFLATE data with no wrapper + * @param data The data to decompress + * @returns The decompressed version of the data + */ +export declare function inflateSync(data: Uint8Array): Uint8Array; +/** + * Expands DEFLATE data with no wrapper + * @param data The data to decompress + * @param opts The decompression options + * @returns The decompressed version of the data + */ +export declare function inflateSync(data: Uint8Array, opts?: InflateOptions): Uint8Array; +/** + * Streaming GZIP compression + */ +export declare class Gzip { + private c; + private l; + private v; + private o; + private s; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + /** + * Creates a GZIP stream + * @param opts The compression options + * @param cb The callback to call whenever data is deflated + */ + constructor(opts: GzipOptions, cb?: FlateStreamHandler); + /** + * Creates a GZIP stream + * @param cb The callback to call whenever data is deflated + */ + constructor(cb?: FlateStreamHandler); + /** + * Pushes a chunk to be GZIPped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + private p; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * GZIPped output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. + */ + flush(sync?: boolean): void; +} +/** + * Asynchronous streaming GZIP compression + */ +export declare class AsyncGzip { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of uncompressed bytes buffered in the stream + */ + queuedSize: number; + /** + * Creates an asynchronous GZIP stream + * @param opts The compression options + * @param cb The callback to call whenever data is deflated + */ + constructor(opts: GzipOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous GZIP stream + * @param cb The callback to call whenever data is deflated + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Pushes a chunk to be GZIPped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * GZIPped output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. + */ + flush(sync?: boolean): void; + /** + * A method to terminate the stream's internal worker. Subsequent calls to + * push() will silently fail. + */ + terminate: AsyncTerminable; +} +/** + * Asynchronously compresses data with GZIP + * @param data The data to compress + * @param opts The compression options + * @param cb The function to be called upon compression completion + * @returns A function that can be used to immediately terminate the compression + */ +export declare function gzip(data: Uint8Array, opts: AsyncGzipOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously compresses data with GZIP + * @param data The data to compress + * @param cb The function to be called upon compression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function gzip(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Compresses data with GZIP + * @param data The data to compress + * @param opts The compression options + * @returns The gzipped version of the data + */ +export declare function gzipSync(data: Uint8Array, opts?: GzipOptions): Uint8Array; +/** + * Handler for new GZIP members in concatenated GZIP streams. Useful for building indices used to perform random-access reads on compressed files. + * @param offset The offset of the new member relative to the start of the stream + */ +export type GunzipMemberHandler = (offset: number) => void; +/** + * Streaming single or multi-member GZIP decompression + */ +export declare class Gunzip { + private v; + private r; + private o; + private p; + private s; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + /** + * The handler to call whenever a new GZIP member is found + */ + onmember?: GunzipMemberHandler; + /** + * Creates a GUNZIP stream + * @param opts The decompression options + * @param cb The callback to call whenever data is inflated + */ + constructor(opts: GunzipStreamOptions, cb?: FlateStreamHandler); + /** + * Creates a GUNZIP stream + * @param cb The callback to call whenever data is inflated + */ + constructor(cb?: FlateStreamHandler); + /** + * Pushes a chunk to be GUNZIPped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Asynchronous streaming single or multi-member GZIP decompression + */ +export declare class AsyncGunzip { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of compressed bytes buffered in the stream + */ + queuedSize: number; + /** + * The handler to call whenever a new GZIP member is found + */ + onmember?: GunzipMemberHandler; + /** + * Creates an asynchronous GUNZIP stream + * @param opts The decompression options + * @param cb The callback to call whenever data is inflated + */ + constructor(opts: GunzipStreamOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous GUNZIP stream + * @param cb The callback to call whenever data is inflated + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Pushes a chunk to be GUNZIPped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * A method to terminate the stream's internal worker. Subsequent calls to + * push() will silently fail. + */ + terminate: AsyncTerminable; +} +/** + * Asynchronously expands GZIP data + * @param data The data to decompress + * @param opts The decompression options + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function gunzip(data: Uint8Array, opts: AsyncGunzipOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously expands GZIP data + * @param data The data to decompress + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function gunzip(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Expands GZIP data + * @param data The data to decompress + * @returns The decompressed version of the data + */ +export declare function gunzipSync(data: Uint8Array): Uint8Array; +/** + * Expands GZIP data + * @param data The data to decompress + * @param opts The decompression options + * @returns The decompressed version of the data + */ +export declare function gunzipSync(data: Uint8Array, opts?: GunzipOptions): Uint8Array; +/** + * Streaming Zlib compression + */ +export declare class Zlib { + private c; + private v; + private o; + private s; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + /** + * Creates a Zlib stream + * @param opts The compression options + * @param cb The callback to call whenever data is deflated + */ + constructor(opts: ZlibOptions, cb?: FlateStreamHandler); + /** + * Creates a Zlib stream + * @param cb The callback to call whenever data is deflated + */ + constructor(cb?: FlateStreamHandler); + /** + * Pushes a chunk to be zlibbed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + private p; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * zlibbed output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. + */ + flush(sync?: boolean): void; +} +/** + * Asynchronous streaming Zlib compression + */ +export declare class AsyncZlib { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of uncompressed bytes buffered in the stream + */ + queuedSize: number; + /** + * Creates an asynchronous Zlib stream + * @param opts The compression options + * @param cb The callback to call whenever data is deflated + */ + constructor(opts: ZlibOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous Zlib stream + * @param cb The callback to call whenever data is deflated + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * Flushes buffered uncompressed data. Useful to immediately retrieve the + * zlibbed output for small inputs. + * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5 + * extra bytes, but guarantees all pushed data is immediately + * decompressible. + */ + flush(sync?: boolean): void; + /** + * A method to terminate the stream's internal worker. Subsequent calls to + * push() will silently fail. + */ + terminate: AsyncTerminable; +} +/** + * Asynchronously compresses data with Zlib + * @param data The data to compress + * @param opts The compression options + * @param cb The function to be called upon compression completion + */ +export declare function zlib(data: Uint8Array, opts: AsyncZlibOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously compresses data with Zlib + * @param data The data to compress + * @param cb The function to be called upon compression completion + * @returns A function that can be used to immediately terminate the compression + */ +export declare function zlib(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Compress data with Zlib + * @param data The data to compress + * @param opts The compression options + * @returns The zlib-compressed version of the data + */ +export declare function zlibSync(data: Uint8Array, opts?: ZlibOptions): Uint8Array; +/** + * Streaming Zlib decompression + */ +export declare class Unzlib { + private v; + private p; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + /** + * Creates a Zlib decompression stream + * @param opts The decompression options + * @param cb The callback to call whenever data is inflated + */ + constructor(opts: UnzlibStreamOptions, cb?: FlateStreamHandler); + /** + * Creates a Zlib decompression stream + * @param cb The callback to call whenever data is inflated + */ + constructor(cb?: FlateStreamHandler); + /** + * Pushes a chunk to be unzlibbed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Asynchronous streaming Zlib decompression + */ +export declare class AsyncUnzlib { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of compressed bytes buffered in the stream + */ + queuedSize: number; + /** + * Creates an asynchronous Zlib decompression stream + * @param opts The decompression options + * @param cb The callback to call whenever data is inflated + */ + constructor(opts: UnzlibStreamOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous Zlib decompression stream + * @param cb The callback to call whenever data is inflated + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Pushes a chunk to be decompressed from Zlib + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * A method to terminate the stream's internal worker. Subsequent calls to + * push() will silently fail. + */ + terminate: AsyncTerminable; +} +/** + * Asynchronously expands Zlib data + * @param data The data to decompress + * @param opts The decompression options + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function unzlib(data: Uint8Array, opts: AsyncUnzlibOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously expands Zlib data + * @param data The data to decompress + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function unzlib(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Expands Zlib data + * @param data The data to decompress + * @returns The decompressed version of the data + */ +export declare function unzlibSync(data: Uint8Array): Uint8Array; +/** + * Expands Zlib data + * @param data The data to decompress + * @param opts The decompression options + * @returns The decompressed version of the data + */ +export declare function unzlibSync(data: Uint8Array, opts?: UnzlibOptions): Uint8Array; +export { gzip as compress, AsyncGzip as AsyncCompress }; +export { gzipSync as compressSync, Gzip as Compress }; +/** + * Streaming GZIP, Zlib, or raw DEFLATE decompression + */ +export declare class Decompress { + private G; + private I; + private Z; + private o; + private s; + private p; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; + /** + * Creates a decompression stream + * @param opts The decompression options + * @param cb The callback to call whenever data is decompressed + */ + constructor(opts: InflateStreamOptions, cb?: FlateStreamHandler); + /** + * Creates a decompression stream + * @param cb The callback to call whenever data is decompressed + */ + constructor(cb?: FlateStreamHandler); + private i; + /** + * Pushes a chunk to be decompressed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression + */ +export declare class AsyncDecompress { + private G; + private I; + private Z; + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The handler to call whenever buffered source data is processed (i.e. `queuedSize` updates) + */ + ondrain?: AsyncFlateDrainHandler; + /** + * The number of compressed bytes buffered in the stream + */ + queuedSize: number; + /** + * Creates an asynchronous decompression stream + * @param opts The decompression options + * @param cb The callback to call whenever data is decompressed + */ + constructor(opts: InflateStreamOptions, cb?: AsyncFlateStreamHandler); + /** + * Creates an asynchronous decompression stream + * @param cb The callback to call whenever data is decompressed + */ + constructor(cb?: AsyncFlateStreamHandler); + private i; + /** + * Pushes a chunk to be decompressed + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Asynchrononously expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format + * @param data The data to decompress + * @param opts The decompression options + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function decompress(data: Uint8Array, opts: AsyncInflateOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchrononously expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format + * @param data The data to decompress + * @param cb The function to be called upon decompression completion + * @returns A function that can be used to immediately terminate the decompression + */ +export declare function decompress(data: Uint8Array, cb: FlateCallback): AsyncTerminable; +/** + * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format + * @param data The data to decompress + * @param opts The decompression options + * @returns The decompressed version of the data + */ +export declare function decompressSync(data: Uint8Array, opts?: InflateOptions): Uint8Array; +/** + * Attributes for files added to a ZIP archive object + */ +export interface ZipAttributes { + /** + * The operating system of origin for this file. The value is defined + * by PKZIP's APPNOTE.txt, section 4.4.2.2. For example, 0 (the default) + * is MS/DOS, 3 is Unix, 19 is macOS. + */ + os?: number; + /** + * The file's attributes. These are traditionally somewhat complicated + * and platform-dependent, so using them is scarcely necessary. However, + * here is a representation of what this is, bit by bit: + * + * `TTTTugtrwxrwxrwx0000000000ADVSHR` + * + * TTTT = file type (rarely useful) + * + * u = setuid, g = setgid, t = sticky + * + * rwx = user permissions, rwx = group permissions, rwx = other permissions + * + * 0000000000 = unused + * + * A = archive, D = directory, V = volume label, S = system file, H = hidden, R = read-only + * + * If you want to set the Unix permissions, for instance, just bit shift by 16, e.g. 0o644 << 16. + * Note that attributes usually only work in conjunction with the `os` setting: you must use + * `os` = 3 (Unix) if you want to set Unix permissions + */ + attrs?: number; + /** + * Extra metadata to add to the file. This field is defined by PKZIP's APPNOTE.txt, + * section 4.4.28. At most 65,535 bytes may be used in each ID. The ID must be an + * integer between 0 and 65,535, inclusive. + * + * This field is incredibly rare and almost never needed except for compliance with + * proprietary standards and software. + */ + extra?: Record; + /** + * The comment to attach to the file. This field is defined by PKZIP's APPNOTE.txt, + * section 4.4.26. The comment must be at most 65,535 bytes long UTF-8 encoded. This + * field is not read by consumer software. + */ + comment?: string; + /** + * When the file was last modified. Defaults to the current time. + */ + mtime?: GzipOptions['mtime']; +} +/** + * Options for creating a ZIP archive + */ +export interface ZipOptions extends DeflateOptions, ZipAttributes { +} +/** + * Options for expanding a ZIP archive + */ +export interface UnzipOptions { + /** + * A filter function to extract only certain files from a ZIP archive + */ + filter?: UnzipFileFilter; +} +/** + * Options for asynchronously creating a ZIP archive + */ +export interface AsyncZipOptions extends AsyncDeflateOptions, ZipAttributes { +} +/** + * Options for asynchronously expanding a ZIP archive + */ +export interface AsyncUnzipOptions extends UnzipOptions { +} +/** + * A file that can be used to create a ZIP archive + */ +export type ZippableFile = Uint8Array | Zippable | [Uint8Array | Zippable, ZipOptions]; +/** + * A file that can be used to asynchronously create a ZIP archive + */ +export type AsyncZippableFile = Uint8Array | AsyncZippable | [Uint8Array | AsyncZippable, AsyncZipOptions]; +/** + * The complete directory structure of a ZIPpable archive + */ +export interface Zippable { + [path: string]: ZippableFile; +} +/** + * The complete directory structure of an asynchronously ZIPpable archive + */ +export interface AsyncZippable { + [path: string]: AsyncZippableFile; +} +/** + * An unzipped archive. The full path of each file is used as the key, + * and the file is the value + */ +export interface Unzipped { + [path: string]: Uint8Array; +} +/** + * Handler for string generation streams + * @param data The string output from the stream processor + * @param final Whether this is the final block + */ +export type StringStreamHandler = (data: string, final: boolean) => void; +/** + * Callback for asynchronous ZIP decompression + * @param err Any error that occurred + * @param data The decompressed ZIP archive + */ +export type UnzipCallback = (err: FlateError | null, data: Unzipped) => void; +/** + * Handler for streaming ZIP decompression + * @param file The file that was found in the archive + */ +export type UnzipFileHandler = (file: UnzipFile) => void; +/** + * Streaming UTF-8 decoding + */ +export declare class DecodeUTF8 { + private p; + private t; + /** + * Creates a UTF-8 decoding stream + * @param cb The callback to call whenever data is decoded + */ + constructor(cb?: StringStreamHandler); + /** + * Pushes a chunk to be decoded from UTF-8 binary + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * The handler to call whenever data is available + */ + ondata: StringStreamHandler; +} +/** + * Streaming UTF-8 encoding + */ +export declare class EncodeUTF8 { + private d; + /** + * Creates a UTF-8 decoding stream + * @param cb The callback to call whenever data is encoded + */ + constructor(cb?: FlateStreamHandler); + /** + * Pushes a chunk to be encoded to UTF-8 + * @param chunk The string data to push + * @param final Whether this is the last chunk + */ + push(chunk: string, final?: boolean): void; + /** + * The handler to call whenever data is available + */ + ondata: FlateStreamHandler; +} +/** + * Converts a string into a Uint8Array for use with compression/decompression methods + * @param str The string to encode + * @param latin1 Whether or not to interpret the data as Latin-1. This should + * not need to be true unless decoding a binary string. + * @returns The string encoded in UTF-8/Latin-1 binary + */ +export declare function strToU8(str: string, latin1?: boolean): Uint8Array; +/** + * Converts a Uint8Array to a string + * @param dat The data to decode to string + * @param latin1 Whether or not to interpret the data as Latin-1. This should + * not need to be true unless encoding to binary string. + * @returns The original UTF-8/Latin-1 string + */ +export declare function strFromU8(dat: Uint8Array, latin1?: boolean): string; +/** + * A stream that can be used to create a file in a ZIP archive + */ +export interface ZipInputFile extends ZipAttributes { + /** + * The filename to associate with the data provided to this stream. If you + * want a file in a subdirectory, use forward slashes as a separator (e.g. + * `directory/filename.ext`). This will still work on Windows. + */ + filename: string; + /** + * The size of the file in bytes. This attribute may be invalid after + * the file is added to the ZIP archive; it must be correct only before the + * stream completes. + * + * If you don't want to have to compute this yourself, consider extending the + * ZipPassThrough class and overriding its process() method, or using one of + * ZipDeflate or AsyncZipDeflate. + */ + size: number; + /** + * A CRC of the original file contents. This attribute may be invalid after + * the file is added to the ZIP archive; it must be correct only before the + * stream completes. + * + * If you don't want to have to generate this yourself, consider extending the + * ZipPassThrough class and overriding its process() method, or using one of + * ZipDeflate or AsyncZipDeflate. + */ + crc: number; + /** + * The compression format for the data stream. This number is determined by + * the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no + * compression, 8 = deflate, 14 = LZMA + */ + compression: number; + /** + * Bits 1 and 2 of the general purpose bit flag, specified in PKZIP's + * APPNOTE.txt, section 4.4.4. Should be between 0 and 3. This is unlikely + * to be necessary. + */ + flag?: number; + /** + * The handler to be called when data is added. After passing this stream to + * the ZIP file object, this handler will always be defined. To call it: + * + * `stream.ondata(error, chunk, final)` + * + * error = any error that occurred (null if there was no error) + * + * chunk = a Uint8Array of the data that was added (null if there was an + * error) + * + * final = boolean, whether this is the final chunk in the stream + */ + ondata?: AsyncFlateStreamHandler; + /** + * A method called when the stream is no longer needed, for clean-up + * purposes. This will not always be called after the stream completes, + * so you may wish to call this.terminate() after the final chunk is + * processed if you have clean-up logic. + */ + terminate?: AsyncTerminable; +} +/** + * A pass-through stream to keep data uncompressed in a ZIP archive. + */ +export declare class ZipPassThrough implements ZipInputFile { + filename: string; + crc: number; + size: number; + compression: number; + os?: number; + attrs?: number; + comment?: string; + extra?: Record; + mtime?: GzipOptions['mtime']; + ondata: AsyncFlateStreamHandler; + private c; + /** + * Creates a pass-through stream that can be added to ZIP archives + * @param filename The filename to associate with this data stream + */ + constructor(filename: string); + /** + * Processes a chunk and pushes to the output stream. You can override this + * method in a subclass for custom behavior, but by default this passes + * the data through. You must call this.ondata(err, chunk, final) at some + * point in this method. + * @param chunk The chunk to process + * @param final Whether this is the last chunk + */ + protected process(chunk: Uint8Array, final: boolean): void; + /** + * Pushes a chunk to be added. If you are subclassing this with a custom + * compression algorithm, note that you must push data from the source + * file only, pre-compression. + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate + * for better performance + */ +export declare class ZipDeflate implements ZipInputFile { + filename: string; + crc: number; + size: number; + compression: number; + flag: 0 | 1 | 2 | 3; + os?: number; + attrs?: number; + comment?: string; + extra?: Record; + mtime?: GzipOptions['mtime']; + ondata: AsyncFlateStreamHandler; + private d; + /** + * Creates a DEFLATE stream that can be added to ZIP archives + * @param filename The filename to associate with this data stream + * @param opts The compression options + */ + constructor(filename: string, opts?: DeflateOptions); + private process; + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * Asynchronous streaming DEFLATE compression for ZIP archives + */ +export declare class AsyncZipDeflate implements ZipInputFile { + filename: string; + crc: number; + size: number; + compression: number; + flag: 0 | 1 | 2 | 3; + os?: number; + attrs?: number; + comment?: string; + extra?: Record; + mtime?: GzipOptions['mtime']; + ondata: AsyncFlateStreamHandler; + private d; + terminate: AsyncTerminable; + /** + * Creates an asynchronous DEFLATE stream that can be added to ZIP archives + * @param filename The filename to associate with this data stream + * @param opts The compression options + */ + constructor(filename: string, opts?: DeflateOptions); + private process; + /** + * Pushes a chunk to be deflated + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; +} +/** + * A zippable archive to which files can incrementally be added + */ +export declare class Zip { + private u; + private d; + /** + * Creates an empty ZIP archive to which files can be added + * @param cb The callback to call whenever data for the generated ZIP archive + * is available + */ + constructor(cb?: AsyncFlateStreamHandler); + /** + * Adds a file to the ZIP archive + * @param file The file stream to add + */ + add(file: ZipInputFile): void; + /** + * Ends the process of adding files and prepares to emit the final chunks. + * This *must* be called after adding all desired files for the resulting + * ZIP file to work properly. + */ + end(): void; + private e; + /** + * A method to terminate any internal workers used by the stream. Subsequent + * calls to add() will fail. + */ + terminate(): void; + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; +} +/** + * Asynchronously creates a ZIP file + * @param data The directory structure for the ZIP archive + * @param opts The main options, merged with per-file options + * @param cb The callback to call with the generated ZIP archive + * @returns A function that can be used to immediately terminate the compression + */ +export declare function zip(data: AsyncZippable, opts: AsyncZipOptions, cb: FlateCallback): AsyncTerminable; +/** + * Asynchronously creates a ZIP file + * @param data The directory structure for the ZIP archive + * @param cb The callback to call with the generated ZIP archive + * @returns A function that can be used to immediately terminate the compression + */ +export declare function zip(data: AsyncZippable, cb: FlateCallback): AsyncTerminable; +/** + * Synchronously creates a ZIP file. Prefer using `zip` for better performance + * with more than one file. + * @param data The directory structure for the ZIP archive + * @param opts The main options, merged with per-file options + * @returns The generated ZIP archive + */ +export declare function zipSync(data: Zippable, opts?: ZipOptions): Uint8Array; +/** + * A decoder for files in ZIP streams + */ +export interface UnzipDecoder { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * Pushes a chunk to be decompressed + * @param chunk The data in this chunk. Do not consume (detach) this buffer. + * @param final Whether this is the last chunk in the data stream + */ + push(chunk: Uint8Array, final: boolean): void; + /** + * A method to terminate any internal workers used by the stream. Subsequent + * calls to push() should silently fail. + */ + terminate?: AsyncTerminable; +} +/** + * A constructor for a decoder for unzip streams + */ +export interface UnzipDecoderConstructor { + /** + * Creates an instance of the decoder + * @param filename The name of the file + * @param size The compressed size of the file + * @param originalSize The original size of the file + */ + new (filename: string, size?: number, originalSize?: number): UnzipDecoder; + /** + * The compression format for the data stream. This number is determined by + * the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no + * compression, 8 = deflate, 14 = LZMA + */ + compression: number; +} +/** + * Information about a file to be extracted from a ZIP archive + */ +export interface UnzipFileInfo { + /** + * The name of the file + */ + name: string; + /** + * The compressed size of the file + */ + size: number; + /** + * The original size of the file + */ + originalSize: number; + /** + * The compression format for the data stream. This number is determined by + * the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no + * compression, 8 = deflate, 14 = LZMA. If the filter function returns true + * but this value is not 8, the unzip function will throw. + */ + compression: number; +} +/** + * A filter for files to be extracted during the unzipping process + * @param file The info for the current file being processed + * @returns Whether or not to extract the current file + */ +export type UnzipFileFilter = (file: UnzipFileInfo) => boolean; +/** + * Streaming file extraction from ZIP archives + */ +export interface UnzipFile { + /** + * The handler to call whenever data is available + */ + ondata: AsyncFlateStreamHandler; + /** + * The name of the file + */ + name: string; + /** + * The compression format for the data stream. This number is determined by + * the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no + * compression, 8 = deflate, 14 = LZMA. If start() is called but there is no + * decompression stream available for this method, start() will throw. + */ + compression: number; + /** + * The compressed size of the file. Will not be present for archives created + * in a streaming fashion. + */ + size?: number; + /** + * The original size of the file. Will not be present for archives created + * in a streaming fashion. + */ + originalSize?: number; + /** + * Starts reading from the stream. Calling this function will always enable + * this stream, but ocassionally the stream will be enabled even without + * this being called. + */ + start(): void; + /** + * A method to terminate any internal workers used by the stream. ondata + * will not be called any further. + */ + terminate: AsyncTerminable; +} +/** + * Streaming pass-through decompression for ZIP archives + */ +export declare class UnzipPassThrough implements UnzipDecoder { + static compression: number; + ondata: AsyncFlateStreamHandler; + push(chunk: Uint8Array, final: boolean): void; +} +/** + * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for + * better performance. + */ +export declare class UnzipInflate implements UnzipDecoder { + static compression: number; + private i; + ondata: AsyncFlateStreamHandler; + /** + * Creates a DEFLATE decompression that can be used in ZIP archives + */ + constructor(); + push(chunk: Uint8Array, final: boolean): void; +} +/** + * Asynchronous streaming DEFLATE decompression for ZIP archives + */ +export declare class AsyncUnzipInflate implements UnzipDecoder { + static compression: number; + private i; + ondata: AsyncFlateStreamHandler; + terminate: AsyncTerminable; + /** + * Creates a DEFLATE decompression that can be used in ZIP archives + */ + constructor(_: string, sz?: number); + push(chunk: Uint8Array, final: boolean): void; +} +/** + * A ZIP archive decompression stream that emits files as they are discovered + */ +export declare class Unzip { + private d; + private c; + private p; + private k; + private o; + /** + * Creates a ZIP decompression stream + * @param cb The callback to call whenever a file in the ZIP archive is found + */ + constructor(cb?: UnzipFileHandler); + /** + * Pushes a chunk to be unzipped + * @param chunk The chunk to push + * @param final Whether this is the last chunk + */ + push(chunk: Uint8Array, final?: boolean): void; + /** + * Registers a decoder with the stream, allowing for files compressed with + * the compression type provided to be expanded correctly + * @param decoder The decoder constructor + */ + register(decoder: UnzipDecoderConstructor): void; + /** + * The handler to call whenever a file is discovered + */ + onfile: UnzipFileHandler; +} +/** + * Asynchronously decompresses a ZIP archive + * @param data The raw compressed ZIP file + * @param opts The ZIP extraction options + * @param cb The callback to call with the decompressed files + * @returns A function that can be used to immediately terminate the unzipping + */ +export declare function unzip(data: Uint8Array, opts: AsyncUnzipOptions, cb: UnzipCallback): AsyncTerminable; +/** + * Asynchronously decompresses a ZIP archive + * @param data The raw compressed ZIP file + * @param cb The callback to call with the decompressed files + * @returns A function that can be used to immediately terminate the unzipping + */ +export declare function unzip(data: Uint8Array, cb: UnzipCallback): AsyncTerminable; +/** + * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better + * performance with more than one file. + * @param data The raw compressed ZIP file + * @param opts The ZIP extraction options + * @returns The decompressed files + */ +export declare function unzipSync(data: Uint8Array, opts?: UnzipOptions): Unzipped; diff --git a/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/lib/worker.cjs b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/lib/worker.cjs new file mode 100644 index 0000000000000000000000000000000000000000..9a283bdb82464d89f8cdc9b9c879d88b50c9acff --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/lib/worker.cjs @@ -0,0 +1,20 @@ +"use strict"; +var ch2 = {}; +exports.default = (function (c, id, msg, transfer, cb) { + var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([ + c + ';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})' + ], { type: 'text/javascript' })))); + w.onmessage = function (e) { + var d = e.data, ed = d.$e$; + if (ed) { + var err = new Error(ed[0]); + err['code'] = ed[1]; + err.stack = ed[2]; + cb(err, null); + } + else + cb(null, d); + }; + w.postMessage(msg, transfer); + return w; +}); diff --git a/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/package.json b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/package.json new file mode 100644 index 0000000000000000000000000000000000000000..c37a5362657035a5abc0fdb65dccaafde5f48764 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/package.json @@ -0,0 +1,128 @@ +{ + "name": "fflate", + "version": "0.8.3", + "description": "High performance (de)compression in an 8kB package", + "main": "./lib/index.cjs", + "module": "./esm/browser.js", + "types": "./lib/index.d.ts", + "unpkg": "./umd/index.js", + "jsdelivr": "./umd/index.js", + "browser": { + "./lib/node-worker.cjs": "./lib/worker.cjs" + }, + "exports": { + ".": { + "node": { + "import": { + "types": "./esm/index.d.mts", + "default": "./esm/index.mjs" + }, + "require": { + "types": "./lib/node.d.cts", + "default": "./lib/node.cjs" + } + }, + "import": { + "types": "./esm/browser.d.ts", + "default": "./esm/browser.js" + }, + "require": { + "types": "./lib/browser.d.cts", + "default": "./lib/browser.cjs" + } + }, + "./node": { + "import": { + "types": "./esm/index.d.mts", + "default": "./esm/index.mjs" + }, + "require": { + "types": "./lib/node.d.cts", + "default": "./lib/node.cjs" + } + }, + "./browser": { + "import": { + "types": "./esm/browser.d.ts", + "default": "./esm/browser.js" + }, + "require": { + "types": "./lib/browser.d.cts", + "default": "./lib/browser.cjs" + } + }, + "./package.json": "./package.json" + }, + "targets": { + "main": false, + "module": false, + "browser": false, + "types": false + }, + "sideEffects": false, + "homepage": "https://101arrowz.github.io/fflate", + "repository": "https://github.com/101arrowz/fflate", + "bugs": { + "email": "arjunbarrett@gmail.com", + "url": "https://github.com/101arrowz/fflate/issues" + }, + "author": "Arjun Barrett ", + "license": "MIT", + "keywords": [ + "gzip", + "gunzip", + "deflate", + "inflate", + "compression", + "decompression", + "zlib", + "pako", + "jszip", + "browser", + "node.js", + "tiny", + "fast", + "zip", + "unzip", + "non-blocking" + ], + "scripts": { + "build": "npm run build:lib && npm run build:docs && npm run build:demo", + "script": "node -r ts-node/register scripts/$SC.ts", + "build:lib": "tsc && tsc --project tsconfig.esm.json && npm run build:rewrite && npm run build:umd", + "build:umd": "SC=buildUMD npm run script", + "build:rewrite": "SC=rewriteBuilds npm run script", + "build:demo": "tsc --project tsconfig.demo.json && parcel build demo/index.html --no-cache --public-url \"./\" && SC=cpGHPages npm run script", + "build:docs": "typedoc --plugin typedoc-plugin-markdown --hideBreadcrumbs --readme none --disableSources --excludePrivate --excludeProtected --expandParameters --githubPages false --out docs/ src/index.ts", + "test": "TS_NODE_PROJECT=test/tsconfig.json uvu -b -r ts-node/register test", + "prepack": "npm run build && npm run test" + }, + "devDependencies": { + "@parcel/service-worker": "^2.9.3", + "@types/node": "^25.8.0", + "@types/pako": "*", + "@types/react": "^18.2.21", + "@types/react-dom": "^18.2.7", + "jszip": "^3.10.1", + "pako": "*", + "parcel": "^2.9.3", + "preact": "^10.17.1", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "simple-git": "^3.19.1", + "terser": "^5.47.1", + "tiny-inflate": "*", + "ts-node": "^10.9.2", + "typedoc": "^0.28.19", + "typedoc-plugin-markdown": "^4.11.0", + "typescript": "^6.0.3", + "uvu": "^0.5.6", + "uzip": "*" + }, + "alias": { + "react": "preact/compat", + "react-dom": "preact/compat", + "buffer": false, + "process": false + } +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/umd/index.js b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/umd/index.js new file mode 100644 index 0000000000000000000000000000000000000000..df762372e3ff721a72a8e9b5cf1e58f2f3ee4ea8 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/node_modules/fflate/umd/index.js @@ -0,0 +1 @@ +!function(f){typeof module!='undefined'&&typeof exports=='object'?module.exports=f():typeof define!='undefined'&&define.amd?define(f):(typeof self!='undefined'?self:this).fflate=f()}(function(){var _e={};"use strict";_e.deflate=zt,_e.deflateSync=kt,_e.inflate=At,_e.inflateSync=Tt,_e.gzip=It,_e.compress=It,_e.gzipSync=Ut,_e.compressSync=Ut,_e.gunzip=Zt,_e.gunzipSync=qt,_e.zlib=Lt,_e.zlibSync=Bt,_e.unzlib=Nt,_e.unzlibSync=Pt,_e.gzip=It,_e.compress=It,_e.decompress=Jt,_e.decompressSync=Kt,_e.strToU8=nn,_e.strFromU8=rn,_e.zip=dn,_e.zipSync=gn,_e.unzip=zn,_e.unzipSync=kn;var t=(typeof module!='undefined'&&typeof exports=='object'?function(_f){"use strict";var e,r,t,n=";var __w=require('worker_threads');__w.parentPort.on('message',function(m){onmessage({data:m})}),postMessage=function(m,t){__w.parentPort.postMessage(m,t)},close=process.exit;self=global";try{e=require("worker_threads"),r=e.Worker,t=e.isMarkedAsUntransferable}catch(e){}exports.default=r?function(e,o,a,s,u){var i=!1,l=new r(e+n,{eval:!0}).on("error",function(e){return u(e,null)}).on("message",function(e){return u(null,e)}).on("exit",function(e){e&&!i&&u(Error("exited with code "+e),null)});return t&&(s=s.filter(function(e){return!t(e)})),l.postMessage(a,s),l.terminate=function(){return i=!0,r.prototype.terminate.call(l)},l}:function(e,r,t,n,o){setImmediate(function(){return o(Error("async operations unsupported - update to Node 12+ (or Node 10-11 with the --experimental-worker CLI flag)"),null)});var a=function(){};return{terminate:a,postMessage:a}};return _f}:function(_f){"use strict";var e={};_f.default=function(r,t,s,a,n){var o=new Worker(e[t]||(e[t]=URL.createObjectURL(new Blob([r+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return o.onmessage=function(e){var r=e.data,t=r.$e$;if(t){var s=Error(t[0]);s.code=t[1],s.stack=t[2],n(s,null)}else n(null,r)},o.postMessage(s,a),o};return _f})({}),n=Uint8Array,r=Uint16Array,i=Int32Array,e=new n([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),o=new n([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),s=new n([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=function(t,n){for(var e=new r(31),o=0;o<31;++o)e[o]=n+=1<>1|(21845&d)<<1;v[d]=((65280&(g=(61680&(g=(52428&g)>>2|(13107&g)<<2))>>4|(3855&g)<<4))>>8|(255&g)<<8)>>1}var y=function(t,n,i){for(var e=t.length,o=0,s=new r(n);o>h]=f}else for(a=new r(e),o=0;o>15-t[o]);return a},m=new n(288);for(d=0;d<144;++d)m[d]=8;for(d=144;d<256;++d)m[d]=9;for(d=256;d<280;++d)m[d]=7;for(d=280;d<288;++d)m[d]=8;var b=new n(32);for(d=0;d<32;++d)b[d]=5;var w=y(m,9,0),x=y(m,9,1),z=y(b,5,0),k=y(b,5,1),M=function(t){for(var n=t[0],r=1;rn&&(n=t[r]);return n},S=function(t,n,r){var i=n/8|0;return(t[i]|t[i+1]<<8)>>(7&n)&r},A=function(t,n){var r=n/8|0;return(t[r]|t[r+1]<<8|t[r+2]<<16)>>(7&n)},T=function(t){return(t+7)/8|0},D=function(t,r,i){return(null==r||r<0)&&(r=0),(null==i||i>t.length)&&(i=t.length),new n(t.subarray(r,i))};_e.FlateErrorCode={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14};var C=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],I=function(t,n,r){var i=Error(n||C[t]);if(i.code=t,Error.captureStackTrace&&Error.captureStackTrace(i,I),!r)throw i;return i},U=function(t,r,i,a){var u=t.length,f=a?a.length:0;if(!u||r.f&&!r.l)return i||new n(0);var c=!i,p=c||2!=r.i,v=r.i;c&&(i=new n(3*u));var d=function(t){var r=i.length;if(t>r){var e=new n(Math.max(2*r,t));e.set(i),i=e}},g=r.f||0,m=r.p||0,b=r.b||0,w=r.l,z=r.d,C=r.m,U=r.n,F=8*u;do{if(!w){g=S(t,m,1);var E=S(t,m+1,3);if(m+=3,!E){var Z=t[(Y=T(m)+4)-4]|t[Y-3]<<8,q=Y+Z;if(q>u){v&&I(0);break}p&&d(b+Z),i.set(t.subarray(Y,q),b),r.b=b+=Z,r.p=m=8*q,r.f=g;continue}if(1==E)w=x,z=k,C=9,U=5;else if(2==E){var O=S(t,m,31)+257,G=S(t,m+10,15)+4,L=O+S(t,m+5,31)+1;m+=14;for(var B=new n(L),H=new n(19),j=0;j>4)<16)B[j++]=Y;else{var K=0,Q=0;for(16==Y?(Q=3+S(t,m,3),m+=2,K=B[j-1]):17==Y?(Q=3+S(t,m,7),m+=3):18==Y&&(Q=11+S(t,m,127),m+=7);Q--;)B[j++]=K}}var R=B.subarray(0,O),W=B.subarray(O);C=M(R),U=M(W),w=y(R,C,1),z=y(W,U,1)}else I(1);if(m>F){v&&I(0);break}}p&&d(b+131072);for(var X=(1<>4;if((m+=15&K)>F){v&&I(0);break}if(K||I(2),tt<256)i[b++]=tt;else{if(256==tt){_=m,w=null;break}var nt=tt-254;tt>264&&(nt=S(t,m,(1<<(et=e[j=tt-257]))-1)+h[j],m+=et);var rt=z[A(t,m)&$],it=rt>>4;if(rt||I(3),m+=15&rt,W=l[it],it>3){var et=o[it];W+=A(t,m)&(1<F){v&&I(0);break}p&&d(b+131072);var ot=b+nt;if(b>8},E=function(t,n,r){var i=n/8|0;t[i]|=r<<=7&n,t[i+1]|=r>>8,t[i+2]|=r>>16},Z=function(t,i){for(var e=[],o=0;ov&&(v=a[o].s);var d=new r(v+1),g=q(e[l-1],d,0);if(g>i){o=0;var y=0,m=g-i,b=1<i))break;y+=b-(1<>=m;y>0;){var x=a[o].s;d[x]=0&&y;--o){var z=a[o].s;d[z]==i&&(--d[z],++y)}g=i}return{t:new n(d),l:g}},q=function(t,n,r){return-1==t.s?Math.max(q(t.l,n,r+1),q(t.r,n,r+1)):n[t.s]=r},O=function(t){for(var n=t.length;n&&!t[--n];);for(var i=new r(++n),e=0,o=t[0],s=1,a=function(t){i[e++]=t},u=1;u<=n;++u)if(t[u]==o&&u!=n)++s;else{if(!o&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(o),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(o);s=1,o=t[u]}return{c:i.subarray(0,e),n:n}},G=function(t,n){for(var r=0,i=0;i>8,t[e+2]=255^t[e],t[e+3]=255^t[e+1];for(var o=0;o4&&!j[s[P-1]];--P);var V,Y,J,K,Q=p+5<<3,R=G(u,m)+G(h,b)+f,W=G(u,g)+G(h,M)+f+14+3*P+G(q,j)+2*q[16]+3*q[17]+7*q[18];if(l>=0&&Q<=R&&Q<=W)return L(n,v,t.subarray(l,l+p));if(F(n,v,1+(W15&&(F(n,v,tt[B]>>5&127),v+=tt[B]>>12)}}else V=w,Y=m,J=z,K=b;for(B=0;B255){var rt;E(n,v,V[257+(rt=nt>>18&31)]),v+=Y[rt+257],rt>7&&(F(n,v,nt>>23&31),v+=e[rt]);var it=31&nt;E(n,v,J[it]),v+=K[it],it>3&&(E(n,v,nt>>5&8191),v+=o[it])}else E(n,v,V[nt]),v+=Y[nt]}return E(n,v,V[256]),v+Y[256]},H=new i([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),j=new n(0),N=function(t,s,a,u,h,c){var l=c.z||t.length,v=new n(u+l+5*(1+Math.ceil(l/7e3))+h),d=v.subarray(u,v.length-h),g=c.l,y=7&(c.r||0);if(s){y&&(d[0]=c.r>>3);for(var m=H[s-1],b=m>>13,w=8191&m,x=(1<7e3||q>24576)&&(V>423||!g)){y=B(t,d,0,C,I,U,E,q,G,Z-G,y),q=F=E=0,G=Z;for(var Y=0;Y<286;++Y)I[Y]=0;for(Y=0;Y<30;++Y)U[Y]=0}var J=2,K=0,Q=w,R=N-P&32767;if(V>2&&j==A(Z-R))for(var W=Math.min(b,V)-1,X=Math.min(32767,Z),$=Math.min(258,V);R<=X&&--Q&&N!=P;){if(t[Z+J]==t[Z+J-R]){for(var _=0;_<$&&t[Z+_]==t[Z+_-R];++_);if(_>J){if(J=_,K=R,_>W)break;var tt=Math.min(R,_-2),nt=0;for(Y=0;Ynt&&(nt=it,P=rt)}}}R+=(N=P)-(P=z[N])&32767}if(K){C[q++]=268435456|f[J]<<18|p[K];var et=31&f[J],ot=31&p[K];E+=e[et]+o[ot],++I[257+et],++U[ot],O=Z+J,++F}else C[q++]=t[Z],++I[t[Z]]}}for(Z=Math.max(Z,O);Z=l&&(d[y/8|0]=g,st=l),y=L(d,y+1,t.subarray(Z,st))}c.i=l}return D(v,0,u+T(y)+h)},P=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,i=9;--i;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),V=function(){var t=-1;return{p:function(n){for(var r=t,i=0;i>>8;t=r},d:function(){return~t}}},Y=function(){var t=1,n=0;return{p:function(r){for(var i=t,e=n,o=0|r.length,s=0;s!=o;){for(var a=Math.min(s+2655,o);s>16),e=(65535&e)+15*(e>>16)}t=i,n=e},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},J=function(t,r,i,e,o){if(!o&&(o={l:1},r.dictionary)){var s=r.dictionary.subarray(-32768),a=new n(s.length+t.length);a.set(s),a.set(t,s.length),t=a,o.w=s.length}return N(t,null==r.level?6:r.level,null==r.mem?o.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):20:12+r.mem,i,e,o)},K=function(t,n){var r={};for(var i in t)r[i]=t[i];for(var i in n)r[i]=n[i];return r},Q=function(t,n,r){for(var i=t(),e=""+t,o=e.slice(e.indexOf("[")+1,e.lastIndexOf("]")).replace(/\s+/g,"").split(","),s=0;s>>0},ct=function(t,n){return ft(t,n)+4294967296*ft(t,n+4)},lt=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},pt=function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&<(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;i<=r.length;++i)t[i+10]=r.charCodeAt(i)}},vt=function(t){31==t[0]&&139==t[1]&&8==t[2]||I(6,"invalid gzip data");var n=t[3],r=10;4&n&&(r+=2+(t[10]|t[11]<<8));for(var i=(n>>3&1)+(n>>4&1);i>0;i-=!t[r++]);return r+(2&n)},dt=function(t){var n=t.length;return(t[n-4]|t[n-3]<<8|t[n-2]<<16|t[n-1]<<24)>>>0},gt=function(t){return 10+(t.filename?t.filename.length+1:0)},yt=function(t,n){var r=n.level,i=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=i<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var e=Y();e.p(n.dictionary),lt(t,2,e.d())}},mt=function(t,n){return(8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31)&&I(6,"invalid zlib data"),(t[1]>>5&1)==+!n&&I(6,"invalid zlib data: "+(32&t[1]?"need":"unexpected")+" dictionary"),2+(t[1]>>3&4)};function bt(t,n){return"function"==typeof t&&(n=t,t={}),this.ondata=n,t}var wt=function(){function t(t,r){if("function"==typeof t&&(r=t,t={}),this.ondata=r,this.o=t||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new n(98304),this.o.dictionary){var i=this.o.dictionary.subarray(-32768);this.b.set(i,32768-i.length),this.s.i=32768-i.length}}return t.prototype.p=function(t,n){this.ondata(J(t,this.o,0,0,this.s),n)},t.prototype.push=function(t,r){this.ondata||I(5),this.s.l&&I(4);var i=t.length+this.s.z;if(i>this.b.length){if(i>2*this.b.length-32768){var e=new n(-32768&i);e.set(this.b.subarray(0,this.s.z)),this.b=e}var o=this.b.length-this.s.z;this.b.set(t.subarray(0,o),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(t.subarray(o),32768),this.s.z=t.length-o+32768,this.s.i=32766,this.s.w=32768}else this.b.set(t,this.s.z),this.s.z+=t.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2),r&&(this.s=this.o={},this.b=j)},t.prototype.flush=function(t){if(this.ondata||I(5),this.s.l&&I(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2,t){var r=new n(6);r[0]=this.s.r>>3;var i=L(r,this.s.r,j);this.s.r=0,this.ondata(r.subarray(0,i>>3),!1)}},t}();_e.Deflate=wt;var xt=function(){return function(t,n){ut([_,function(){return[at,wt]}],this,bt.call(this,t,n),function(t){var n=new wt(t.data);onmessage=at(n)},6,1)}}();function zt(t,n,r){return r||(r=n,n={}),"function"!=typeof r&&I(7),st(t,n,[_],function(t){return et(kt(t.data[0],t.data[1]))},0,r)}function kt(t,n){return J(t,n||{},0,0)}_e.AsyncDeflate=xt;var Mt=function(){function t(t,r){"function"==typeof t&&(r=t,t={}),this.ondata=r;var i=t&&t.dictionary&&t.dictionary.subarray(-32768);this.s={i:0,b:i?i.length:0},this.o=new n(32768),this.p=new n(0),i&&this.o.set(i)}return t.prototype.e=function(t){if(this.ondata||I(5),this.d&&I(4),this.p.length){if(t.length){var r=new n(this.p.length+t.length);r.set(this.p),r.set(t,this.p.length),this.p=r}}else this.p=t},t.prototype.c=function(t){this.s.i=+(this.d=t||!1);var n=this.s.b,r=U(this.p,this.s,this.o);this.ondata(D(r,n,this.s.b),this.d),this.o=D(r,this.s.b-32768),this.s.b=this.o.length,this.p=D(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(t,n){this.e(t),this.c(n)},t}();_e.Inflate=Mt;var St=function(){return function(t,n){ut([$,function(){return[at,Mt]}],this,bt.call(this,t,n),function(t){var n=new Mt(t.data);onmessage=at(n)},7,0)}}();function At(t,n,r){return r||(r=n,n={}),"function"!=typeof r&&I(7),st(t,n,[$],function(t){return et(Tt(t.data[0],ot(t.data[1])))},1,r)}function Tt(t,n){return U(t,{i:2},n&&n.out,n&&n.dictionary)}_e.AsyncInflate=St;var Dt=function(){function t(t,n){this.c=V(),this.l=0,this.v=1,wt.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),this.l+=t.length,wt.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=J(t,this.o,this.v&>(this.o),n&&8,this.s);this.v&&(pt(r,this.o),this.v=0),n&&(lt(r,r.length-8,this.c.d()),lt(r,r.length-4,this.l)),this.ondata(r,n)},t.prototype.flush=function(t){wt.prototype.flush.call(this,t)},t}();_e.Gzip=Dt,_e.Compress=Dt;var Ct=function(){return function(t,n){ut([_,tt,function(){return[at,wt,Dt]}],this,bt.call(this,t,n),function(t){var n=new Dt(t.data);onmessage=at(n)},8,1)}}();function It(t,n,r){return r||(r=n,n={}),"function"!=typeof r&&I(7),st(t,n,[_,tt,function(){return[Ut]}],function(t){return et(Ut(t.data[0],t.data[1]))},2,r)}function Ut(t,n){n||(n={});var r=V(),i=t.length;r.p(t);var e=J(t,n,gt(n),8),o=e.length;return pt(e,n),lt(e,o-8,r.d()),lt(e,o-4,i),e}_e.AsyncGzip=Ct,_e.AsyncCompress=Ct;var Ft=function(){function t(t,n){this.v=1,this.r=0,Mt.call(this,t,n)}return t.prototype.push=function(t,r){if(Mt.prototype.e.call(this,t),this.r+=t.length,this.v){var i=this.p.subarray(this.v-1),e=i.length>3?vt(i):4;if(e>i.length){if(!r)return}else this.v>1&&this.onmember&&this.onmember(this.r-i.length);this.p=i.subarray(e),this.v=0}Mt.prototype.c.call(this,0),this.s.f&&!this.s.l?(this.v=T(this.s.p)+9,this.s={i:0},this.o=new n(0),this.push(new n(0),r)):r&&Mt.prototype.c.call(this,r)},t}();_e.Gunzip=Ft;var Et=function(){return function(t,n){var r=this;ut([$,nt,function(){return[at,Mt,Ft]}],this,bt.call(this,t,n),function(t){var n=new Ft(t.data);n.onmember=function(t){return postMessage(t)},onmessage=at(n)},9,0,function(t){return r.onmember&&r.onmember(t)})}}();function Zt(t,n,r){return r||(r=n,n={}),"function"!=typeof r&&I(7),st(t,n,[$,nt,function(){return[qt]}],function(t){return et(qt(t.data[0],t.data[1]))},3,r)}function qt(t,r){var i=vt(t);return i+8>t.length&&I(6,"invalid gzip data"),U(t.subarray(i,-8),{i:2},r&&r.out||new n(dt(t)),r&&r.dictionary)}_e.AsyncGunzip=Et;var Ot=function(){function t(t,n){this.c=Y(),this.v=1,wt.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),wt.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=J(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(yt(r,this.o),this.v=0),n&<(r,r.length-4,this.c.d()),this.ondata(r,n)},t.prototype.flush=function(t){wt.prototype.flush.call(this,t)},t}();_e.Zlib=Ot;var Gt=function(){return function(t,n){ut([_,rt,function(){return[at,wt,Ot]}],this,bt.call(this,t,n),function(t){var n=new Ot(t.data);onmessage=at(n)},10,1)}}();function Lt(t,n,r){return r||(r=n,n={}),"function"!=typeof r&&I(7),st(t,n,[_,rt,function(){return[Bt]}],function(t){return et(Bt(t.data[0],t.data[1]))},4,r)}function Bt(t,n){n||(n={});var r=Y();r.p(t);var i=J(t,n,n.dictionary?6:2,4);return yt(i,n),lt(i,i.length-4,r.d()),i}_e.AsyncZlib=Gt;var Ht=function(){function t(t,n){Mt.call(this,t,n),this.v=t&&t.dictionary?2:1}return t.prototype.push=function(t,n){if(Mt.prototype.e.call(this,t),this.v){if(this.p.length<6&&!n)return;this.p=this.p.subarray(mt(this.p,this.v-1)),this.v=0}n&&(this.p.length<4&&I(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),Mt.prototype.c.call(this,n)},t}();_e.Unzlib=Ht;var jt=function(){return function(t,n){ut([$,it,function(){return[at,Mt,Ht]}],this,bt.call(this,t,n),function(t){var n=new Ht(t.data);onmessage=at(n)},11,0)}}();function Nt(t,n,r){return r||(r=n,n={}),"function"!=typeof r&&I(7),st(t,n,[$,it,function(){return[Pt]}],function(t){return et(Pt(t.data[0],ot(t.data[1])))},5,r)}function Pt(t,n){return U(t.subarray(mt(t,n&&n.dictionary),-4),{i:2},n&&n.out,n&&n.dictionary)}_e.AsyncUnzlib=jt;var Vt=function(){function t(t,n){this.o=bt.call(this,t,n)||{},this.G=Ft,this.I=Mt,this.Z=Ht}return t.prototype.i=function(){var t=this;this.s.ondata=function(n,r){t.ondata(n,r)}},t.prototype.push=function(t,r){if(this.ondata||I(5),this.s)this.s.push(t,r);else{if(this.p&&this.p.length){var i=new n(this.p.length+t.length);i.set(this.p),i.set(t,this.p.length)}else this.p=t;this.p.length>2&&(this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(this.o):8!=(15&this.p[0])||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(this.o):new this.Z(this.o),this.i(),this.s.push(this.p,r),this.p=null)}},t}();_e.Decompress=Vt;var Yt=function(){function t(t,n){Vt.call(this,t,n),this.queuedSize=0,this.G=Et,this.I=St,this.Z=jt}return t.prototype.i=function(){var t=this;this.s.ondata=function(n,r,i){t.ondata(n,r,i)},this.s.ondrain=function(n){t.queuedSize-=n,t.ondrain&&t.ondrain(n)}},t.prototype.push=function(t,n){this.queuedSize+=t.length,Vt.prototype.push.call(this,t,n)},t}();function Jt(t,n,r){return r||(r=n,n={}),"function"!=typeof r&&I(7),31==t[0]&&139==t[1]&&8==t[2]?Zt(t,n,r):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?At(t,n,r):Nt(t,n,r)}function Kt(t,n){return 31==t[0]&&139==t[1]&&8==t[2]?qt(t,n):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Tt(t,n):Pt(t,n)}_e.AsyncDecompress=Yt;var Qt=function(t,r,i,e){for(var o in t){var s=t[o],a=r+o,u=e;Array.isArray(s)&&(u=K(e,s[1]),s=s[0]),ArrayBuffer.isView(s)?i[a]=[s,u]:(i[a+="/"]=[new n(0),u],Qt(s,a,i,e))}},Rt="undefined"!=typeof TextEncoder&&new TextEncoder,Wt="undefined"!=typeof TextDecoder&&new TextDecoder,Xt=0;try{Wt.decode(j,{stream:!0}),Xt=1}catch(t){}var $t=function(t){for(var n="",r=0;;){var i=t[r++],e=(i>127)+(i>223)+(i>239);if(r+e>t.length)return{s:n,r:D(t,r-1)};e?3==e?(i=((15&i)<<18|(63&t[r++])<<12|(63&t[r++])<<6|63&t[r++])-65536,n+=String.fromCharCode(55296|i>>10,56320|1023&i)):n+=String.fromCharCode(1&e?(31&i)<<6|63&t[r++]:(15&i)<<12|(63&t[r++])<<6|63&t[r++]):n+=String.fromCharCode(i)}},_t=function(){function t(t){this.ondata=t,Xt?this.t=new TextDecoder:this.p=j}return t.prototype.push=function(t,r){if(this.ondata||I(5),r=!!r,this.t)return this.ondata(this.t.decode(t,{stream:!0}),r),void(r&&(this.t.decode().length&&I(8),this.t=null));this.p||I(4);var i=new n(this.p.length+t.length);i.set(this.p),i.set(t,this.p.length);var e=$t(i),o=e.s,s=e.r;r?(s.length&&I(8),this.p=null):this.p=s,this.ondata(o,r)},t}();_e.DecodeUTF8=_t;var tn=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||I(5),this.d&&I(4),this.ondata(nn(t),this.d=n||!1)},t}();function nn(t,r){if(r){for(var i=new n(t.length),e=0;e>1)),a=0,u=function(t){s[a++]=t};for(e=0;es.length){var h=new n(a+8+(o-e<<1));h.set(s),s=h}var f=t.charCodeAt(e);f<128||r?u(f):f<2048?(u(192|f>>6),u(128|63&f)):f>55295&&f<57344?(u(240|(f=65536+(1047552&f)|1023&t.charCodeAt(++e))>>18),u(128|f>>12&63),u(128|f>>6&63),u(128|63&f)):(u(224|f>>12),u(128|f>>6&63),u(128|63&f))}return D(s,0,a)}function rn(t,n){if(n){for(var r="",i=0;i65535&&I(9),n+=i+4}return n},hn=function(t,n,r,i,e,o,s,a){var u=i.length,h=r.extra,f=a&&a.length,c=un(h);lt(t,n,null!=s?33639248:67324752),n+=4,null!=s&&(t[n++]=20,t[n++]=r.os),t[n]=20,n+=2,t[n++]=r.flag<<1|(o<0&&8),t[n++]=e&&8,t[n++]=255&r.compression,t[n++]=r.compression>>8;var l=new Date(null==r.mtime?Date.now():r.mtime),p=l.getFullYear()-1980;if((p<0||p>119)&&I(10),lt(t,n,p<<25|l.getMonth()+1<<21|l.getDate()<<16|l.getHours()<<11|l.getMinutes()<<5|l.getSeconds()>>1),n+=4,-1!=o&&(lt(t,n,r.crc),lt(t,n+4,o<0?-o-2:o),lt(t,n+8,r.size)),lt(t,n+12,u),lt(t,n+14,c),n+=16,null!=s&&(lt(t,n,f),lt(t,n+6,r.attrs),lt(t,n+10,s),n+=14),t.set(i,n),n+=u,c)for(var v in h){var d=h[v],g=d.length;lt(t,n,+v),lt(t,n+2,g),t.set(d,n+4),n+=4+g}return f&&(t.set(a,n),n+=f),n},fn=function(t,n,r,i,e){lt(t,n,101010256),lt(t,n+8,r),lt(t,n+10,r),lt(t,n+12,i),lt(t,n+16,e)},cn=function(){function t(t){this.filename=t,this.c=V(),this.size=0,this.compression=0}return t.prototype.process=function(t,n){this.ondata(null,t,n)},t.prototype.push=function(t,n){this.ondata||I(5),this.c.p(t),this.size+=t.length,n&&(this.crc=this.c.d()),this.process(t,n||!1)},t}();_e.ZipPassThrough=cn;var ln=function(){function t(t,n){var r=this;n||(n={}),cn.call(this,t),this.d=new wt(n,function(t,n){r.ondata(null,t,n)}),this.compression=8,this.flag=en(n.level)}return t.prototype.process=function(t,n){try{this.d.push(t,n)}catch(t){this.ondata(t,null,n)}},t.prototype.push=function(t,n){cn.prototype.push.call(this,t,n)},t}();_e.ZipDeflate=ln;var pn=function(){function t(t,n){var r=this;n||(n={}),cn.call(this,t),this.d=new xt(n,function(t,n,i){r.ondata(t,n,i)}),this.compression=8,this.flag=en(n.level),this.terminate=this.d.terminate}return t.prototype.process=function(t,n){this.d.push(t,n)},t.prototype.push=function(t,n){cn.prototype.push.call(this,t,n)},t}();_e.AsyncZipDeflate=pn;var vn=function(){function t(t){this.ondata=t,this.u=[],this.d=1}return t.prototype.add=function(t){var r=this;if(this.ondata||I(5),2&this.d)this.ondata(I(4+8*(1&this.d),0,1),null,!1);else{var i=nn(t.filename),e=i.length,o=t.comment,s=o&&nn(o),a=e!=t.filename.length||s&&o.length!=s.length,u=e+un(t.extra)+30;e>65535&&this.ondata(I(11,0,1),null,!1);var h=new n(u);hn(h,0,t,i,a,-1);var f=[h],c=function(){for(var t=0,n=f;t65535&&M(I(11,0,1),null),k)if(g<16e4)try{M(null,kt(i,h))}catch(t){M(t,null)}else c.push(zt(i,h,M));else M(null,i)},g=0;g65535&&I(11);var y=c?kt(h,f):h,m=y.length,b=V();b.p(h),e.push(K(f,{size:h.length,crc:b.d(),c:y,f:M,m:v,u:l!=a.length||v&&p.length!=d,o:o,compression:c})),o+=30+l+g+m,s+=76+2*(l+g)+(d||0)+m}for(var w=new n(s+22),x=o,z=s-o,k=0;k0){var e=Math.min(this.c,t.length),o=t.subarray(0,e);if(this.c-=e,this.d?this.d.push(o,!this.c):this.k[0].push(o),(t=t.subarray(e)).length)return this.push(t,r)}else{var s=0,a=0,u=void 0,h=void 0;this.p.length?t.length?((h=new n(this.p.length+t.length)).set(this.p),h.set(t,this.p.length)):h=this.p:h=t;for(var f=h.length,c=this.c,l=c&&this.d,p=function(){var t=ft(h,a);if(67324752==t){s=1,u=a,v.d=null,v.c=0;var n=ht(h,a+6),r=ht(h,a+8),e=2048&n,o=8&n,l=ht(h,a+26),p=ht(h,a+28);if(f>a+30+l+p){var d=[];v.k.unshift(d),s=2;var g,y=ft(h,a+18),m=ft(h,a+22),b=rn(h.subarray(a+30,a+=30+l),!e),w=an(h,a,p,2,y,m,0),x=w[0],z=w[1];o&&(x=-1-w[3]),a+=p,v.c=x;var k={name:b,compression:r,start:function(){if(k.ondata||I(5),x){var t=i.o[r];t||k.ondata(I(14,"unknown compression type "+r,1),null,!1),(g=x<0?new t(b):new t(b,x,z)).ondata=function(t,n,r){k.ondata(t,n,r)};for(var n=0,e=d;n=0&&(k.size=x,k.originalSize=z),v.onfile(k)}return"break"}if(c){if(134695760==t)return u=a+=12+(-2==c&&8),s=3,v.c=0,"break";if(33639248==t)return u=a-=4,s=3,v.c=0,"break"}},v=this;a65558)return a(I(13,0,1),null),o;var h=ht(t,u+8);if(h){var f=h,c=ft(t,u+16),l=117853008==ft(t,u-20);if(l){var p=ft(t,u-12);(l=101075792==ft(t,p))&&(f=h=ft(t,p+32),c=ft(t,p+48))}for(var v=r&&r.filter,d=function(r){var i=sn(t,c,l),u=i[0],f=i[1],p=i[2],d=i[3],g=i[4],y=on(t,i[5]);c=g;var m=function(t,n){t?(o(),a(t,null)):(n&&(s[d]=n),--h||a(null,s))};if(!v||v({name:d,size:f,originalSize:p,compression:u}))if(u)if(8==u){var b=t.subarray(y,y+f);if(p<524288||f>.8*p)try{m(null,Tt(b,{out:new n(p)}))}catch(t){m(t,null)}else e.push(At(b,{size:p},m))}else m(I(14,"unknown compression type "+u,1),null);else m(null,D(t,y,y+f));else m(null,null)},g=0;g65558)&&I(13);var o=ht(t,e+8);if(!o)return{};var s=ft(t,e+16),a=117853008==ft(t,e-20);if(a){var u=ft(t,e-12);(a=101075792==ft(t,u))&&(o=ft(t,u+32),s=ft(t,u+48))}for(var h=r&&r.filter,f=0;f; + + /** + * A version number, incremented every time the {@link BufferAttribute.needsUpdate | needsUpdate} property is set to true. + * @remarks Expects a `Integer` + * @defaultValue `0` + */ + version: number; + + /** + * Indicates how the underlying data in the buffer maps to the values in the GLSL shader code. + * @see `constructor` above for details. + * @defaultValue `false` + */ + normalized: boolean; + + /** + * Represents the number of items this buffer attribute stores. It is internally computed by dividing the + * {@link BufferAttribute.array | array}'s length by the {@link BufferAttribute.itemSize | itemSize}. Read-only + * property. + */ + readonly count: number; + + /** + * Flag to indicate that this attribute has changed and should be re-sent to the GPU. + * Set this to true when you modify the value of the array. + * @remarks Setting this to true also increments the {@link BufferAttribute.version | version}. + * @remarks _set-only property_. + */ + set needsUpdate(value: boolean); + + /** + * Read-only flag to check if a given object is of type {@link BufferAttribute}. + * @remarks This is a _constant_ value + * @defaultValue `true` + */ + readonly isBufferAttribute: true; + + /** + * A callback function that is executed after the Renderer has transferred the attribute array data to the GPU. + */ + onUploadCallback: () => void; + + /** + * Sets the value of the {@link onUploadCallback} property. + * @see Example: {@link https://threejs.org/examples/#webgl_buffergeometry | WebGL / BufferGeometry} this is used to free memory after the buffer has been transferred to the GPU. + * @see {@link onUploadCallback} + * @param callback function that is executed after the Renderer has transferred the attribute array data to the GPU. + */ + onUpload(callback: () => void): this; + + /** + * Set {@link BufferAttribute.usage | usage} + * @remarks + * After the initial use of a buffer, its usage cannot be changed. Instead, instantiate a new one and set the desired usage before the next render. + * @see {@link https://threejs.org/docs/index.html#api/en/constants/BufferAttributeUsage | Buffer Attribute Usage Constants} for all possible values. + * @see {@link BufferAttribute.usage | usage} + * @param value Corresponds to the {@link BufferAttribute.usage | usage} parameter of + * {@link https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData | WebGLRenderingContext.bufferData}. + */ + setUsage(usage: Usage): this; + + /** + * Adds a range of data in the data array to be updated on the GPU. Adds an object describing the range to the + * {@link .updateRanges} array. + */ + addUpdateRange(start: number, count: number): void; + + /** + * Clears the {@link .updateRanges} array. + */ + clearUpdateRanges(): void; + + /** + * @returns a copy of this {@link BufferAttribute}. + */ + clone(): BufferAttribute; + + /** + * Copies another {@link BufferAttribute} to this {@link BufferAttribute}. + * @param bufferAttribute + */ + copy(source: BufferAttribute): this; + + /** + * Copy a vector from bufferAttribute[index2] to {@link BufferAttribute.array | array}[index1]. + * @param index1 + * @param bufferAttribute + * @param index2 + */ + copyAt(index1: number, attribute: BufferAttribute, index2: number): this; + + /** + * Copy the array given here (which can be a normal array or `TypedArray`) into {@link BufferAttribute.array | array}. + * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set | TypedArray.set} for notes on requirements if copying a `TypedArray`. + */ + copyArray(array: ArrayLike): this; + + /** + * Applies matrix {@link Matrix3 | m} to every Vector3 element of this {@link BufferAttribute}. + * @param m + */ + applyMatrix3(m: Matrix3): this; + + /** + * Applies matrix {@link Matrix4 | m} to every Vector3 element of this {@link BufferAttribute}. + * @param m + */ + applyMatrix4(m: Matrix4): this; + + /** + * Applies normal matrix {@link Matrix3 | m} to every Vector3 element of this {@link BufferAttribute}. + * @param m + */ + applyNormalMatrix(m: Matrix3): this; + + /** + * Applies matrix {@link Matrix4 | m} to every Vector3 element of this {@link BufferAttribute}, interpreting the elements as a direction vectors. + * @param m + */ + transformDirection(m: Matrix4): this; + + /** + * Calls {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set | TypedArray.set}( {@link value}, {@link offset} ) + * on the {@link BufferAttribute.array | array}. + * @param value {@link Array | Array} or `TypedArray` from which to copy values. + * @param offset index of the {@link BufferAttribute.array | array} at which to start copying. Expects a `Integer`. Default `0`. + * @throws `RangeError` When {@link offset} is negative or is too large. + */ + set(value: ArrayLike | ArrayBufferView, offset?: number): this; + + /** + * Returns the given component of the vector at the given index. + */ + getComponent(index: number, component: number): number; + + /** + * Sets the given component of the vector at the given index. + */ + setComponent(index: number, component: number, value: number): void; + + /** + * Returns the x component of the vector at the given index. + * @param index Expects a `Integer` + */ + getX(index: number): number; + + /** + * Sets the x component of the vector at the given index. + * @param index Expects a `Integer` + * @param x + */ + setX(index: number, x: number): this; + + /** + * Returns the y component of the vector at the given index. + * @param index Expects a `Integer` + */ + getY(index: number): number; + + /** + * Sets the y component of the vector at the given index. + * @param index Expects a `Integer` + * @param y + */ + setY(index: number, y: number): this; + + /** + * Returns the z component of the vector at the given index. + * @param index Expects a `Integer` + */ + getZ(index: number): number; + + /** + * Sets the z component of the vector at the given index. + * @param index Expects a `Integer` + * @param z + */ + setZ(index: number, z: number): this; + + /** + * Returns the w component of the vector at the given index. + * @param index Expects a `Integer` + */ + getW(index: number): number; + + /** + * Sets the w component of the vector at the given index. + * @param index Expects a `Integer` + * @param w + */ + setW(index: number, z: number): this; + + /** + * Sets the x and y components of the vector at the given index. + * @param index Expects a `Integer` + * @param x + * @param y + */ + setXY(index: number, x: number, y: number): this; + + /** + * Sets the x, y and z components of the vector at the given index. + * @param index Expects a `Integer` + * @param x + * @param y + * @param z + */ + setXYZ(index: number, x: number, y: number, z: number): this; + + /** + * Sets the x, y, z and w components of the vector at the given index. + * @param index Expects a `Integer` + * @param x + * @param y + * @param z + * @param w + */ + setXYZW(index: number, x: number, y: number, z: number, w: number): this; + + /** + * Convert this object to three.js to the `data.attributes` part of {@link https://github.com/mrdoob/three.js/wiki/JSON-Geometry-format-4 | JSON Geometry format v4}, + */ + toJSON(): BufferAttributeJSON; +} + +/** + * A {@link THREE.BufferAttribute | BufferAttribute} for {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array: Int8Array} + * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#typedarray_objects | TypedArray} + * @see {@link THREE.BufferAttribute | BufferAttribute} for details and for inherited methods and properties. + * @see {@link https://threejs.org/docs/index.html#api/en/core/bufferAttributeTypes/BufferAttributeTypes | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/core/BufferAttribute.js | Source} + */ +export class Int8BufferAttribute extends BufferAttribute { + /** + * This creates a new {@link THREE.Int8BufferAttribute | Int8BufferAttribute} object. + * @param array This can be a typed or untyped (normal) array or an integer length. An array value will be converted to `Int8Array`. + * If a length is given a new `TypedArray` will created, initialized with all elements set to zero. + * @param itemSize the number of values of the {@link array} that should be associated with a particular vertex. + * For instance, if this attribute is storing a 3-component vector (such as a _position_, _normal_, or _color_), + * then itemSize should be `3`. + * @param normalized Applies to integer data only. + * Indicates how the underlying data in the buffer maps to the values in the GLSL code. + * For instance, if {@link array} is an instance of `UInt16Array`, and {@link normalized} is true, + * the values `0` - `+65535` in the array data will be mapped to `0.0f` - `+1.0f` in the GLSL attribute. + * An `Int16Array` (signed) would map from `-32768` - `+32767` to `-1.0f` - `+1.0f`. + * If normalized is false, the values will be converted to floats unmodified, + * i.e. `32767` becomes `32767.0f`. + * Default `false`. + */ + constructor( + array: Iterable | ArrayLike | ArrayBuffer | number, + itemSize: number, + normalized?: boolean, + ); +} + +/** + * A {@link THREE.BufferAttribute | BufferAttribute} for {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array: Uint8Array} + * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#typedarray_objects | TypedArray} + * @see {@link THREE.BufferAttribute | BufferAttribute} for details and for inherited methods and properties. + * @see {@link https://threejs.org/docs/index.html#api/en/core/bufferAttributeTypes/BufferAttributeTypes | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/core/BufferAttribute.js | Source} + */ +export class Uint8BufferAttribute extends BufferAttribute { + /** + * This creates a new {@link THREE.Uint8BufferAttribute | Uint8BufferAttribute} object. + * @param array This can be a typed or untyped (normal) array or an integer length. An array value will be converted to `Uint8Array`. + * If a length is given a new `TypedArray` will created, initialized with all elements set to zero. + * @param itemSize the number of values of the {@link array} that should be associated with a particular vertex. + * For instance, if this attribute is storing a 3-component vector (such as a _position_, _normal_, or _color_), + * then itemSize should be `3`. + * @param normalized Applies to integer data only. + * Indicates how the underlying data in the buffer maps to the values in the GLSL code. + * For instance, if {@link array} is an instance of `UInt16Array`, and {@link normalized} is true, + * the values `0` - `+65535` in the array data will be mapped to `0.0f` - `+1.0f` in the GLSL attribute. + * An `Int16Array` (signed) would map from `-32768` - `+32767` to `-1.0f` - `+1.0f`. + * If normalized is false, the values will be converted to floats unmodified, + * i.e. `32767` becomes `32767.0f`. + * Default `false`. + * @see {@link THREE.BufferAttribute | BufferAttribute} + */ + constructor( + array: Iterable | ArrayLike | ArrayBuffer | number, + itemSize: number, + normalized?: boolean, + ); +} + +/** + * A {@link THREE.BufferAttribute | BufferAttribute} for {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray: Uint8ClampedArray} + * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#typedarray_objects | TypedArray} + * @see {@link THREE.BufferAttribute | BufferAttribute} for details and for inherited methods and properties. + * @see {@link https://threejs.org/docs/index.html#api/en/core/bufferAttributeTypes/BufferAttributeTypes | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/core/BufferAttribute.js | Source} + */ +export class Uint8ClampedBufferAttribute extends BufferAttribute { + /** + * This creates a new {@link THREE.Uint8ClampedBufferAttribute | Uint8ClampedBufferAttribute} object. + * @param array This can be a typed or untyped (normal) array or an integer length. An array value will be converted to `Uint8ClampedArray`. + * If a length is given a new `TypedArray` will created, initialized with all elements set to zero. + * @param itemSize the number of values of the {@link array} that should be associated with a particular vertex. + * For instance, if this attribute is storing a 3-component vector (such as a _position_, _normal_, or _color_), + * then itemSize should be `3`. + * @param normalized Applies to integer data only. + * Indicates how the underlying data in the buffer maps to the values in the GLSL code. + * For instance, if {@link array} is an instance of `UInt16Array`, and {@link normalized} is true, + * the values `0` - `+65535` in the array data will be mapped to `0.0f` - `+1.0f` in the GLSL attribute. + * An `Int16Array` (signed) would map from `-32768` - `+32767` to `-1.0f` - `+1.0f`. + * If normalized is false, the values will be converted to floats unmodified, + * i.e. `32767` becomes `32767.0f`. + * Default `false`. + * @see {@link THREE.BufferAttribute | BufferAttribute} + */ + constructor( + array: Iterable | ArrayLike | ArrayBuffer | number, + itemSize: number, + normalized?: boolean, + ); +} + +/** + * A {@link THREE.BufferAttribute | BufferAttribute} for {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array: Int16Array} + * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#typedarray_objects | TypedArray} + * @see {@link THREE.BufferAttribute | BufferAttribute} for details and for inherited methods and properties. + * @see {@link https://threejs.org/docs/index.html#api/en/core/bufferAttributeTypes/BufferAttributeTypes | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/core/BufferAttribute.js | Source} + */ +export class Int16BufferAttribute extends BufferAttribute { + /** + * This creates a new {@link THREE.Int16BufferAttribute | Int16BufferAttribute} object. + * @param array This can be a typed or untyped (normal) array or an integer length. An array value will be converted to `Int16Array`. + * If a length is given a new `TypedArray` will created, initialized with all elements set to zero. + * @param itemSize the number of values of the {@link array} that should be associated with a particular vertex. + * For instance, if this attribute is storing a 3-component vector (such as a _position_, _normal_, or _color_), + * then itemSize should be `3`. + * @param normalized Applies to integer data only. + * Indicates how the underlying data in the buffer maps to the values in the GLSL code. + * For instance, if {@link array} is an instance of `UInt16Array`, and {@link normalized} is true, + * the values `0` - `+65535` in the array data will be mapped to `0.0f` - `+1.0f` in the GLSL attribute. + * An `Int16Array` (signed) would map from `-32768` - `+32767` to `-1.0f` - `+1.0f`. + * If normalized is false, the values will be converted to floats unmodified, + * i.e. `32767` becomes `32767.0f`. + * Default `false`. + * @see {@link THREE.BufferAttribute | BufferAttribute} + */ + constructor( + array: Iterable | ArrayLike | ArrayBuffer | number, + itemSize: number, + normalized?: boolean, + ); +} + +/** + * A {@link THREE.BufferAttribute | BufferAttribute} for {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array: Uint16Array} + * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#typedarray_objects | TypedArray} + * @see {@link THREE.BufferAttribute | BufferAttribute} for details and for inherited methods and properties. + * @see {@link https://threejs.org/docs/index.html#api/en/core/bufferAttributeTypes/BufferAttributeTypes | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/core/BufferAttribute.js | Source} + */ +export class Uint16BufferAttribute extends BufferAttribute { + /** + * This creates a new {@link THREE.Uint16BufferAttribute | Uint16BufferAttribute} object. + * @param array This can be a typed or untyped (normal) array or an integer length. An array value will be converted to `Uint16Array`. + * If a length is given a new `TypedArray` will created, initialized with all elements set to zero. + * @param itemSize the number of values of the {@link array} that should be associated with a particular vertex. + * For instance, if this attribute is storing a 3-component vector (such as a _position_, _normal_, or _color_), + * then itemSize should be `3`. + * @param normalized Applies to integer data only. + * Indicates how the underlying data in the buffer maps to the values in the GLSL code. + * For instance, if {@link array} is an instance of `UInt16Array`, and {@link normalized} is true, + * the values `0` - `+65535` in the array data will be mapped to `0.0f` - `+1.0f` in the GLSL attribute. + * An `Int16Array` (signed) would map from `-32768` - `+32767` to `-1.0f` - `+1.0f`. + * If normalized is false, the values will be converted to floats unmodified, + * i.e. `32767` becomes `32767.0f`. + * Default `false`. + * @see {@link THREE.BufferAttribute | BufferAttribute} + */ + constructor( + array: Iterable | ArrayLike | ArrayBuffer | number, + itemSize: number, + normalized?: boolean, + ); +} + +/** + * A {@link THREE.BufferAttribute | BufferAttribute} for {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array: Int32Array} + * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#typedarray_objects | TypedArray} + * @see {@link THREE.BufferAttribute | BufferAttribute} for details and for inherited methods and properties. + * @see {@link https://threejs.org/docs/index.html#api/en/core/bufferAttributeTypes/BufferAttributeTypes | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/core/BufferAttribute.js | Source} + */ +export class Int32BufferAttribute extends BufferAttribute { + /** + * This creates a new {@link THREE.Int32BufferAttribute | Int32BufferAttribute} object. + * @param array This can be a typed or untyped (normal) array or an integer length. An array value will be converted to `Int32Array`. + * If a length is given a new `TypedArray` will created, initialized with all elements set to zero. + * @param itemSize the number of values of the {@link array} that should be associated with a particular vertex. + * For instance, if this attribute is storing a 3-component vector (such as a _position_, _normal_, or _color_), + * then itemSize should be `3`. + * @param normalized Applies to integer data only. + * Indicates how the underlying data in the buffer maps to the values in the GLSL code. + * For instance, if {@link array} is an instance of `UInt16Array`, and {@link normalized} is true, + * the values `0` - `+65535` in the array data will be mapped to `0.0f` - `+1.0f` in the GLSL attribute. + * An `Int16Array` (signed) would map from `-32768` - `+32767` to `-1.0f` - `+1.0f`. + * If normalized is false, the values will be converted to floats unmodified, + * i.e. `32767` becomes `32767.0f`. + * Default `false`. + * @see {@link THREE.BufferAttribute | BufferAttribute} + */ + constructor( + array: Iterable | ArrayLike | ArrayBuffer | number, + itemSize: number, + normalized?: boolean, + ); +} + +/** + * A {@link THREE.BufferAttribute | BufferAttribute} for {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array: Uint32Array} + * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#typedarray_objects | TypedArray} + * @see {@link THREE.BufferAttribute | BufferAttribute} for details and for inherited methods and properties. + * @see {@link https://threejs.org/docs/index.html#api/en/core/bufferAttributeTypes/BufferAttributeTypes | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/core/BufferAttribute.js | Source} + */ +export class Uint32BufferAttribute extends BufferAttribute { + /** + * This creates a new {@link THREE.Uint32BufferAttribute | Uint32BufferAttribute} object. + * @param array This can be a typed or untyped (normal) array or an integer length. An array value will be converted to `Uint32Array`. + * If a length is given a new `TypedArray` will created, initialized with all elements set to zero. + * @param itemSize the number of values of the {@link array} that should be associated with a particular vertex. + * For instance, if this attribute is storing a 3-component vector (such as a _position_, _normal_, or _color_), + * then itemSize should be `3`. + * @param normalized Applies to integer data only. + * Indicates how the underlying data in the buffer maps to the values in the GLSL code. + * For instance, if {@link array} is an instance of `UInt16Array`, and {@link normalized} is true, + * the values `0` - `+65535` in the array data will be mapped to `0.0f` - `+1.0f` in the GLSL attribute. + * An `Int16Array` (signed) would map from `-32768` - `+32767` to `-1.0f` - `+1.0f`. + * If normalized is false, the values will be converted to floats unmodified, + * i.e. `32767` becomes `32767.0f`. + * Default `false`. + * @see {@link THREE.BufferAttribute | BufferAttribute} + */ + constructor( + array: Iterable | ArrayLike | ArrayBuffer | number, + itemSize: number, + normalized?: boolean, + ); +} + +/** + * A {@link THREE.BufferAttribute | BufferAttribute} for {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array: Uint16Array} + * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#typedarray_objects | TypedArray} + * @see {@link THREE.BufferAttribute | BufferAttribute} for details and for inherited methods and properties. + * @see {@link https://threejs.org/docs/index.html#api/en/core/bufferAttributeTypes/BufferAttributeTypes | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/core/BufferAttribute.js | Source} + */ +export class Float16BufferAttribute extends BufferAttribute { + /** + * This creates a new {@link THREE.Float16BufferAttribute | Float16BufferAttribute} object. + * @param array This can be a typed or untyped (normal) array or an integer length. An array value will be converted to `Uint16Array`. + * If a length is given a new `TypedArray` will created, initialized with all elements set to zero. + * @param itemSize the number of values of the {@link array} that should be associated with a particular vertex. + * For instance, if this attribute is storing a 3-component vector (such as a _position_, _normal_, or _color_), + * then itemSize should be `3`. + * @param normalized Applies to integer data only. + * Indicates how the underlying data in the buffer maps to the values in the GLSL code. + * For instance, if {@link array} is an instance of `UInt16Array`, and {@link normalized} is true, + * the values `0` - `+65535` in the array data will be mapped to `0.0f` - `+1.0f` in the GLSL attribute. + * An `Int16Array` (signed) would map from `-32768` - `+32767` to `-1.0f` - `+1.0f`. + * If normalized is false, the values will be converted to floats unmodified, + * i.e. `32767` becomes `32767.0f`. + * Default `false`. + * @see {@link THREE.BufferAttribute | BufferAttribute} + */ + constructor( + array: Iterable | ArrayLike | ArrayBuffer | number, + itemSize: number, + normalized?: boolean, + ); +} + +/** + * A {@link THREE.BufferAttribute | BufferAttribute} for {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array: Float32Array} + * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#typedarray_objects | TypedArray} + * @see {@link THREE.BufferAttribute | BufferAttribute} for details and for inherited methods and properties. + * @see {@link https://threejs.org/docs/index.html#api/en/core/bufferAttributeTypes/BufferAttributeTypes | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/core/BufferAttribute.js | Source} + */ +export class Float32BufferAttribute extends BufferAttribute { + /** + * This creates a new {@link THREE.Float32BufferAttribute | Float32BufferAttribute} object. + * @param array This can be a typed or untyped (normal) array or an integer length. An array value will be converted to `Float32Array`. + * If a length is given a new `TypedArray` will created, initialized with all elements set to zero. + * @param itemSize the number of values of the {@link array} that should be associated with a particular vertex. + * For instance, if this attribute is storing a 3-component vector (such as a _position_, _normal_, or _color_), + * then itemSize should be `3`. + * @param normalized Applies to integer data only. + * Indicates how the underlying data in the buffer maps to the values in the GLSL code. + * For instance, if {@link array} is an instance of `UInt16Array`, and {@link normalized} is true, + * the values `0` - `+65535` in the array data will be mapped to `0.0f` - `+1.0f` in the GLSL attribute. + * An `Int16Array` (signed) would map from `-32768` - `+32767` to `-1.0f` - `+1.0f`. + * If normalized is false, the values will be converted to floats unmodified, + * i.e. `32767` becomes `32767.0f`. + * Default `false`. + * @see {@link THREE.BufferAttribute | BufferAttribute} + */ + constructor( + array: Iterable | ArrayLike | ArrayBuffer | number, + itemSize: number, + normalized?: boolean, + ); +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/core/BufferGeometry.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/core/BufferGeometry.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b8b5ea76c643a13738b78041bff11bb023140963 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/core/BufferGeometry.d.ts @@ -0,0 +1,440 @@ +import { Box3 } from "../math/Box3.js"; +import { Matrix4 } from "../math/Matrix4.js"; +import { Quaternion } from "../math/Quaternion.js"; +import { Sphere } from "../math/Sphere.js"; +import { Vector2 } from "../math/Vector2.js"; +import { Vector3, Vector3Tuple } from "../math/Vector3.js"; +import IndirectStorageBufferAttribute from "../renderers/common/IndirectStorageBufferAttribute.js"; +import { BufferAttribute, BufferAttributeJSON } from "./BufferAttribute.js"; +import { EventDispatcher } from "./EventDispatcher.js"; +import { GLBufferAttribute } from "./GLBufferAttribute.js"; +import { InterleavedBufferAttribute } from "./InterleavedBufferAttribute.js"; + +export type NormalBufferAttributes = Record; +export type NormalOrGLBufferAttributes = Record< + string, + BufferAttribute | InterleavedBufferAttribute | GLBufferAttribute +>; + +export interface BufferGeometryJSON { + metadata?: { version: number; type: string; generator: string }; + + uuid: string; + type: string; + + name?: string; + userData?: Record; + + data?: { + attributes: Record; + + index?: { type: string; array: number[] }; + + morphAttributes?: Record; + morphTargetsRelative?: boolean; + + groups?: GeometryGroup[]; + + boundingSphere?: { center: Vector3Tuple; radius: number }; + }; +} + +export interface GeometryGroup { + /** + * Specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. + * @remarks Expects a `Integer` + */ + start: number; + /** + * Specifies how many vertices (or indices) are included. + * @remarks Expects a `Integer` + */ + count: number; + /** + * Specifies the material array index to use. + * @remarks Expects a `Integer` + */ + materialIndex?: number | undefined; +} + +export interface BufferGeometryEventMap { + dispose: {}; +} + +/** + * A representation of mesh, line, or point geometry + * Includes vertex positions, face indices, normals, colors, UVs, and custom attributes within buffers, reducing the cost of passing all this data to the GPU. + * @remarks + * To read and edit data in BufferGeometry attributes, see {@link THREE.BufferAttribute | BufferAttribute} documentation. + * @example + * ```typescript + * const geometry = new THREE.BufferGeometry(); + * + * // create a simple square shape. We duplicate the top left and bottom right + * // vertices because each vertex needs to appear once per triangle. + * const vertices = new Float32Array( [ + * -1.0, -1.0, 1.0, // v0 + * 1.0, -1.0, 1.0, // v1 + * 1.0, 1.0, 1.0, // v2 + * + * 1.0, 1.0, 1.0, // v3 + * -1.0, 1.0, 1.0, // v4 + * -1.0, -1.0, 1.0 // v5 + * ] ); + * + * // itemSize = 3 because there are 3 values (components) per vertex + * geometry.setAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) ); + * const material = new THREE.MeshBasicMaterial( { color: 0xff0000 } ); + * const mesh = new THREE.Mesh( geometry, material ); + * ``` + * @example + * ```typescript + * const geometry = new THREE.BufferGeometry(); + * + * const vertices = new Float32Array( [ + * -1.0, -1.0, 1.0, // v0 + * 1.0, -1.0, 1.0, // v1 + * 1.0, 1.0, 1.0, // v2 + * -1.0, 1.0, 1.0, // v3 + * ] ); + * geometry.setAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) ); + * + * const indices = [ + * 0, 1, 2, + * 2, 3, 0, + * ]; + * + * geometry.setIndex( indices ); + * geometry.setAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) ); + * + * const material = new THREE.MeshBasicMaterial( { color: 0xff0000 } ); + * const mesh = new THREE.Mesh( geometry, material ); + * ``` + * @see Example: {@link https://threejs.org/examples/#webgl_buffergeometry | Mesh with non-indexed faces} + * @see Example: {@link https://threejs.org/examples/#webgl_buffergeometry_indexed | Mesh with indexed faces} + * @see Example: {@link https://threejs.org/examples/#webgl_buffergeometry_lines | Lines} + * @see Example: {@link https://threejs.org/examples/#webgl_buffergeometry_lines_indexed | Indexed Lines} + * @see Example: {@link https://threejs.org/examples/#webgl_buffergeometry_custom_attributes_particles | Particles} + * @see Example: {@link https://threejs.org/examples/#webgl_buffergeometry_rawshader | Raw Shaders} + * @see {@link https://threejs.org/docs/index.html#api/en/core/BufferGeometry | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/core/BufferGeometry.js | Source} + */ +export class BufferGeometry< + Attributes extends NormalOrGLBufferAttributes = NormalBufferAttributes, + TEventMap extends BufferGeometryEventMap = BufferGeometryEventMap, +> extends EventDispatcher { + /** + * This creates a new {@link THREE.BufferGeometry | BufferGeometry} object. + */ + constructor(); + + /** + * Unique number for this {@link THREE.BufferGeometry | BufferGeometry} instance. + * @remarks Expects a `Integer` + */ + id: number; + + /** + * {@link http://en.wikipedia.org/wiki/Universally_unique_identifier | UUID} of this object instance. + * @remarks This gets automatically assigned and shouldn't be edited. + */ + uuid: string; + + /** + * Optional name for this {@link THREE.BufferGeometry | BufferGeometry} instance. + * @defaultValue `''` + */ + name: string; + + /** + * A Read-only _string_ to check if `this` object type. + * @remarks Sub-classes will update this value. + * @defaultValue `BufferGeometry` + */ + readonly type: string | "BufferGeometry"; + + /** + * Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles". + * Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face. + * If this attribute is not set, the {@link THREE.WebGLRenderer | renderer} assumes that each three contiguous positions represent a single triangle. + * @defaultValue `null` + */ + index: BufferAttribute | null; + + indirect: IndirectStorageBufferAttribute | null; + + /** + * This hashmap has as id the name of the attribute to be set and as value the {@link THREE.BufferAttribute | buffer} to set it to. Rather than accessing this property directly, + * use {@link setAttribute | .setAttribute} and {@link getAttribute | .getAttribute} to access attributes of this geometry. + * @defaultValue `{}` + */ + attributes: Attributes; + + /** + * Hashmap of {@link THREE.BufferAttribute | BufferAttributes} holding details of the geometry's morph targets. + * @remarks + * Once the geometry has been rendered, the morph attribute data cannot be changed. + * You will have to call {@link dispose | .dispose}(), and create a new instance of {@link THREE.BufferGeometry | BufferGeometry}. + * @defaultValue `{}` + */ + morphAttributes: { + position?: Array | undefined; + normal?: Array | undefined; + color?: Array | undefined; + }; + + /** + * Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals. + * @defaultValue `false` + */ + morphTargetsRelative: boolean; + + /** + * Split the geometry into groups, each of which will be rendered in a separate WebGL draw call. This allows an array of materials to be used with the geometry. + * @remarks Every vertex and index must belong to exactly one group — groups must not share vertices or indices, and must not leave vertices or indices unused. + * @remarks Use {@link addGroup | .addGroup} to add groups, rather than modifying this array directly. + * @defaultValue `[]` + */ + groups: GeometryGroup[]; + + /** + * Bounding box for the {@link THREE.BufferGeometry | BufferGeometry}, which can be calculated with {@link computeBoundingBox | .computeBoundingBox()}. + * @remarks Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are `null`. + * @defaultValue `null` + */ + boundingBox: Box3 | null; + + /** + * Bounding sphere for the {@link THREE.BufferGeometry | BufferGeometry}, which can be calculated with {@link computeBoundingSphere | .computeBoundingSphere()}. + * @remarks bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are `null`. + * @defaultValue `null` + */ + boundingSphere: Sphere | null; + + /** + * Determines the part of the geometry to render. This should not be set directly, instead use {@link setDrawRange | .setDrawRange(...)}. + * @remarks For non-indexed {@link THREE.BufferGeometry | BufferGeometry}, count is the number of vertices to render. + * @remarks For indexed {@link THREE.BufferGeometry | BufferGeometry}, count is the number of indices to render. + * @defaultValue `{ start: 0, count: Infinity }` + */ + drawRange: { start: number; count: number }; + + /** + * An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned. + * @defaultValue `{}` + */ + userData: Record; + + /** + * Read-only flag to check if a given object is of type {@link BufferGeometry}. + * @remarks This is a _constant_ value + * @defaultValue `true` + */ + readonly isBufferGeometry: true; + + /** + * Return the {@link index | .index} buffer. + */ + getIndex(): BufferAttribute | null; + + /** + * Set the {@link THREE.BufferGeometry.index | .index} buffer. + * @param index + */ + setIndex(index: BufferAttribute | number[] | null): this; + + setIndirect(indirect: IndirectStorageBufferAttribute | null): this; + + getIndirect(): IndirectStorageBufferAttribute | null; + + /** + * Sets an {@link attributes | attribute} to this geometry with the specified name. + * @remarks + * Use this rather than the attributes property, because an internal hashmap of {@link attributes | .attributes} is maintained to speed up iterating over attributes. + * @param name + * @param attribute + */ + setAttribute(name: K, attribute: Attributes[K]): this; + + /** + * Returns the {@link attributes | attribute} with the specified name. + * @param name + */ + getAttribute(name: K): Attributes[K]; + + /** + * Deletes the {@link attributes | attribute} with the specified name. + * @param name + */ + deleteAttribute(name: keyof Attributes): this; + + /** + * Returns true if the {@link attributes | attribute} with the specified name exists. + * @param name + */ + hasAttribute(name: keyof Attributes): boolean; + + /** + * Adds a group to this geometry + * @see the {@link BufferGeometry.groups | groups} property for details. + * @param start + * @param count + * @param materialIndex + */ + addGroup(start: number, count: number, materialIndex?: number): void; + + /** + * Clears all groups. + */ + clearGroups(): void; + + /** + * Set the {@link drawRange | .drawRange} property + * @remarks For non-indexed BufferGeometry, count is the number of vertices to render + * @remarks For indexed BufferGeometry, count is the number of indices to render. + * @param start + * @param count is the number of vertices or indices to render. Expects a `Integer` + */ + setDrawRange(start: number, count: number): void; + + /** + * Applies the matrix transform to the geometry. + * @param matrix + */ + applyMatrix4(matrix: Matrix4): this; + + /** + * Applies the rotation represented by the quaternion to the geometry. + * @param quaternion + */ + applyQuaternion(quaternion: Quaternion): this; + + /** + * Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop. + * @remarks Use {@link THREE.Object3D.rotation | Object3D.rotation} for typical real-time mesh rotation. + * @param angle radians. Expects a `Float` + */ + rotateX(angle: number): this; + + /** + * Rotate the geometry about the Y axis. + * @remarks This is typically done as a one time operation, and not during a loop. + * @remarks Use {@link THREE.Object3D.rotation | Object3D.rotation} for typical real-time mesh rotation. + * @param angle radians. Expects a `Float` + */ + rotateY(angle: number): this; + + /** + * Rotate the geometry about the Z axis. + * @remarks This is typically done as a one time operation, and not during a loop. + * @remarks Use {@link THREE.Object3D.rotation | Object3D.rotation} for typical real-time mesh rotation. + * @param angle radians. Expects a `Float` + */ + rotateZ(angle: number): this; + + /** + * Translate the geometry. + * @remarks This is typically done as a one time operation, and not during a loop. + * @remarks Use {@link THREE.Object3D.position | Object3D.position} for typical real-time mesh rotation. + * @param x Expects a `Float` + * @param y Expects a `Float` + * @param z Expects a `Float` + */ + translate(x: number, y: number, z: number): this; + + /** + * Scale the geometry data. + * @remarks This is typically done as a one time operation, and not during a loop. + * @remarks Use {@link THREE.Object3D.scale | Object3D.scale} for typical real-time mesh scaling. + * @param x Expects a `Float` + * @param y Expects a `Float` + * @param z Expects a `Float` + */ + scale(x: number, y: number, z: number): this; + + /** + * Rotates the geometry to face a point in space. + * @remarks This is typically done as a one time operation, and not during a loop. + * @remarks Use {@link THREE.Object3D.lookAt | Object3D.lookAt} for typical real-time mesh usage. + * @param vector A world vector to look at. + */ + lookAt(vector: Vector3): this; + + /** + * Center the geometry based on the bounding box. + */ + center(): this; + + /** + * Defines a geometry by creating a `position` attribute based on the given array of points. The array can hold + * instances of {@link Vector2} or {@link Vector3}. When using two-dimensional data, the `z` coordinate for all + * vertices is set to `0`. + * + * If the method is used with an existing `position` attribute, the vertex data are overwritten with the data from + * the array. The length of the array must match the vertex count. + */ + setFromPoints(points: Vector3[] | Vector2[]): this; + + /** + * Computes the bounding box of the geometry, and updates the {@link .boundingBox} attribute. The bounding box is + * not computed by the engine; it must be computed by your app. You may need to recompute the bounding box if the + * geometry vertices are modified. + */ + computeBoundingBox(): void; + + /** + * Computes the bounding sphere of the geometry, and updates the {@link .boundingSphere} attribute. The engine + * automatically computes the bounding sphere when it is needed, e.g., for ray casting or view frustum culling. You + * may need to recompute the bounding sphere if the geometry vertices are modified. + */ + computeBoundingSphere(): void; + + /** + * Calculates and adds a tangent attribute to this geometry. + * The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined + * @remarks + * When using a tangent space normal map, prefer the MikkTSpace algorithm provided by + * {@link BufferGeometryUtils.computeMikkTSpaceTangents} instead. + */ + computeTangents(): void; + + /** + * Computes vertex normals for the given vertex data. For indexed geometries, the method sets each vertex normal to + * be the average of the face normals of the faces that share that vertex. For non-indexed geometries, vertices are + * not shared, and the method sets each vertex normal to be the same as the face normal. + */ + computeVertexNormals(): void; + + /** + * Every normal vector in a geometry will have a magnitude of 1 + * @remarks This will correct lighting on the geometry surfaces. + */ + normalizeNormals(): void; + + /** + * Return a non-index version of an indexed BufferGeometry. + */ + toNonIndexed(): BufferGeometry; + + /** + * Convert the buffer geometry to three.js {@link https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 | JSON Object/Scene format}. + */ + toJSON(): BufferGeometryJSON; + + /** + * Creates a clone of this BufferGeometry + */ + clone(): this; + + /** + * Copies another BufferGeometry to this BufferGeometry. + * @param source + */ + copy(source: BufferGeometry): this; + + /** + * Frees the GPU-related resources allocated by this instance. + * @remarks Call this method whenever this instance is no longer used in your app. + */ + dispose(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/core/Clock.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/core/Clock.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..be39e97c2ded21fdc2803e6d9934210d6436264e --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/core/Clock.d.ts @@ -0,0 +1,70 @@ +/** + * Object for keeping track of time. This uses + * [performance.now]{@link https://developer.mozilla.org/en-US/docs/Web/API/Performance/now}. + * @see [Official Documentation]{@link https://threejs.org/docs/index.html#api/en/core/Clock} + * @see [Source]{@link https://github.com/mrdoob/three.js/blob/master/src/core/Clock.js} + */ +export class Clock { + /** + * Create a new instance of {@link THREE.Clock | Clock} + * @param autoStart - Whether to automatically start the clock when {@link getDelta | .getDelta()} is called for the first time. Default `true` + */ + constructor(autoStart?: boolean); + + /** + * If set, starts the clock automatically when {@link getDelta | .getDelta()} is called for the first time. + * @defaultValue `true` + */ + autoStart: boolean; + + /** + * Holds the time at which the clock's {@link start | .start()} method was last called. + * @defaultValue `0` + */ + startTime: number; + + /** + * Holds the time at which the clock's {@link start | .start()}, {@link getElapsedTime | .getElapsedTime()} or {@link getDelta | .getDelta()} methods were last called. + * @defaultValue `0` + */ + oldTime: number; + + /** + * Keeps track of the total time that the clock has been running. + * @defaultValue `0` + */ + elapsedTime: number; + + /** + * Whether the clock is running or not. + * @defaultValue `false` + */ + running: boolean; + + /** + * Starts clock. + * @remarks + * Also sets the {@link startTime | .startTime} and {@link oldTime | .oldTime} to the current time, + * sets {@link elapsedTime | .elapsedTime} to `0` and {@link running | .running} to `true`. + */ + start(): void; + + /** + * Stops clock and sets {@link oldTime | oldTime} to the current time. + */ + stop(): void; + + /** + * Get the seconds passed since the clock started and sets {@link oldTime | .oldTime} to the current time. + * @remarks + * If {@link autoStart | .autoStart} is `true` and the clock is not running, also starts the clock. + */ + getElapsedTime(): number; + + /** + * Get the seconds passed since the time {@link oldTime | .oldTime} was set and sets {@link oldTime | .oldTime} to the current time. + * @remarks + * If {@link autoStart | .autoStart} is `true` and the clock is not running, also starts the clock. + */ + getDelta(): number; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/core/EventDispatcher.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/core/EventDispatcher.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..403dd1c2e9c27f26d9f8b93fc4e93c7678ce0197 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/core/EventDispatcher.d.ts @@ -0,0 +1,82 @@ +/** + * The minimal basic Event that can be dispatched by a {@link EventDispatcher<>}. + */ +export interface BaseEvent { + readonly type: TEventType; +} + +/** + * The minimal expected contract of a fired Event that was dispatched by a {@link EventDispatcher<>}. + */ +export interface Event { + readonly type: TEventType; + readonly target: TTarget; +} + +export type EventListener = ( + event: TEventData & Event, +) => void; + +/** + * JavaScript events for custom objects + * @example + * ```typescript + * // Adding events to a custom object + * class Car extends EventDispatcher { + * start() { + * this.dispatchEvent( { type: 'start', message: 'vroom vroom!' } ); + * } + * }; + * // Using events with the custom object + * const car = new Car(); + * car.addEventListener( 'start', ( event ) => { + * alert( event.message ); + * } ); + * car.start(); + * ``` + * @see {@link https://github.com/mrdoob/eventdispatcher.js | mrdoob EventDispatcher on GitHub} + * @see {@link https://threejs.org/docs/index.html#api/en/core/EventDispatcher | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/core/EventDispatcher.js | Source} + */ +export class EventDispatcher { + /** + * Creates {@link THREE.EventDispatcher | EventDispatcher} object. + */ + constructor(); + + /** + * Adds a listener to an event type. + * @param type The type of event to listen to. + * @param listener The function that gets called when the event is fired. + */ + addEventListener>( + type: T, + listener: EventListener, + ): void; + + /** + * Checks if listener is added to an event type. + * @param type The type of event to listen to. + * @param listener The function that gets called when the event is fired. + */ + hasEventListener>( + type: T, + listener: EventListener, + ): boolean; + + /** + * Removes a listener from an event type. + * @param type The type of the listener that gets removed. + * @param listener The listener function that gets removed. + */ + removeEventListener>( + type: T, + listener: EventListener, + ): void; + + /** + * Fire an event type. + * @param event The event that gets fired. + */ + dispatchEvent>(event: BaseEvent & TEventMap[T]): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/core/GLBufferAttribute.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/core/GLBufferAttribute.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..840702b29f4052f9e12b41e4e57fbd520413532a --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/core/GLBufferAttribute.d.ts @@ -0,0 +1,138 @@ +/** + * This buffer attribute class does not construct a VBO. + * Instead, it uses whatever VBO is passed in constructor and can later be altered via the {@link buffer | .buffer} property. + * @remarks + * It is required to pass additional params alongside the VBO + * Those are: the GL context, the GL data type, the number of components per vertex, the number of bytes per component, and the number of vertices. + * @remarks + * The most common use case for this class is when some kind of GPGPU calculation interferes or even produces the VBOs in question. + * @see Example: {@link https://threejs.org/examples/#webgl_buffergeometry_glbufferattribute | WebGL / buffergeometry / glbufferattribute} + * @see {@link https://threejs.org/docs/index.html#api/en/core/GLBufferAttribute | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/core/GLBufferAttribute.js | Source} + */ +export class GLBufferAttribute { + /** + * This creates a new GLBufferAttribute object. + * @param buffer Must be a {@link https://developer.mozilla.org/en-US/docs/Web/API/WebGLBuffer | WebGLBuffer}. See {@link GLBufferAttribute.buffer | .buffer} + * @param type One of {@link https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants#Data_types | WebGL Data Types}. See {@link GLBufferAttribute.type | .type} + * @param itemSize How many values make up each item (vertex). See {@link GLBufferAttribute.itemSize | .itemSize} + * @param elementSize `1`, `2` or `4`. The corresponding size (in bytes) for the given {@link type} param. See {@link GLBufferAttribute.elementSize | .elementSize} + * @param count The expected number of vertices in VBO. See {@link GLBufferAttribute.count | .count} + * @param {boolean} [normalized=false] - Whether the data are normalized or not. + */ + constructor( + buffer: WebGLBuffer, + type: GLenum, + itemSize: number, + elementSize: 1 | 2 | 4, + count: number, + normalized?: boolean, + ); + + /** + * Read-only flag to check if a given object is of type {@link GLBufferAttribute}. + * @remarks This is a _constant_ value + * @defaultValue `true` + */ + readonly isGLBufferAttribute: true; + + /** + * Optional name for this attribute instance. + * @defaultValue `""` + */ + name: string; + + /** + * The current {@link https://developer.mozilla.org/en-US/docs/Web/API/WebGLBuffer | WebGLBuffer} instance. + */ + buffer: WebGLBuffer; + + /** + * A {@link https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants#Data_types | WebGL Data Type} describing the underlying VBO contents. + * + * #### WebGL Data Type (`GLenum`) + * - gl.BYTE: 0x1400 + * - gl.UNSIGNED_BYTE: 0x1401 + * - gl.SHORT: 0x1402 + * - gl.UNSIGNED_SHORT: 0x1403 + * - gl.INT: 0x1404 + * - gl.UNSIGNED_INT: 0x1405 + * - gl.FLOAT: 0x1406 + * @remarks Set this property together with {@link elementSize | .elementSize}. The recommended way is using the {@link setType | .setType()} method. + * @remarks Expects a `DataType` `GLenum` _possible values:_ `0x1400` `0x1401` `0x1402` `0x1403` `0x1404` `0x1405` `0x1406` + */ + type: GLenum; + + /** + * How many values make up each item (vertex). + * @remarks The number of values of the array that should be associated with a particular vertex. + * For instance, if this attribute is storing a 3-component vector (such as a position, normal, or color), then itemSize should be 3. + * @remarks Expects a `Integer` + */ + itemSize: number; + + /** + * Stores the corresponding size in bytes for the current {@link type | .type} property value. + * + * The corresponding size (_in bytes_) for the given "type" param. + * #### WebGL Data Type (`GLenum`) + * - gl.BYTE: 1 + * - gl.UNSIGNED_BYTE: 1 + * - gl.SHORT: 2 + * - gl.UNSIGNED_SHORT: 2 + * - gl.INT: 4 + * - gl.UNSIGNED_INT: 4 + * - gl.FLOAT: 4 + * @remarks Set this property together with {@link type | .type}. The recommended way is using the {@link setType | .setType} method. + * @see `constructor`` for a list of known type sizes. + * @remarks Expects a `1`, `2` or `4` + */ + elementSize: 1 | 2 | 4; + + /** + * The expected number of vertices in VBO. + * @remarks Expects a `Integer` + */ + count: number; + + /** + * Applies to integer data only. Indicates how the underlying data in the buffer maps to + * the values in the GLSL code. For instance, if `buffer` contains data of `gl.UNSIGNED_SHORT`, + * and `normalized` is `true`, the values `0 - +65535` in the buffer data will be mapped to + * `0.0f - +1.0f` in the GLSL attribute. If `normalized` is `false`, the values will be converted + * to floats unmodified, i.e. `65535` becomes `65535.0f`. + */ + normalized: boolean; + + /** + * A version number, incremented every time the needsUpdate property is set to true. + * @remarks Expects a `Integer` + */ + version: number; + + /** + * Setting this to true increments {@link version | .version}. + * @remarks _set-only property_. + */ + set needsUpdate(value: boolean); + + /** + * Sets the {@link buffer | .buffer} property. + */ + setBuffer(buffer: WebGLBuffer): this; + + /** + * Sets the both {@link GLBufferAttribute.type | type} and {@link GLBufferAttribute.elementSize | elementSize} properties. + */ + setType(type: GLenum, elementSize: 1 | 2 | 4): this; + + /** + * Sets the {@link GLBufferAttribute.itemSize | itemSize} property. + */ + setItemSize(itemSize: number): this; + + /** + * Sets the {@link GLBufferAttribute.count | count} property. + */ + setCount(count: number): this; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/core/InstancedBufferAttribute.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/core/InstancedBufferAttribute.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fde083b812d33a692171ab4084b689fcf5f957c6 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/core/InstancedBufferAttribute.d.ts @@ -0,0 +1,32 @@ +import { BufferAttribute, TypedArray } from "./BufferAttribute.js"; + +/** + * An instanced version of {@link THREE.BufferAttribute | BufferAttribute}. + * @see {@link https://threejs.org/docs/index.html#api/en/core/InstancedBufferAttribute | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/core/InstancedBufferAttribute.js | Source} + */ +export class InstancedBufferAttribute extends BufferAttribute { + /** + * Create a new instance of {@link THREE.InstancedBufferAttribute | InstancedBufferAttribute} + * @param array + * @param itemSize + * @param normalized + * @param meshPerAttribute + */ + constructor(array: TypedArray, itemSize: number, normalized?: boolean, meshPerAttribute?: number); + + /** + * Defines how often a value of this buffer attribute should be repeated. + * A value of one means that each value of the instanced attribute is used for a single instance. + * A value of two means that each value is used for two consecutive instances (and so on). + * @defaultValue `1` + */ + meshPerAttribute: number; + + /** + * Read-only flag to check if a given object is of type {@link InstancedBufferAttribute}. + * @remarks This is a _constant_ value + * @defaultValue `true` + */ + readonly isInstancedBufferAttribute: true; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/core/InstancedBufferGeometry.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/core/InstancedBufferGeometry.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..421294c4949bd609d960c5309e70c0f329ade897 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/core/InstancedBufferGeometry.d.ts @@ -0,0 +1,37 @@ +import { BufferGeometry } from "./BufferGeometry.js"; + +/** + * An instanced version of {@link THREE.BufferGeometry | BufferGeometry}. + * @see {@link https://threejs.org/docs/index.html#api/en/core/InstancedBufferGeometry | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/core/InstancedBufferGeometry.js | Source} + */ +export class InstancedBufferGeometry extends BufferGeometry { + /** + * Create a new instance of {@link InstancedBufferGeometry} + */ + constructor(); + + /** + * @defaultValue `InstancedBufferGeometry` + */ + type: string; + + /** + * Read-only flag to check if a given object is of type {@link InstancedBufferGeometry}. + * @remarks This is a _constant_ value + * @defaultValue `true` + */ + readonly isInstancedBufferGeometry: true; + + /** + * @defaultValue `Infinity` + */ + instanceCount: number; + + /** + * Copies the given {@link InstancedBufferGeometry} to this instance. + * @param source + * @override + */ + copy(source: InstancedBufferGeometry): this; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/core/InstancedInterleavedBuffer.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/core/InstancedInterleavedBuffer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3c78beae4609a6f5fb2cdaacd4f320cba3195cc8 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/core/InstancedInterleavedBuffer.d.ts @@ -0,0 +1,22 @@ +import { TypedArray } from "./BufferAttribute.js"; +import { InterleavedBuffer } from "./InterleavedBuffer.js"; + +/** + * An instanced version of {@link THREE.InterleavedBuffer | InterleavedBuffer}. + * @see {@link https://threejs.org/docs/index.html#api/en/core/InstancedInterleavedBuffer | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/core/InstancedInterleavedBuffer.js | Source} + */ +export class InstancedInterleavedBuffer extends InterleavedBuffer { + /** + * Create a new instance of {@link InstancedInterleavedBuffer} + * @param array + * @param itemSize + * @param meshPerAttribute + */ + constructor(array: TypedArray, stride: number, meshPerAttribute?: number); + + /** + * @defaultValue `1` + */ + meshPerAttribute: number; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/core/InterleavedBuffer.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/core/InterleavedBuffer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ffdd95e2de948d81b6b668d0b5617606b3edfc4e --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/core/InterleavedBuffer.d.ts @@ -0,0 +1,162 @@ +import { Usage } from "../constants.js"; +import { TypedArray } from "./BufferAttribute.js"; +import { InterleavedBufferAttribute } from "./InterleavedBufferAttribute.js"; + +/** + * **"Interleaved"** means that multiple attributes, possibly of different types, (e.g., _position, normal, uv, color_) are packed into a single array buffer. + * An introduction into interleaved arrays can be found here: {@link https://blog.tojicode.com/2011/05/interleaved-array-basics.html | Interleaved array basics} + * @see Example: {@link https://threejs.org/examples/#webgl_buffergeometry_points_interleaved | webgl / buffergeometry / points / interleaved} + * @see {@link https://threejs.org/docs/index.html#api/en/core/InterleavedBuffer | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/core/InterleavedBuffer.js | Source} + */ +export class InterleavedBuffer { + readonly isInterleavedBuffer: true; + + /** + * Create a new instance of {@link InterleavedBuffer} + * @param array A {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray | TypedArray} with a shared buffer. Stores the geometry data. + * @param stride The number of typed-array elements per vertex. Expects a `Integer` + */ + constructor(array: TypedArray, stride: number); + + /** + * A {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray | TypedArray} with a shared buffer. Stores the geometry data. + */ + array: TypedArray; + + /** + * The number of {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray | TypedArray} elements per vertex. + * @remarks Expects a `Integer` + */ + stride: number; + + /** + * Defines the intended usage pattern of the data store for optimization purposes. + * Corresponds to the {@link BufferAttribute.usage | usage} parameter of + * {@link https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData | WebGLRenderingContext.bufferData}. + * @remarks + * After the initial use of a buffer, its usage cannot be changed. Instead, instantiate a new one and set the desired usage before the next render. + * @see {@link https://threejs.org/docs/index.html#api/en/constants/BufferAttributeUsage | Buffer Attribute Usage Constants} for all possible values. + * @see {@link BufferAttribute.setUsage | setUsage} + * @defaultValue {@link THREE.StaticDrawUsage | THREE.StaticDrawUsage}. + */ + usage: Usage; + + /** + * This can be used to only update some components of stored data. Use the {@link .addUpdateRange} function to add + * ranges to this array. + */ + updateRanges: Array<{ + /** + * Position at which to start update. + */ + start: number; + /** + * The number of components to update. + */ + count: number; + }>; + + /** + * A version number, incremented every time the {@link BufferAttribute.needsUpdate | needsUpdate} property is set to true. + * @remarks Expects a `Integer` + * @defaultValue `0` + */ + version: number; + + /** + * Gives the total number of elements in the array. + * @remarks Expects a `Integer` + * @defaultValue 0 + */ + count: number; + + /** + * Flag to indicate that this attribute has changed and should be re-sent to the GPU. + * Set this to true when you modify the value of the array. + * @remarks Setting this to true also increments the {@link BufferAttribute.version | version}. + * @remarks _set-only property_. + */ + set needsUpdate(value: boolean); + + /** + * {@link http://en.wikipedia.org/wiki/Universally_unique_identifier | UUID} of this object instance. + * @remarks This gets automatically assigned and shouldn't be edited. + */ + uuid: string; + + /** + * A callback function that is executed after the Renderer has transferred the geometry data to the GPU. + */ + onUploadCallback: () => void; + + /** + * Sets the value of the {@link onUploadCallback} property. + * @see {@link onUploadCallback} + * @param callback function that is executed after the Renderer has transferred the geometry data to the GPU. + */ + onUpload(callback: () => void): this; + + /** + * Calls {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set | TypedArray.set}( {@link value}, {@link offset} ) + * on the {@link BufferAttribute.array | array}. + * @param value The source `TypedArray`. + * @param offset index of the {@link BufferAttribute.array | array} at which to start copying. Expects a `Integer`. Default `0`. + * @throws `RangeError` When {@link offset} is negative or is too large. + */ + set(value: ArrayLike, offset: number): this; + + /** + * Set {@link BufferAttribute.usage | usage} + * @remarks + * After the initial use of a buffer, its usage cannot be changed. Instead, instantiate a new one and set the desired usage before the next render. + * @see {@link https://threejs.org/docs/index.html#api/en/constants/BufferAttributeUsage | Buffer Attribute Usage Constants} for all possible values. + * @see {@link BufferAttribute.usage | usage} + * @param value Corresponds to the {@link BufferAttribute.usage | usage} parameter of + * {@link https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData | WebGLRenderingContext.bufferData}. + */ + setUsage(value: Usage): this; + + /** + * Adds a range of data in the data array to be updated on the GPU. Adds an object describing the range to the + * {@link .updateRanges} array. + */ + addUpdateRange(start: number, count: number): void; + + /** + * Clears the {@link .updateRanges} array. + */ + clearUpdateRanges(): void; + + /** + * Copies another {@link InterleavedBuffer} to this {@link InterleavedBuffer} instance. + * @param source + */ + copy(source: InterleavedBuffer): this; + + /** + * Copies data from {@link attribute}[{@link index2}] to {@link InterleavedBuffer.array | array}[{@link index1}]. + * @param index1 Expects a `Integer` + * @param attribute + * @param index2 Expects a `Integer` + */ + copyAt(index1: number, attribute: InterleavedBufferAttribute, index2: number): this; + + /** + * Creates a clone of this {@link InterleavedBuffer}. + * @param data This object holds shared array buffers required for properly cloning geometries with interleaved attributes. + */ + clone(data: {}): InterleavedBuffer; + + /** + * Serializes this {@link InterleavedBuffer}. + * Converting to {@link https://github.com/mrdoob/three.js/wiki/JSON-Geometry-format-4 | JSON Geometry format v4}, + * @param data This object holds shared array buffers required for properly serializing geometries with interleaved attributes. + */ + toJSON(data: {}): { + uuid: string; + buffer: string; + type: string; + stride: number; + }; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/core/InterleavedBufferAttribute.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/core/InterleavedBufferAttribute.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9550499388d0b30b29978303bbc137435dd3553d --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/core/InterleavedBufferAttribute.d.ts @@ -0,0 +1,201 @@ +import { Matrix3 } from "../math/Matrix3.js"; +import { Matrix4 } from "../math/Matrix4.js"; +import { BufferAttribute, TypedArray } from "./BufferAttribute.js"; +import { InterleavedBuffer } from "./InterleavedBuffer.js"; + +/** + * @see {@link https://threejs.org/docs/index.html#api/en/core/InterleavedBufferAttribute | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/core/InterleavedBufferAttribute.js | Source} + */ +export class InterleavedBufferAttribute { + /** + * Create a new instance of {@link THREE.InterleavedBufferAttribute | InterleavedBufferAttribute}. + * @param interleavedBuffer + * @param itemSize + * @param offset + * @param normalized Default `false`. + */ + constructor(interleavedBuffer: InterleavedBuffer, itemSize: number, offset: number, normalized?: boolean); + + /** + * Optional name for this attribute instance. + * @defaultValue `''` + */ + name: string; + + /** + * The {@link InterleavedBuffer | InterleavedBuffer} instance passed in the constructor. + */ + data: InterleavedBuffer; + + /** + * How many values make up each item. + * @remarks Expects a `Integer` + */ + itemSize: number; + + /** + * The offset in the underlying array buffer where an item starts. + * @remarks Expects a `Integer` + */ + offset: number; + + /** + * @defaultValue `false` + */ + normalized: boolean; + + /** + * The value of {@link data | .data}.{@link InterleavedBuffer.count | count}. + * If the buffer is storing a 3-component item (such as a _position, normal, or color_), then this will count the number of such items stored. + * @remarks _get-only property_. + * @remarks Expects a `Integer` + */ + get count(): number; + + /** + * The value of {@link InterleavedBufferAttribute.data | data}.{@link InterleavedBuffer.array | array}. + * @remarks _get-only property_. + */ + get array(): TypedArray; + + /** + * Flag to indicate that the {@link data | .data} ({@link InterleavedBuffer}) attribute has changed and should be re-sent to the GPU. + * @remarks Setting this to have the same result of setting true also increments the {@link InterleavedBuffer.needsUpdate | InterleavedBuffer.needsUpdate} of {@link data | .data}. + * @remarks Setting this to true also increments the {@link InterleavedBuffer.version | InterleavedBuffer.version}. + * @remarks _set-only property_. + */ + set needsUpdate(value: boolean); + + /** + * Read-only flag to check if a given object is of type {@link InterleavedBufferAttribute}. + * @remarks This is a _constant_ value + * @defaultValue `true` + */ + readonly isInterleavedBufferAttribute: true; + + /** + * Applies matrix {@link Matrix4 | m} to every Vector3 element of this InterleavedBufferAttribute. + * @param m + */ + applyMatrix4(m: Matrix4): this; + + /** + * Applies normal matrix {@link Matrix3 | m} to every Vector3 element of this InterleavedBufferAttribute. + * @param m + */ + applyNormalMatrix(m: Matrix3): this; + + /** + * Applies matrix {@link Matrix4 | m} to every Vector3 element of this InterleavedBufferAttribute, interpreting the elements as a direction vectors. + * @param m + */ + transformDirection(m: Matrix4): this; + + /** + * Returns the given component of the vector at the given index. + */ + getComponent(index: number, component: number): number; + + /** + * Sets the given component of the vector at the given index. + */ + setComponent(index: number, component: number, value: number): this; + + /** + * Returns the x component of the item at the given index. + * @param index Expects a `Integer` + */ + getX(index: number): number; + + /** + * Sets the x component of the item at the given index. + * @param index Expects a `Integer` + * @param x Expects a `Float` + */ + setX(index: number, x: number): this; + + /** + * Returns the y component of the item at the given index. + * @param index Expects a `Integer` + */ + getY(index: number): number; + + /** + * Sets the y component of the item at the given index. + * @param index Expects a `Integer` + * @param y Expects a `Float` + */ + setY(index: number, y: number): this; + + /** + * Returns the z component of the item at the given index. + * @param index Expects a `Integer` + */ + getZ(index: number): number; + + /** + * Sets the z component of the item at the given index. + * @param index Expects a `Integer` + * @param z Expects a `Float` + */ + setZ(index: number, z: number): this; + + /** + * Returns the w component of the item at the given index. + * @param index Expects a `Integer` + */ + getW(index: number): number; + + /** + * Sets the w component of the item at the given index. + * @param index Expects a `Integer` + * @param w Expects a `Float` + */ + setW(index: number, z: number): this; + + /** + * Sets the x and y components of the item at the given index. + * @param index Expects a `Integer` + * @param x Expects a `Float` + * @param y Expects a `Float` + */ + setXY(index: number, x: number, y: number): this; + /** + * Sets the x, y and z components of the item at the given index. + * @param index Expects a `Integer` + * @param x Expects a `Float` + * @param y Expects a `Float` + * @param z Expects a `Float` + */ + setXYZ(index: number, x: number, y: number, z: number): this; + + /** + * Sets the x, y, z and w components of the item at the given index. + * @param index Expects a `Integer` + * @param x Expects a `Float` + * @param y Expects a `Float` + * @param z Expects a `Float` + * @param w Expects a `Float` + */ + setXYZW(index: number, x: number, y: number, z: number, w: number): this; + + /** + * Creates a clone of this {@link InterleavedBufferAttribute}. + * @param data This object holds shared array buffers required for properly cloning geometries with interleaved attributes. + */ + clone(data?: {}): BufferAttribute; + + /** + * Serializes this {@link InterleavedBufferAttribute}. + * Converting to {@link https://github.com/mrdoob/three.js/wiki/JSON-Geometry-format-4 | JSON Geometry format v4}, + * @param data This object holds shared array buffers required for properly serializing geometries with interleaved attributes. + */ + toJSON(data?: {}): { + isInterleavedBufferAttribute: true; + itemSize: number; + data: string; + offset: number; + normalized: boolean; + }; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/core/Layers.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/core/Layers.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ad95f892d8a59c5eaee50808f1e1fce29eabf0a6 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/core/Layers.d.ts @@ -0,0 +1,72 @@ +/** + * A {@link THREE.Layers | Layers} object assigns an {@link THREE.Object3D | Object3D} to 1 or more of 32 layers numbered `0` to `31` - internally the + * layers are stored as a {@link https://en.wikipedia.org/wiki/Mask_(computing) | bit mask}, and + * by default all Object3Ds are a member of layer `0`. + * @remarks + * This can be used to control visibility - an object must share a layer with a {@link Camera | camera} to be visible when that camera's view is rendered. + * @remarks + * All classes that inherit from {@link THREE.Object3D | Object3D} have an {@link THREE.Object3D.layers | Object3D.layers} property which is an instance of this class. + * @see Example: {@link https://threejs.org/examples/#webgl_layers | WebGL / layers} + * @see Example: {@link https://threejs.org/examples/#webxr_vr_layers | Webxr / vr / layers} + * @see {@link https://threejs.org/docs/index.html#api/en/core/Layers | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/core/Layers.js | Source} + */ +export class Layers { + /** + * Create a new Layers object, with membership initially set to layer 0. + */ + constructor(); + + /** + * A bit mask storing which of the 32 layers this layers object is currently a member of. + * @defaultValue `1 | 0` + * @remarks Expects a `Integer` + */ + mask: number; + + /** + * Set membership to `layer`, and remove membership all other layers. + * @param layer An integer from 0 to 31. + */ + set(layer: number): void; + + /** + * Add membership of this `layer`. + * @param layer An integer from 0 to 31. + */ + enable(layer: number): void; + + /** + * Add membership to all layers. + */ + enableAll(): void; + + /** + * Toggle membership of `layer`. + * @param layer An integer from 0 to 31. + */ + toggle(layer: number): void; + + /** + * Remove membership of this `layer`. + * @param layer An integer from 0 to 31. + */ + disable(layer: number): void; + + /** + * Remove membership from all layers. + */ + disableAll(): void; + + /** + * Returns true if this and the passed `layers` object have at least one layer in common. + * @param layers A Layers object + */ + test(layers: Layers): boolean; + + /** + * Returns true if the given layer is enabled. + * @param layer An integer from 0 to 31. + */ + isEnabled(layer: number): boolean; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/core/Object3D.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/core/Object3D.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..20bba57ce67bd996d8238be88e3e5997472924e1 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/core/Object3D.d.ts @@ -0,0 +1,674 @@ +import { AnimationClip, AnimationClipJSON } from "../animation/AnimationClip.js"; +import { Camera } from "../cameras/Camera.js"; +import { ShapeJSON } from "../extras/core/Shape.js"; +import { Material, MaterialJSON } from "../materials/Material.js"; +import { Euler } from "../math/Euler.js"; +import { Matrix3 } from "../math/Matrix3.js"; +import { Matrix4, Matrix4Tuple } from "../math/Matrix4.js"; +import { Quaternion } from "../math/Quaternion.js"; +import { Vector3, Vector3Tuple } from "../math/Vector3.js"; +import { Group } from "../objects/Group.js"; +import { SkeletonJSON } from "../objects/Skeleton.js"; +import { WebGLRenderer } from "../renderers/WebGLRenderer.js"; +import { Scene } from "../scenes/Scene.js"; +import { SourceJSON } from "../textures/Source.js"; +import { TextureJSON } from "../textures/Texture.js"; +import { BufferGeometry, BufferGeometryJSON } from "./BufferGeometry.js"; +import { EventDispatcher } from "./EventDispatcher.js"; +import { Layers } from "./Layers.js"; +import { Intersection, Raycaster } from "./Raycaster.js"; + +export interface Object3DJSONObject { + uuid: string; + type: string; + + name?: string; + castShadow?: boolean; + receiveShadow?: boolean; + visible?: boolean; + frustumCulled?: boolean; + renderOrder?: number; + userData?: Record; + + layers: number; + matrix: Matrix4Tuple; + up: Vector3Tuple; + + matrixAutoUpdate?: boolean; + + material?: string | string[]; + + children?: string[]; + + animations?: string[]; +} + +export interface Object3DJSON { + metadata?: { version: number; type: string; generator: string }; + object: Object3DJSONObject; +} + +export interface JSONMeta { + geometries: Record; + materials: Record; + textures: Record; + images: Record; + shapes: Record; + skeletons: Record; + animations: Record; + nodes: Record; +} + +export interface Object3DEventMap { + /** + * Fires when the object has been added to its parent object. + */ + added: {}; + + /** + * Fires when the object has been removed from its parent object. + */ + removed: {}; + + /** + * Fires when a new child object has been added. + */ + childadded: { child: Object3D }; + + /** + * Fires when a new child object has been removed. + */ + childremoved: { child: Object3D }; +} + +/** + * This is the base class for most objects in three.js and provides a set of properties and methods for manipulating objects in 3D space. + * @remarks Note that this can be used for grouping objects via the {@link THREE.Object3D.add | .add()} method which adds the object as a child, + * however it is better to use {@link THREE.Group | Group} for this. + * @see {@link https://threejs.org/docs/index.html#api/en/core/Object3D | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/core/Object3D.js | Source} + */ +export class Object3D extends EventDispatcher { + /** + * This creates a new {@link Object3D} object. + */ + constructor(); + + /** + * Flag to check if a given object is of type {@link Object3D}. + * @remarks This is a _constant_ value + * @defaultValue `true` + */ + readonly isObject3D: true; + + /** + * Unique number for this {@link Object3D} instance. + * @remarks Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object. + * Expects a `Integer` + */ + readonly id: number; + + /** + * {@link http://en.wikipedia.org/wiki/Universally_unique_identifier | UUID} of this object instance. + * @remarks This gets automatically assigned and shouldn't be edited. + */ + uuid: string; + + /** + * Optional name of the object + * @remarks _(doesn't need to be unique)_. + * @defaultValue `""` + */ + name: string; + + /** + * A Read-only _string_ to check `this` object type. + * @remarks This can be used to find a specific type of Object3D in a scene. + * Sub-classes will update this value. + * @defaultValue `Object3D` + */ + readonly type: string; + + /** + * Object's parent in the {@link https://en.wikipedia.org/wiki/Scene_graph | scene graph}. + * @remarks An object can have at most one parent. + * @defaultValue `null` + */ + parent: Object3D | null; + + /** + * Array with object's children. + * @see {@link THREE.Object3DGroup | Group} for info on manually grouping objects. + * @defaultValue `[]` + */ + + children: Object3D[]; + + /** + * This is used by the {@link lookAt | lookAt} method, for example, to determine the orientation of the result. + * @defaultValue {@link DEFAULT_UP | Object3D.DEFAULT_UP} - that is `(0, 1, 0)`. + */ + up: Vector3; + + /** + * Object's local position. + * @defaultValue `new THREE.Vector3()` - that is `(0, 0, 0)`. + */ + readonly position: Vector3; + + /** + * Object's local rotation ({@link https://en.wikipedia.org/wiki/Euler_angles | Euler angles}), in radians. + * @defaultValue `new THREE.Euler()` - that is `(0, 0, 0, Euler.DEFAULT_ORDER)`. + */ + readonly rotation: Euler; + + /** + * Object's local rotation as a {@link THREE.Quaternion | Quaternion}. + * @defaultValue `new THREE.Quaternion()` - that is `(0, 0, 0, 1)`. + */ + readonly quaternion: Quaternion; + + /** + * The object's local scale. + * @defaultValue `new THREE.Vector3( 1, 1, 1 )` + */ + readonly scale: Vector3; + + /** + * @defaultValue `new THREE.Matrix4()` + */ + readonly modelViewMatrix: Matrix4; + + /** + * @defaultValue `new THREE.Matrix3()` + */ + readonly normalMatrix: Matrix3; + + /** + * The local transform matrix. + * @defaultValue `new THREE.Matrix4()` + */ + matrix: Matrix4; + + /** + * The global transform of the object. + * @remarks If the {@link Object3D} has no parent, then it's identical to the local transform {@link THREE.Object3D.matrix | .matrix}. + * @defaultValue `new THREE.Matrix4()` + */ + matrixWorld: Matrix4; + + /** + * When this is set, it calculates the matrix of position, (rotation or quaternion) and + * scale every frame and also recalculates the matrixWorld property. + * @defaultValue {@link DEFAULT_MATRIX_AUTO_UPDATE} - that is `(true)`. + */ + matrixAutoUpdate: boolean; + + /** + * If set, then the renderer checks every frame if the object and its children need matrix updates. + * When it isn't, then you have to maintain all matrices in the object and its children yourself. + * @defaultValue {@link DEFAULT_MATRIX_WORLD_AUTO_UPDATE} - that is `(true)`. + */ + matrixWorldAutoUpdate: boolean; + + /** + * When this is set, it calculates the matrixWorld in that frame and resets this property to false. + * @defaultValue `false` + */ + matrixWorldNeedsUpdate: boolean; + + /** + * The layer membership of the object. + * @remarks The object is only visible if it has at least one layer in common with the {@link THREE.Object3DCamera | Camera} in use. + * This property can also be used to filter out unwanted objects in ray-intersection tests when using {@link THREE.Raycaster | Raycaster}. + * @defaultValue `new THREE.Layers()` + */ + layers: Layers; + + /** + * Object gets rendered if `true`. + * @defaultValue `true` + */ + visible: boolean; + + /** + * Whether the object gets rendered into shadow map. + * @defaultValue `false` + */ + castShadow: boolean; + + /** + * Whether the material receives shadows. + * @defaultValue `false` + */ + receiveShadow: boolean; + + /** + * When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. + * If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. + * @defaultValue `true` + */ + frustumCulled: boolean; + + /** + * This value allows the default rendering order of {@link https://en.wikipedia.org/wiki/Scene_graph | scene graph} + * objects to be overridden although opaque and transparent objects remain sorted independently. + * @remarks When this property is set for an instance of {@link Group | Group}, all descendants objects will be sorted and rendered together. + * Sorting is from lowest to highest renderOrder. + * @defaultValue `0` + */ + renderOrder: number; + + /** + * Array with object's animation clips. + * @defaultValue `[]` + */ + animations: AnimationClip[]; + + /** + * An object that can be used to store custom data about the {@link Object3D}. + * @remarks It should not hold references to _functions_ as these **will not** be cloned. + * @default `{}` + */ + userData: Record; + + /** + * Custom depth material to be used when rendering to the depth map. + * @remarks Can only be used in context of meshes. + * When shadow-casting with a {@link THREE.DirectionalLight | DirectionalLight} or {@link THREE.SpotLight | SpotLight}, + * if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. + * @defaultValue `undefined` + */ + customDepthMaterial?: Material | undefined; + + /** + * Same as {@link customDepthMaterial}, but used with {@link THREE.Object3DPointLight | PointLight}. + * @defaultValue `undefined` + */ + customDistanceMaterial?: Material | undefined; + + /** + * An optional callback that is executed immediately before a 3D object is rendered to a shadow map. + * @remarks This function is called with the following parameters: renderer, scene, camera, shadowCamera, geometry, + * depthMaterial, group. + * Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which + * define their visual appearance with geometries and materials like instances of {@link Mesh}, {@link Line}, + * {@link Points} or {@link Sprite}. Instances of {@link Object3D}, {@link Group} or {@link Bone} are not renderable + * and thus this callback is not executed for such objects. + */ + onBeforeShadow( + renderer: WebGLRenderer, + scene: Scene, + camera: Camera, + shadowCamera: Camera, + geometry: BufferGeometry, + depthMaterial: Material, + group: Group, + ): void; + + /** + * An optional callback that is executed immediately after a 3D object is rendered to a shadow map. + * @remarks This function is called with the following parameters: renderer, scene, camera, shadowCamera, geometry, + * depthMaterial, group. + * Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which + * define their visual appearance with geometries and materials like instances of {@link Mesh}, {@link Line}, + * {@link Points} or {@link Sprite}. Instances of {@link Object3D}, {@link Group} or {@link Bone} are not renderable + * and thus this callback is not executed for such objects. + */ + onAfterShadow( + renderer: WebGLRenderer, + scene: Scene, + camera: Camera, + shadowCamera: Camera, + geometry: BufferGeometry, + depthMaterial: Material, + group: Group, + ): void; + + /** + * An optional callback that is executed immediately before a 3D object is rendered. + * @remarks This function is called with the following parameters: renderer, scene, camera, geometry, material, group. + * Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which + * define their visual appearance with geometries and materials like instances of {@link Mesh}, {@link Line}, + * {@link Points} or {@link Sprite}. Instances of {@link Object3D}, {@link Group} or {@link Bone} are not renderable + * and thus this callback is not executed for such objects. + */ + onBeforeRender( + renderer: WebGLRenderer, + scene: Scene, + camera: Camera, + geometry: BufferGeometry, + material: Material, + group: Group, + ): void; + + /** + * An optional callback that is executed immediately after a 3D object is rendered. + * @remarks This function is called with the following parameters: renderer, scene, camera, geometry, material, group. + * Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which + * define their visual appearance with geometries and materials like instances of {@link Mesh}, {@link Line}, + * {@link Points} or {@link Sprite}. Instances of {@link Object3D}, {@link Group} or {@link Bone} are not renderable + * and thus this callback is not executed for such objects. + */ + onAfterRender( + renderer: WebGLRenderer, + scene: Scene, + camera: Camera, + geometry: BufferGeometry, + material: Material, + group: Group, + ): void; + + /** + * The default {@link up} direction for objects, also used as the default position for {@link THREE.DirectionalLight | DirectionalLight}, + * {@link THREE.HemisphereLight | HemisphereLight} and {@link THREE.Spotlight | Spotlight} (which creates lights shining from the top down). + * @defaultValue `new THREE.Vector3( 0, 1, 0)` + */ + static DEFAULT_UP: Vector3; + + /** + * The default setting for {@link matrixAutoUpdate} for newly created Object3Ds. + * @defaultValue `true` + */ + static DEFAULT_MATRIX_AUTO_UPDATE: boolean; + + /** + * The default setting for {@link matrixWorldAutoUpdate} for newly created Object3Ds. + * @defaultValue `true` + */ + static DEFAULT_MATRIX_WORLD_AUTO_UPDATE: boolean; + + /** + * Applies the matrix transform to the object and updates the object's position, rotation and scale. + * @param matrix + */ + applyMatrix4(matrix: Matrix4): void; + + /** + * Applies the rotation represented by the quaternion to the object. + * @param quaternion + */ + applyQuaternion(quaternion: Quaternion): this; + + /** + * Calls {@link THREE.Quaternion.setFromAxisAngle | setFromAxisAngle}({@link axis}, {@link angle}) on the {@link quaternion | .quaternion}. + * @param axis A normalized vector in object space. + * @param angle Angle in radians. Expects a `Float` + */ + setRotationFromAxisAngle(axis: Vector3, angle: number): void; + + /** + * Calls {@link THREE.Quaternion.setFromEuler | setFromEuler}({@link euler}) on the {@link quaternion | .quaternion}. + * @param euler Euler angle specifying rotation amount. + */ + setRotationFromEuler(euler: Euler): void; + + /** + * Calls {@link THREE.Quaternion.setFromRotationMatrix | setFromRotationMatrix}({@link m}) on the {@link quaternion | .quaternion}. + * @remarks Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled). + * @param m Rotate the quaternion by the rotation component of the matrix. + */ + setRotationFromMatrix(m: Matrix4): void; + + /** + * Copy the given {@link THREE.Quaternion | Quaternion} into {@link quaternion | .quaternion}. + * @param q Normalized Quaternion. + */ + setRotationFromQuaternion(q: Quaternion): void; + + /** + * Rotate an object along an axis in object space. + * @remarks The axis is assumed to be normalized. + * @param axis A normalized vector in object space. + * @param angle The angle in radians. Expects a `Float` + */ + rotateOnAxis(axis: Vector3, angle: number): this; + + /** + * Rotate an object along an axis in world space. + * @remarks The axis is assumed to be normalized + * Method Assumes no rotated parent. + * @param axis A normalized vector in world space. + * @param angle The angle in radians. Expects a `Float` + */ + rotateOnWorldAxis(axis: Vector3, angle: number): this; + + /** + * Rotates the object around _x_ axis in local space. + * @param rad The angle to rotate in radians. Expects a `Float` + */ + rotateX(angle: number): this; + + /** + * Rotates the object around _y_ axis in local space. + * @param rad The angle to rotate in radians. Expects a `Float` + */ + rotateY(angle: number): this; + + /** + * Rotates the object around _z_ axis in local space. + * @param rad The angle to rotate in radians. Expects a `Float` + */ + rotateZ(angle: number): this; + + /** + * Translate an object by distance along an axis in object space + * @remarks The axis is assumed to be normalized. + * @param axis A normalized vector in object space. + * @param distance The distance to translate. Expects a `Float` + */ + translateOnAxis(axis: Vector3, distance: number): this; + + /** + * Translates object along x axis in object space by {@link distance} units. + * @param distance Expects a `Float` + */ + translateX(distance: number): this; + + /** + * Translates object along _y_ axis in object space by {@link distance} units. + * @param distance Expects a `Float` + */ + translateY(distance: number): this; + + /** + * Translates object along _z_ axis in object space by {@link distance} units. + * @param distance Expects a `Float` + */ + translateZ(distance: number): this; + + /** + * Converts the vector from this object's local space to world space. + * @param vector A vector representing a position in this object's local space. + */ + localToWorld(vector: Vector3): Vector3; + + /** + * Converts the vector from world space to this object's local space. + * @param vector A vector representing a position in world space. + */ + worldToLocal(vector: Vector3): Vector3; + + /** + * Rotates the object to face a point in world space. + * @remarks This method does not support objects having non-uniformly-scaled parent(s). + * @param vector A vector representing a position in world space to look at. + */ + lookAt(vector: Vector3): void; + /** + * Rotates the object to face a point in world space. + * @remarks This method does not support objects having non-uniformly-scaled parent(s). + * @param x Expects a `Float` + * @param y Expects a `Float` + * @param z Expects a `Float` + */ + lookAt(x: number, y: number, z: number): void; + + /** + * Adds another {@link Object3D} as child of this {@link Object3D}. + * @remarks An arbitrary number of objects may be added + * Any current parent on an {@link object} passed in here will be removed, since an {@link Object3D} can have at most one parent. + * @see {@link attach} + * @see {@link THREE.Group | Group} for info on manually grouping objects. + * @param object + */ + add(...object: Object3D[]): this; + + /** + * Removes a {@link Object3D} as child of this {@link Object3D}. + * @remarks An arbitrary number of objects may be removed. + * @see {@link THREE.Group | Group} for info on manually grouping objects. + * @param object + */ + remove(...object: Object3D[]): this; + + /** + * Removes this object from its current parent. + */ + removeFromParent(): this; + + /** + * Removes all child objects. + */ + clear(): this; + + /** + * Adds a {@link Object3D} as a child of this, while maintaining the object's world transform. + * @remarks Note: This method does not support scene graphs having non-uniformly-scaled nodes(s). + * @see {@link add} + * @param object + */ + attach(object: Object3D): this; + + /** + * Searches through an object and its children, starting with the object itself, and returns the first with a matching id. + * @remarks Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object. + * @see {@link id} + * @param id Unique number of the object instance. Expects a `Integer` + */ + getObjectById(id: number): Object3D | undefined; + + /** + * Searches through an object and its children, starting with the object itself, and returns the first with a matching name. + * @remarks Note that for most objects the name is an empty string by default + * You will have to set it manually to make use of this method. + * @param name String to match to the children's Object3D.name property. + */ + getObjectByName(name: string): Object3D | undefined; + + /** + * Searches through an object and its children, starting with the object itself, + * and returns the first with a property that matches the value given. + * + * @param name - the property name to search for. + * @param value - value of the given property. + */ + getObjectByProperty(name: string, value: any): Object3D | undefined; + + /** + * Searches through an object and its children, starting with the object itself, + * and returns the first with a property that matches the value given. + * @param name The property name to search for. + * @param value Value of the given property. + * @param optionalTarget target to set the result. Otherwise a new Array is instantiated. If set, you must clear + * this array prior to each call (i.e., array.length = 0;). + */ + getObjectsByProperty(name: string, value: any, optionalTarget?: Object3D[]): Object3D[]; + + /** + * Returns a vector representing the position of the object in world space. + * @param target The result will be copied into this Vector3. + */ + getWorldPosition(target: Vector3): Vector3; + + /** + * Returns a quaternion representing the rotation of the object in world space. + * @param target The result will be copied into this Quaternion. + */ + getWorldQuaternion(target: Quaternion): Quaternion; + + /** + * Returns a vector of the scaling factors applied to the object for each axis in world space. + * @param target The result will be copied into this Vector3. + */ + getWorldScale(target: Vector3): Vector3; + + /** + * Returns a vector representing the direction of object's positive z-axis in world space. + * @param target The result will be copied into this Vector3. + */ + getWorldDirection(target: Vector3): Vector3; + + /** + * Abstract (empty) method to get intersections between a casted ray and this object + * @remarks Subclasses such as {@link THREE.Mesh | Mesh}, {@link THREE.Line | Line}, and {@link THREE.Points | Points} implement this method in order to use raycasting. + * @see {@link THREE.Raycaster | Raycaster} + * @param raycaster + * @param intersects + * @defaultValue `() => {}` + */ + raycast(raycaster: Raycaster, intersects: Intersection[]): void; + + /** + * Executes the callback on this object and all descendants. + * @remarks Note: Modifying the scene graph inside the callback is discouraged. + * @param callback A function with as first argument an {@link Object3D} object. + */ + traverse(callback: (object: Object3D) => any): void; + + /** + * Like traverse, but the callback will only be executed for visible objects + * @remarks Descendants of invisible objects are not traversed. + * Note: Modifying the scene graph inside the callback is discouraged. + * @param callback A function with as first argument an {@link Object3D} object. + */ + traverseVisible(callback: (object: Object3D) => any): void; + + /** + * Executes the callback on all ancestors. + * @remarks Note: Modifying the scene graph inside the callback is discouraged. + * @param callback A function with as first argument an {@link Object3D} object. + */ + traverseAncestors(callback: (object: Object3D) => any): void; + + /** + * Updates local transform. + */ + updateMatrix(): void; + + /** + * Updates the global transform of the object. + * And will update the object descendants if {@link matrixWorldNeedsUpdate | .matrixWorldNeedsUpdate} is set to true or if the {@link force} parameter is set to `true`. + * @param force A boolean that can be used to bypass {@link matrixWorldAutoUpdate | .matrixWorldAutoUpdate}, to recalculate the world matrix of the object and descendants on the current frame. + * Useful if you cannot wait for the renderer to update it on the next frame, assuming {@link matrixWorldAutoUpdate | .matrixWorldAutoUpdate} set to `true`. + */ + updateMatrixWorld(force?: boolean): void; + + /** + * Updates the global transform of the object. + * @param updateParents Recursively updates global transform of ancestors. + * @param updateChildren Recursively updates global transform of descendants. + */ + updateWorldMatrix(updateParents: boolean, updateChildren: boolean): void; + + /** + * Convert the object to three.js {@link https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 | JSON Object/Scene format}. + * @param meta Object containing metadata such as materials, textures or images for the object. + */ + toJSON(meta?: JSONMeta): Object3DJSON; + + /** + * Returns a clone of `this` object and optionally all descendants. + * @param recursive If true, descendants of the object are also cloned. Default `true` + */ + clone(recursive?: boolean): this; + + /** + * Copies the given object into this object. + * @remarks Event listeners and user-defined callbacks ({@link .onAfterRender} and {@link .onBeforeRender}) are not copied. + * @param object + * @param recursive If set to `true`, descendants of the object are copied next to the existing ones. If set to + * `false`, descendants are left unchanged. Default is `true`. + */ + copy(object: Object3D, recursive?: boolean): this; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/core/Raycaster.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/core/Raycaster.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f7ddb43794036decb963751b07b4082bd0a78c38 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/core/Raycaster.d.ts @@ -0,0 +1,212 @@ +import { Camera } from "../cameras/Camera.js"; +import { Ray } from "../math/Ray.js"; +import { Vector2 } from "../math/Vector2.js"; +import { Vector3 } from "../math/Vector3.js"; +import { XRTargetRaySpace } from "../renderers/webxr/WebXRController.js"; +import { Layers } from "./Layers.js"; +import { Object3D } from "./Object3D.js"; + +export interface Face { + a: number; + b: number; + c: number; + normal: Vector3; + materialIndex: number; +} + +export interface Intersection { + /** Distance between the origin of the ray and the intersection */ + distance: number; + /** + * Some objects (f.e. {@link Points}) provide the distance of the intersection to the nearest point on the ray. For + * other objects it will be `undefined` + */ + distanceToRay?: number | undefined; + /** Point of intersection, in world coordinates */ + point: Vector3; + index?: number | undefined; + /** Intersected face */ + face?: Face | null | undefined; + /** Index of the intersected face */ + faceIndex?: number | null | undefined; + barycoord?: Vector3 | null; + /** The intersected object */ + object: TIntersected; + uv?: Vector2 | undefined; + uv1?: Vector2 | undefined; + normal?: Vector3; + /** The index number of the instance where the ray intersects the {@link THREE.InstancedMesh | InstancedMesh } */ + instanceId?: number | undefined; + pointOnLine?: Vector3; + batchId?: number; +} + +export interface RaycasterParameters { + Mesh: any; + Line: { threshold: number }; + Line2?: { threshold: number }; + LOD: any; + Points: { threshold: number }; + Sprite: any; +} + +/** + * This class is designed to assist with {@link https://en.wikipedia.org/wiki/Ray_casting | raycasting} + * @remarks + * Raycasting is used for mouse picking (working out what objects in the 3d space the mouse is over) amongst other things. + * @example + * ```typescript + * const raycaster = new THREE.Raycaster(); + * const pointer = new THREE.Vector2(); + * + * function onPointerMove(event) { + * // calculate pointer position in normalized device coordinates (-1 to +1) for both components + * pointer.x = (event.clientX / window.innerWidth) * 2 - 1; + * pointer.y = -(event.clientY / window.innerHeight) * 2 + 1; + * } + * + * function render() { + * // update the picking ray with the camera and pointer position + * raycaster.setFromCamera(pointer, camera); + * // calculate objects intersecting the picking ray + * const intersects = raycaster.intersectObjects(scene.children); + * for (let i = 0; i & lt; intersects.length; i++) { + * intersects[i].object.material.color.set(0xff0000); + * } + * renderer.render(scene, camera); + * } + * window.addEventListener('pointermove', onPointerMove); + * window.requestAnimationFrame(render); + * ``` + * @see Example: {@link https://threejs.org/examples/#webgl_interactive_cubes | Raycasting to a Mesh} + * @see Example: {@link https://threejs.org/examples/#webgl_interactive_cubes_ortho | Raycasting to a Mesh in using an OrthographicCamera} + * @see Example: {@link https://threejs.org/examples/#webgl_interactive_buffergeometry | Raycasting to a Mesh with BufferGeometry} + * @see Example: {@link https://threejs.org/examples/#webgl_instancing_raycast | Raycasting to a InstancedMesh} + * @see Example: {@link https://threejs.org/examples/#webgl_interactive_lines | Raycasting to a Line} + * @see Example: {@link https://threejs.org/examples/#webgl_interactive_raycasting_points | Raycasting to Points} + * @see Example: {@link https://threejs.org/examples/#webgl_geometry_terrain_raycast | Terrain raycasting} + * @see Example: {@link https://threejs.org/examples/#webgl_interactive_voxelpainter | Raycasting to paint voxels} + * @see Example: {@link https://threejs.org/examples/#webgl_raycaster_texture | Raycast to a Texture} + * @see {@link https://threejs.org/docs/index.html#api/en/core/Raycaster | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/core/Raycaster.js | Source} + */ +export class Raycaster { + /** + * This creates a new {@link Raycaster} object. + * @param origin The origin vector where the ray casts from. Default `new Vector3()` + * @param direction The direction vector that gives direction to the ray. Should be normalized. Default `new Vector3(0, 0, -1)` + * @param near All results returned are further away than near. Near can't be negative. Expects a `Float`. Default `0` + * @param far All results returned are closer than far. Far can't be lower than near. Expects a `Float`. Default `Infinity` + */ + constructor(origin?: Vector3, direction?: Vector3, near?: number, far?: number); + + /** + * The {@link THREE.RaycasterRay | Ray} used for the raycasting. + */ + ray: Ray; + + /** + * The near factor of the raycaster. This value indicates which objects can be discarded based on the distance. + * This value shouldn't be negative and should be smaller than the far property. + * @remarks Expects a `Float` + * @defaultValue `0` + */ + near: number; + + /** + * The far factor of the raycaster. This value indicates which objects can be discarded based on the distance. + * This value shouldn't be negative and should be larger than the near property. + * @remarks Expects a `Float` + * @defaultValue `Infinity` + */ + far: number; + + /** + * The camera to use when raycasting against view-dependent objects such as billboarded objects like {@link THREE.Sprites | Sprites}. + * This field can be set manually or is set when calling {@link setFromCamera}. + * @defaultValue `null` + */ + camera: Camera; + + /** + * Used by {@link Raycaster} to selectively ignore 3D objects when performing intersection tests. + * The following code example ensures that only 3D objects on layer `1` will be honored by the instance of Raycaster. + * ``` + * raycaster.layers.set( 1 ); + * object.layers.enable( 1 ); + * ``` + * @defaultValue `new THREE.Layers()` - See {@link THREE.Layers | Layers}. + */ + layers: Layers; + + /** + * An data object where threshold is the precision of the {@link Raycaster} when intersecting objects, in world units. + * @defaultValue `{ Mesh: {}, Line: { threshold: 1 }, LOD: {}, Points: { threshold: 1 }, Sprite: {} }` + */ + params: RaycasterParameters; + + /** + * Updates the ray with a new origin and direction + * @remarks + * Please note that this method only copies the values from the arguments. + * @param origin The origin vector where the ray casts from. + * @param direction The normalized direction vector that gives direction to the ray. + */ + set(origin: Vector3, direction: Vector3): void; + + /** + * Updates the ray with a new origin and direction. + * @param coords 2D coordinates of the mouse, in normalized device coordinates (NDC)---X and Y components should be between -1 and 1. + * @param camera camera from which the ray should originate + */ + setFromCamera(coords: Vector2, camera: Camera): void; + + /** + * Updates the ray with a new origin and direction. + * @param controller The controller to copy the position and direction from. + */ + setFromXRController(controller: XRTargetRaySpace): this; + + /** + * Checks all intersection between the ray and the object with or without the descendants + * @remarks Intersections are returned sorted by distance, closest first + * @remarks {@link Raycaster} delegates to the {@link Object3D.raycast | raycast} method of the passed object, when evaluating whether the ray intersects the object or not + * This allows {@link THREE.Mesh | meshes} to respond differently to ray casting than {@link THREE.Line | lines} and {@link THREE.Points | pointclouds}. + * **Note** that for meshes, faces must be pointed towards the origin of the {@link Raycaster.ray | ray} in order to be detected; + * intersections of the ray passing through the back of a face will not be detected + * To raycast against both faces of an object, you'll want to set the {@link Mesh.material | material}'s {@link Material.side | side} property to `THREE.DoubleSide`. + * @see {@link intersectObjects | .intersectObjects()}. + * @param object The object to check for intersection with the ray. + * @param recursive If true, it also checks all descendants. Otherwise it only checks intersection with the object. Default `true` + * @param optionalTarget Target to set the result. Otherwise a new {@link Array | Array} is instantiated. + * If set, you must clear this array prior to each call (i.e., array.length = 0;). Default `[]` + * @returns An array of intersections is returned. + */ + intersectObject( + object: Object3D, + recursive?: boolean, + optionalTarget?: Array>, + ): Array>; + + /** + * Checks all intersection between the ray and the objects with or without the descendants + * @remarks Intersections are returned sorted by distance, closest first + * @remarks Intersections are of the same form as those returned by {@link intersectObject | .intersectObject()}. + * @remarks {@link Raycaster} delegates to the {@link Object3D.raycast | raycast} method of the passed object, when evaluating whether the ray intersects the object or not + * This allows {@link THREE.Mesh | meshes} to respond differently to ray casting than {@link THREE.Line | lines} and {@link THREE.Points | pointclouds}. + * **Note** that for meshes, faces must be pointed towards the origin of the {@link Raycaster.ray | ray} in order to be detected; + * intersections of the ray passing through the back of a face will not be detected + * To raycast against both faces of an object, you'll want to set the {@link Mesh.material | material}'s {@link Material.side | side} property to `THREE.DoubleSide`. + * @see {@link intersectObject | .intersectObject()}. + * @param objects The objects to check for intersection with the ray. + * @param recursive If true, it also checks all descendants of the objects. Otherwise it only checks intersection with the objects. Default `true` + * @param optionalTarget Target to set the result. Otherwise a new {@link Array | Array} is instantiated. + * If set, you must clear this array prior to each call (i.e., array.length = 0;). Default `[]` + * @returns An array of intersections is returned. + */ + intersectObjects( + objects: Object3D[], + recursive?: boolean, + optionalTarget?: Array>, + ): Array>; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/core/RenderTarget.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/core/RenderTarget.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0c5576865780a3f7da6e179fb61c41549ec9414d --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/core/RenderTarget.d.ts @@ -0,0 +1,85 @@ +import { Vector4 } from "../math/Vector4.js"; +import { DepthTexture } from "../textures/DepthTexture.js"; +import { Texture, TextureParameters } from "../textures/Texture.js"; +import { EventDispatcher } from "./EventDispatcher.js"; + +export interface RenderTargetOptions extends TextureParameters { + depthBuffer?: boolean | undefined; // true + stencilBuffer?: boolean | undefined; // false + resolveDepthBuffer?: boolean | undefined; // true + resolveStencilBuffer?: boolean | undefined; // true + depthTexture?: DepthTexture | null | undefined; // null + /** + * Defines the count of MSAA samples. Can only be used with WebGL 2. Default is **0**. + * @default 0 + */ + samples?: number | undefined; + count?: number | undefined; + depth?: number | undefined; + multiview?: boolean | undefined; +} + +export class RenderTarget extends EventDispatcher<{ dispose: {} }> { + readonly isRenderTarget: true; + + width: number; + height: number; + depth: number; + + scissor: Vector4; + /** + * @default false + */ + scissorTest: boolean; + viewport: Vector4; + textures: TTexture[]; + + /** + * @default true + */ + depthBuffer: boolean; + + /** + * @default false + */ + stencilBuffer: boolean; + + /** + * Defines whether the depth buffer should be resolved when rendering into a multisampled render target. + * @default true + */ + resolveDepthBuffer: boolean; + + /** + * Defines whether the stencil buffer should be resolved when rendering into a multisampled render target. + * This property has no effect when {@link .resolveDepthBuffer} is set to `false`. + * @default true + */ + resolveStencilBuffer: boolean; + + /** + * Defines the count of MSAA samples. Can only be used with WebGL 2. Default is **0**. + * @default 0 + */ + samples: number; + + /** + * Whether to this target is used in multiview rendering. + * + * @default false + */ + multiview: boolean; + + constructor(width?: number, height?: number, options?: RenderTargetOptions); + + get texture(): TTexture; + set texture(value: TTexture); + + set depthTexture(current: DepthTexture | null); + get depthTexture(): DepthTexture | null; + + setSize(width: number, height: number, depth?: number): void; + clone(): this; + copy(source: RenderTarget): this; + dispose(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/core/RenderTarget3D.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/core/RenderTarget3D.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..02d246570ea07ccc7e8d225ba89d5ae3f12cf503 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/core/RenderTarget3D.d.ts @@ -0,0 +1,9 @@ +import { RenderTarget, RenderTargetOptions } from "./RenderTarget.js"; + +declare class RenderTarget3D extends RenderTarget { + readonly isRenderTarget3D: true; + + constructor(width?: number, height?: number, depth?: number, options?: RenderTargetOptions); +} + +export { RenderTarget3D }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/core/Timer.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/core/Timer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4dec67b8b55d20e238c4288ed61fe69629407015 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/core/Timer.d.ts @@ -0,0 +1,77 @@ +/** + * This class is an alternative to {@link THREE.Clock} with a different API design and behavior + * The goal is to avoid the conceptual flaws that became apparent in {@link THREE.Clock} over time. + * + * - {@link Timer} has an {@link .update()} method that updates its internal state. That makes it possible to call + * {@link .getDelta()} and {@link .getElapsed()} multiple times per simulation step without getting different values. + * - The class can make use of the Page Visibility API to avoid large time delta values when the app is inactive (e.g. + * tab switched or browser hidden). + * + * @example + * const timer = new Timer(); + * + * function animate(timestamp) { + * requestAnimationFrame(animate); + * // timestamp is optional + * timer.update(timestamp); + * const delta = timer.getDelta(); + * // do something with delta + * renderer.render(scene, camera); + * } + * + * @see https://threejs.org/examples/#webgl_morphtargets_sphere + */ +declare class Timer { + constructor(); + + /** + * Connects the timer to the given document. Calling this method is not mandatory to use the timer but enables the + * usage of the Page Visibility API to avoid large time delta values. + */ + connect(document: Document): void; + + /** + * Disconnects the timer from the DOM and also disables the usage of the Page Visibility API. + */ + disconnect(): void; + + /** + * Returns the time delta in seconds. + */ + getDelta(): number; + + /** + * Returns the elapsed time in seconds. + */ + getElapsed(): number; + + /** + * Returns the time scale. + */ + getTimescale(): number; + + /** + * Sets a time scale that scales the time delta in {@link .update()}. + */ + setTimescale(timescale: number): this; + + /** + * Resets the time computation for the current simulation step. + */ + reset(): this; + + /** + * Can be used to free all internal resources. Usually called when the timer instance isn't required anymore. + */ + dispose(): this; + + /** + * Updates the internal state of the timer. This method should be called once per simulation step and before you + * perform queries against the timer (e.g. via {@link getDelta()}). + * + * @param timestamp The current time in milliseconds. Can be obtained from the {@link https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame | requestAnimationFrame} callback argument. If not provided, the current time will be determined with {@link https://developer.mozilla.org/en-US/docs/Web/API/Performance/now | performance.now}. + */ + update(timestamp?: number): this; +} + +export { Timer }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/core/Uniform.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/core/Uniform.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..851ae2bf972bb57b0aa11d114cedc24d92899734 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/core/Uniform.d.ts @@ -0,0 +1,38 @@ +/** + * Uniforms are global GLSL variables. + * They are passed to shader programs. + * @example + * When declaring a uniform of a {@link THREE.ShaderMaterial | ShaderMaterial}, it is declared by value or by object. + * ```typescript + * uniforms: { + * time: { + * value: 1.0 + * }, + * resolution: new Uniform(new Vector2()) + * }; + * ``` + * @see Example: {@link https://threejs.org/examples/#webgl_nodes_materials_instance_uniform | WebGL2 / nodes / materials / instance / uniform} + * @see Example: {@link https://threejs.org/examples/#webgpu_instance_uniform| WebGPU / instance / uniform} + * @see {@link https://threejs.org/docs/index.html#api/en/core/Uniform | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/core/Uniform.js | Source} + */ +export class Uniform { + /** + * Create a new instance of {@link THREE.Uniform | Uniform} + * @param value An object containing the value to set up the uniform. It's type must be one of the Uniform Types described above. + */ + constructor(value: T); + + /** + * Current value of the uniform. + */ + value: T; + + /** + * Returns a clone of this uniform. + * @remarks + * If the uniform's {@link value} property is an {@link Object | Object} with a `clone()` method, this is used, + * otherwise the value is copied by assignment Array values are **shared** between cloned {@link THREE.UniformUniform | Uniform}s. + */ + clone(): Uniform; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/core/UniformsGroup.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/core/UniformsGroup.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4fb30b2c1726a1b852fb7d98f48823c97a24556e --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/core/UniformsGroup.d.ts @@ -0,0 +1,33 @@ +import { Usage } from "../constants.js"; +import { EventDispatcher } from "./EventDispatcher.js"; +import { Uniform } from "./Uniform.js"; + +/** + * @see Example: {@link https://threejs.org/examples/#webgl2_ubo | WebGL2 / UBO} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/core/UniformsGroup.js | Source} + */ +export class UniformsGroup extends EventDispatcher<{ dispose: {} }> { + constructor(); + + readonly isUniformsGroup: true; + + id: number; + + usage: Usage; + + uniforms: Array; + + add(uniform: Uniform | Uniform[]): this; + + remove(uniform: Uniform | Uniform[]): this; + + setName(name: string): this; + + setUsage(value: Usage): this; + + dispose(): this; + + copy(source: UniformsGroup): this; + + clone(): UniformsGroup; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/LineBasicMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/LineBasicMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..32ebeefc7c12c166b0ede9e776beb2a0e3dc21c1 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/LineBasicMaterial.d.ts @@ -0,0 +1,88 @@ +import { Color } from "../math/Color.js"; +import { Texture } from "../textures/Texture.js"; +import { MapColorPropertiesToColorRepresentations, Material, MaterialProperties } from "./Material.js"; + +export interface LineBasicMaterialProperties extends MaterialProperties { + /** + * Color of the material. + * + * @default (1,1,1) + */ + color: Color; + /** + * Sets the color of the lines using data from a texture. The texture map + * color is modulated by the diffuse `color`. + * + * @default null + */ + map: Texture | null; + /** + * Controls line thickness or lines. + * + * Can only be used with {@link SVGRenderer}. WebGL and WebGPU + * ignore this setting and always render line primitives with a + * width of one pixel. + * + * @default 1 + */ + linewidth: number; + /** + * Defines appearance of line ends. + * + * Can only be used with {@link SVGRenderer}. + * + * @default 'round' + */ + linecap: "butt" | "round" | "square"; + /** + * Defines appearance of line joints. + * + * Can only be used with {@link SVGRenderer}. + * + * @default 'round' + */ + linejoin: "round" | "bevel" | "miter"; + /** + * Whether the material is affected by fog or not. + * + * @default true + */ + fog: boolean; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface LineBasicMaterialParameters + extends Partial> +{} + +/** + * A material for rendering line primitives. + * + * Materials define the appearance of renderable 3D objects. + * + * ```js + * const material = new THREE.LineBasicMaterial( { color: 0xffffff } ); + * ``` + */ +export class LineBasicMaterial extends Material { + /** + * Constructs a new line basic material. + * + * @param {Object} [parameters] - An object with one or more properties + * defining the material's appearance. Any property of the material + * (including any property from inherited materials) can be passed + * in here. Color values can be passed any type of value accepted + * by {@link Color#set}. + */ + constructor(parameters?: LineBasicMaterialParameters); + /** + * This flag can be used for type testing. + * + * @default true + */ + readonly isLineBasicMaterial: boolean; + setValues(values?: LineBasicMaterialParameters): void; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface LineBasicMaterial extends LineBasicMaterialProperties {} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/LineDashedMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/LineDashedMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1548d4d0a6f84925b01b6dcf8cc5ecf8477245cb --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/LineDashedMaterial.d.ts @@ -0,0 +1,56 @@ +import { LineBasicMaterial, LineBasicMaterialProperties } from "./LineBasicMaterial.js"; +import { MapColorPropertiesToColorRepresentations } from "./Material.js"; + +export interface LineDashedMaterialProperties extends LineBasicMaterialProperties { + /** + * The scale of the dashed part of a line. + * + * @default 1 + */ + scale: number; + /** + * The size of the dash. This is both the gap with the stroke. + * + * @default 3 + */ + dashSize: number; + /** + * The size of the gap. + * + * @default 1 + */ + gapSize: number; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface LineDashedMaterialParameters + extends Partial> +{} + +/** + * A material for rendering line primitives. + * + * Materials define the appearance of renderable 3D objects. + * + * ```js + * const material = new THREE.LineDashedMaterial( { + * color: 0xffffff, + * scale: 1, + * dashSize: 3, + * gapSize: 1, + * } ); + * ``` + */ +export class LineDashedMaterial extends LineBasicMaterial { + constructor(parameters?: LineDashedMaterialParameters); + /** + * This flag can be used for type testing. + * + * @default true + */ + readonly isLineDashedMaterial: boolean; + setValues(values?: LineDashedMaterialParameters): void; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface LineDashedMaterial extends LineDashedMaterialProperties {} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/Material.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/Material.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..50aebf436364cd6113bedd4b9433fef20254f48e --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/Material.d.ts @@ -0,0 +1,641 @@ +import { Camera } from "../cameras/Camera.js"; +import { + Blending, + BlendingDstFactor, + BlendingEquation, + BlendingSrcFactor, + Combine, + DepthModes, + NormalMapTypes, + Side, + StencilFunc, + StencilOp, +} from "../constants.js"; +import { BufferGeometry } from "../core/BufferGeometry.js"; +import { EventDispatcher } from "../core/EventDispatcher.js"; +import { JSONMeta, Object3D } from "../core/Object3D.js"; +import { Color, ColorRepresentation } from "../math/Color.js"; +import { EulerTuple } from "../math/Euler.js"; +import { Plane } from "../math/Plane.js"; +import { Vector2Tuple } from "../math/Vector2.js"; +import { Group } from "../objects/Group.js"; +import { WebGLProgramParametersWithUniforms } from "../renderers/webgl/WebGLPrograms.js"; +import { WebGLRenderer } from "../renderers/WebGLRenderer.js"; +import { Scene } from "../scenes/Scene.js"; +import { SourceJSON } from "../textures/Source.js"; +import { TextureJSON } from "../textures/Texture.js"; + +export interface MaterialProperties { + /** + * The name of the material. + */ + name: string; + /** + * Defines the blending type of the material. + * + * It must be set to `CustomBlending` if custom blending properties like + * {@link Material#blendSrc}, {@link Material#blendDst} or {@link Material#blendEquation} + * should have any effect. + * + * @default NormalBlending + */ + blending: Blending; + /** + * Defines which side of faces will be rendered - front, back or both. + * + * @default FrontSide + */ + side: Side; + /** + * If set to `true`, vertex colors should be used. + * + * The engine supports RGB and RGBA vertex colors depending on whether a three (RGB) or + * four (RGBA) component color buffer attribute is used. + * + * @default false + */ + vertexColors: boolean; + /** + * Defines how transparent the material is. + * A value of `0.0` indicates fully transparent, `1.0` is fully opaque. + * + * If the {@link Material#transparent} is not set to `true`, + * the material will remain fully opaque and this value will only affect its color. + * + * @default 1 + */ + opacity: number; + /** + * Defines whether this material is transparent. This has an effect on + * rendering as transparent objects need special treatment and are rendered + * after non-transparent objects. + * + * When set to true, the extent to which the material is transparent is + * controlled by {@link Material#opacity}. + * + * @default false + */ + transparent: boolean; + /** + * Enables alpha hashed transparency, an alternative to {@link Material#transparent} or + * {@link Material#alphaTest}. The material will not be rendered if opacity is lower than + * a random threshold. Randomization introduces some grain or noise, but approximates alpha + * blending without the associated problems of sorting. Using TAA can reduce the resulting noise. + * + * @default false + */ + alphaHash: boolean; + /** + * Defines the blending source factor. + * + * @default SrcAlphaFactor + */ + blendSrc: BlendingSrcFactor; + /** + * Defines the blending destination factor. + * + * @default OneMinusSrcAlphaFactor + */ + blendDst: BlendingDstFactor; + /** + * Defines the blending equation. + * + * @default AddEquation + */ + blendEquation: BlendingEquation; + /** + * Defines the blending source alpha factor. + * + * @default null + */ + blendSrcAlpha: BlendingSrcFactor | null; + /** + * Defines the blending destination alpha factor. + * + * @default null + */ + blendDstAlpha: BlendingDstFactor | null; + /** + * Defines the blending equation of the alpha channel. + * + * @default null + */ + blendEquationAlpha: BlendingEquation | null; + /** + * Represents the RGB values of the constant blend color. + * + * This property has only an effect when using custom blending with `ConstantColor` or `OneMinusConstantColor`. + * + * @default (0,0,0) + */ + blendColor: Color; + /** + * Represents the alpha value of the constant blend color. + * + * This property has only an effect when using custom blending with `ConstantAlpha` or `OneMinusConstantAlpha`. + * + * @default 0 + */ + blendAlpha: number; + /** + * Defines the depth function. + * + * @default LessEqualDepth + */ + depthFunc: DepthModes; + /** + * Whether to have depth test enabled when rendering this material. + * When the depth test is disabled, the depth write will also be implicitly disabled. + * + * @default true + */ + depthTest: boolean; + /** + * Whether rendering this material has any effect on the depth buffer. + * + * When drawing 2D overlays it can be useful to disable the depth writing in + * order to layer several things together without creating z-index artifacts. + * + * @default true + */ + depthWrite: boolean; + /** + * The bit mask to use when writing to the stencil buffer. + * + * @default 0xff + */ + stencilWriteMask: number; + /** + * The stencil comparison function to use. + * + * @default AlwaysStencilFunc + */ + stencilFunc: StencilFunc; + /** + * The value to use when performing stencil comparisons or stencil operations. + * + * @default 0 + */ + stencilRef: number; + /** + * The bit mask to use when comparing against the stencil buffer. + * + * @default 0xff + */ + stencilFuncMask: number; + /** + * Which stencil operation to perform when the comparison function returns `false`. + * + * @default KeepStencilOp + */ + stencilFail: StencilOp; + /** + * Which stencil operation to perform when the comparison function returns + * `true` but the depth test fails. + * + * @default KeepStencilOp + */ + stencilZFail: StencilOp; + /** + * Which stencil operation to perform when the comparison function returns + * `true` and the depth test passes. + * + * @default KeepStencilOp + */ + stencilZPass: StencilOp; + /** + * Whether stencil operations are performed against the stencil buffer. In + * order to perform writes or comparisons against the stencil buffer this + * value must be `true`. + * + * @default false + */ + stencilWrite: boolean; + /** + * User-defined clipping planes specified as THREE.Plane objects in world + * space. These planes apply to the objects this material is attached to. + * Points in space whose signed distance to the plane is negative are clipped + * (not rendered). This requires {@link WebGLRenderer#localClippingEnabled} to + * be `true`. + * + * @default null + */ + clippingPlanes: Array | null; + /** + * Changes the behavior of clipping planes so that only their intersection is + * clipped, rather than their union. + * + * @default false + */ + clipIntersection: boolean; + /** + * Defines whether to clip shadows according to the clipping planes specified + * on this material. + * + * @default false + */ + clipShadows: boolean; + /** + * Defines which side of faces cast shadows. If `null`, the side casting shadows + * is determined as follows: + * + * - When {@link Material#side} is set to `FrontSide`, the back side cast shadows. + * - When {@link Material#side} is set to `BackSide`, the front side cast shadows. + * - When {@link Material#side} is set to `DoubleSide`, both sides cast shadows. + * + * @default null + */ + shadowSide: Side | null; + /** + * Whether to render the material's color. + * + * This can be used in conjunction with {@link Object3D#renderOder} to create invisible + * objects that occlude other objects. + * + * @default true + */ + colorWrite: boolean; + /** + * Override the renderer's default precision for this material. + * + * @default null + */ + precision: ("highp" | "mediump" | "lowp") | null; + /** + * Whether to use polygon offset or not. When enabled, each fragment's depth value will + * be offset after it is interpolated from the depth values of the appropriate vertices. + * The offset is added before the depth test is performed and before the value is written + * into the depth buffer. + * + * Can be useful for rendering hidden-line images, for applying decals to surfaces, and for + * rendering solids with highlighted edges. + * + * @default false + */ + polygonOffset: boolean; + /** + * Specifies a scale factor that is used to create a variable depth offset for each polygon. + * + * @default 0 + */ + polygonOffsetFactor: number; + /** + * Is multiplied by an implementation-specific value to create a constant depth offset. + * + * @default 0 + */ + polygonOffsetUnits: number; + /** + * Whether to apply dithering to the color to remove the appearance of banding. + * + * @default false + */ + dithering: boolean; + /** + * Whether alpha to coverage should be enabled or not. Can only be used with MSAA-enabled contexts + * (meaning when the renderer was created with *antialias* parameter set to `true`). Enabling this + * will smooth aliasing on clip plane edges and alphaTest-clipped edges. + * + * @default false + */ + alphaToCoverage: boolean; + /** + * Whether to premultiply the alpha (transparency) value. + * + * @default false + */ + premultipliedAlpha: boolean; + /** + * Whether double-sided, transparent objects should be rendered with a single pass or not. + * + * The engine renders double-sided, transparent objects with two draw calls (back faces first, + * then front faces) to mitigate transparency artifacts. There are scenarios however where this + * approach produces no quality gains but still doubles draw calls e.g. when rendering flat + * vegetation like grass sprites. In these cases, set the `forceSinglePass` flag to `true` to + * disable the two pass rendering to avoid performance issues. + * + * @default false + */ + forceSinglePass: boolean; + /** + * Whether it's possible to override the material with {@link Scene#overrideMaterial} or not. + * + * @default true + */ + allowOverride: boolean; + /** + * Defines whether 3D objects using this material are visible. + * + * @default true + */ + visible: boolean; + /** + * Defines whether this material is tone mapped according to the renderer's tone mapping setting. + * + * It is ignored when rendering to a render target or using post processing or when using + * `WebGPURenderer`. In all these cases, all materials are honored by tone mapping. + * + * @default true + */ + toneMapped: boolean; + /** + * An object that can be used to store custom data about the Material. It + * should not hold references to functions as these will not be cloned. + */ + userData: Record; + set alphaTest(value: number); + /** + * Sets the alpha value to be used when running an alpha test. The material + * will not be rendered if the opacity is lower than this value. + * + * @default 0 + */ + get alphaTest(): number; +} + +export type MapColorPropertiesToColorRepresentations = { + [P in keyof T]: T[P] extends Color ? ColorRepresentation : T[P]; +}; + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MaterialParameters extends Partial> {} + +export interface MaterialJSON { + metadata: { version: number; type: string; generator: string }; + + uuid: string; + type: string; + + name?: string; + + color?: number; + roughness?: number; + metalness?: number; + + sheen?: number; + sheenColor?: number; + sheenRoughness?: number; + emissive?: number; + emissiveIntensity?: number; + + specular?: number; + specularIntensity?: number; + specularColor?: number; + shininess?: number; + clearcoat?: number; + clearcoatRoughness?: number; + clearcoatMap?: string; + clearcoatRoughnessMap?: string; + clearcoatNormalMap?: string; + clearcoatNormalScale?: Vector2Tuple; + + dispersion?: number; + + iridescence?: number; + iridescenceIOR?: number; + iridescenceThicknessRange?: number; + iridescenceMap?: string; + iridescenceThicknessMap?: string; + + anisotropy?: number; + anisotropyRotation?: number; + anisotropyMap?: string; + + map?: string; + matcap?: string; + alphaMap?: string; + + lightMap?: string; + lightMapIntensity?: number; + + aoMap?: string; + aoMapIntensity?: number; + + bumpMap?: string; + bumpScale?: number; + + normalMap?: string; + normalMapType?: NormalMapTypes; + normalScale?: Vector2Tuple; + + displacementMap?: string; + displacementScale?: number; + displacementBias?: number; + + roughnessMap?: string; + metalnessMap?: string; + + emissiveMap?: string; + specularMap?: string; + specularIntensityMap?: string; + specularColorMap?: string; + + envMap?: string; + combine?: Combine; + + envMapRotation?: EulerTuple; + envMapIntensity?: number; + reflectivity?: number; + refractionRatio?: number; + + gradientMap?: string; + + transmission?: number; + transmissionMap?: string; + thickness?: number; + thicknessMap?: string; + attenuationDistance?: number; + attenuationColor?: number; + + size?: number; + shadowSide?: number; + sizeAttenuation?: boolean; + + blending?: Blending; + side?: Side; + vertexColors?: boolean; + + opacity?: number; + transparent?: boolean; + + blendSrc?: BlendingSrcFactor; + blendDst?: BlendingDstFactor; + blendEquation?: BlendingEquation; + blendSrcAlpha?: number | null; + blendDstAlpha?: number | null; + blendEquationAlpha?: number | null; + blendColor?: number; + blendAlpha?: number; + + depthFunc?: DepthModes; + depthTest?: boolean; + depthWrite?: boolean; + colorWrite?: boolean; + + stencilWriteMask?: number; + stencilFunc?: StencilFunc; + stencilRef?: number; + stencilFuncMask?: number; + stencilFail?: StencilOp; + stencilZFail?: StencilOp; + stencilZPass?: StencilOp; + stencilWrite?: boolean; + + rotation?: number; + + polygonOffset?: boolean; + polygonOffsetFactor?: number; + polygonOffsetUnits?: number; + + linewidth?: number; + dashSize?: number; + gapSize?: number; + scale?: number; + + dithering?: boolean; + + alphaTest?: number; + alphaHash?: boolean; + alphaToCoverage?: boolean; + premultipliedAlpha?: boolean; + forceSinglePass?: boolean; + + wireframe?: boolean; + wireframeLinewidth?: number; + wireframeLinecap?: string; + wireframeLinejoin?: string; + + flatShading?: boolean; + + visible?: boolean; + + toneMapped?: boolean; + + fog?: boolean; + + userData?: Record; + + textures?: Array>; + images?: SourceJSON[]; +} + +/** + * Abstract base class for materials. + * + * Materials define the appearance of renderable 3D objects. + * + * @abstract + */ +export class Material extends EventDispatcher<{ dispose: {} }> { + /** + * This flag can be used for type testing. + * + * @default true + */ + readonly isMaterial: boolean; + /** + * The UUID of the material. + */ + readonly uuid: string; + /** + * The type property is used for detecting the object type + * in context of serialization/deserialization. + */ + readonly type: string; + /** + * This starts at `0` and counts how many times {@link Material#needsUpdate} is set to `true`. + * + * @default 0 + */ + readonly version: number; + /** + * An optional callback that is executed immediately before the material is used to render a 3D object. + * + * This method can only be used when rendering with {@link WebGLRenderer}. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {Scene} scene - The scene. + * @param {Camera} camera - The camera that is used to render the scene. + * @param {BufferGeometry} geometry - The 3D object's geometry. + * @param {Object3D} object - The 3D object. + * @param {Object} group - The geometry group data. + */ + onBeforeRender( + renderer: WebGLRenderer, + scene: Scene, + camera: Camera, + geometry: BufferGeometry, + object: Object3D, + group: Group, + ): void; + /** + * An optional callback that is executed immediately before the shader + * program is compiled. This function is called with the shader source code + * as a parameter. Useful for the modification of built-in materials. + * + * This method can only be used when rendering with {@link WebGLRenderer}. The + * recommended approach when customizing materials is to use `WebGPURenderer` with the new + * Node Material system and [TSL]{@link https://github.com/mrdoob/three.js/wiki/Three.js-Shading-Language}. + * + * @param {{vertexShader:string,fragmentShader:string,uniforms:Object}} shaderobject - The object holds the uniforms and the vertex and fragment shader source. + * @param {WebGLRenderer} renderer - A reference to the renderer. + */ + onBeforeCompile(parameters: WebGLProgramParametersWithUniforms, renderer: WebGLRenderer): void; + /** + * In case {@link Material#onBeforeCompile} is used, this callback can be used to identify + * values of settings used in `onBeforeCompile()`, so three.js can reuse a cached + * shader or recompile the shader for this material as needed. + * + * This method can only be used when rendering with {@link WebGLRenderer}. + * + * @return {string} The custom program cache key. + */ + customProgramCacheKey(): string; + /** + * This method can be used to set default values from parameter objects. + * It is a generic implementation so it can be used with different types + * of materials. + * + * @param {Object} [values] - The material values to set. + */ + setValues(values?: MaterialParameters): void; + /** + * Serializes the material into JSON. + * + * @param {?(Object|string)} meta - An optional value holding meta information about the serialization. + * @return {Object} A JSON object representing the serialized material. + * @see {@link ObjectLoader#parse} + */ + toJSON(meta?: JSONMeta): MaterialJSON; + /** + * Returns a new material with copied values from this instance. + * + * @return {Material} A clone of this instance. + */ + clone(): this; + /** + * Copies the values of the given material to this instance. + * + * @param {Material} source - The material to copy. + * @return {Material} A reference to this instance. + */ + copy(source: Material): this; + /** + * Frees the GPU-related resources allocated by this instance. Call this + * method whenever this instance is no longer used in your app. + * + * @fires Material#dispose + */ + dispose(): void; + /** + * Setting this property to `true` indicates the engine the material + * needs to be recompiled. + * + * @default false + * @param {boolean} value + */ + set needsUpdate(value: boolean); +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface Material extends MaterialProperties {} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/Materials.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/Materials.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dbca5e5b79457e435a6bef3171e69af50cf76faa --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/Materials.d.ts @@ -0,0 +1,18 @@ +export * from "./LineBasicMaterial.js"; +export * from "./LineDashedMaterial.js"; +export * from "./Material.js"; +export * from "./MeshBasicMaterial.js"; +export * from "./MeshDepthMaterial.js"; +export * from "./MeshDistanceMaterial.js"; +export * from "./MeshLambertMaterial.js"; +export * from "./MeshMatcapMaterial.js"; +export * from "./MeshNormalMaterial.js"; +export * from "./MeshPhongMaterial.js"; +export * from "./MeshPhysicalMaterial.js"; +export * from "./MeshStandardMaterial.js"; +export * from "./MeshToonMaterial.js"; +export * from "./PointsMaterial.js"; +export * from "./RawShaderMaterial.js"; +export * from "./ShaderMaterial.js"; +export * from "./ShadowMaterial.js"; +export * from "./SpriteMaterial.js"; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/MeshBasicMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/MeshBasicMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cfe54992a1113168206057e0ad1cc86742c4724f --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/MeshBasicMaterial.d.ts @@ -0,0 +1,174 @@ +import { Combine } from "../constants.js"; +import { Color } from "../math/Color.js"; +import { Euler } from "../math/Euler.js"; +import { Texture } from "../textures/Texture.js"; +import { MapColorPropertiesToColorRepresentations, Material, MaterialProperties } from "./Material.js"; + +export interface MeshBasicMaterialProperties extends MaterialProperties { + /** + * Color of the material. + * + * @default (1,1,1) + */ + color: Color; + /** + * The color map. May optionally include an alpha channel, typically combined + * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map + * color is modulated by the diffuse `color`. + * + * @default null + */ + map: Texture | null; + /** + * The light map. Requires a second set of UVs. + * + * @default null + */ + lightMap: Texture | null; + /** + * Intensity of the baked light. + * + * @default 1 + */ + lightMapIntensity: number; + /** + * The red channel of this texture is used as the ambient occlusion map. + * Requires a second set of UVs. + * + * @default null + */ + aoMap: Texture | null; + /** + * Intensity of the ambient occlusion effect. Range is `[0,1]`, where `0` + * disables ambient occlusion. Where intensity is `1` and the AO map's + * red channel is also `1`, ambient light is fully occluded on a surface. + * + * @default 1 + */ + aoMapIntensity: number; + /** + * Specular map used by the material. + * + * @default null + */ + specularMap: Texture | null; + /** + * The alpha map is a grayscale texture that controls the opacity across the + * surface (black: fully transparent; white: fully opaque). + * + * Only the color of the texture is used, ignoring the alpha channel if one + * exists. For RGB and RGBA textures, the renderer will use the green channel + * when sampling this texture due to the extra bit of precision provided for + * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and + * luminance/alpha textures will also still work as expected. + * + * @default null + */ + alphaMap: Texture | null; + /** + * The environment map. + * + * @default null + */ + envMap: Texture | null; + /** + * The rotation of the environment map in radians. + * + * @default (0,0,0) + */ + envMapRotation: Euler; + /** + * How to combine the result of the surface's color with the environment map, if any. + * + * When set to `MixOperation`, the {@link MeshBasicMaterial#reflectivity} is used to + * blend between the two colors. + * + * @default MultiplyOperation + */ + combine: Combine; + /** + * How much the environment map affects the surface. + * The valid range is between `0` (no reflections) and `1` (full reflections). + * + * @default 1 + */ + reflectivity: number; + /** + * The index of refraction (IOR) of air (approximately 1) divided by the + * index of refraction of the material. It is used with environment mapping + * modes {@link CubeRefractionMapping} and {@link EquirectangularRefractionMapping}. + * The refraction ratio should not exceed `1`. + * + * @default 0.98 + */ + refractionRatio: number; + /** + * Renders the geometry as a wireframe. + * + * @default false + */ + wireframe: boolean; + /** + * Controls the thickness of the wireframe. + * + * Can only be used with {@link SVGRenderer}. + * + * @default 1 + */ + wireframeLinewidth: number; + /** + * Defines appearance of wireframe ends. + * + * Can only be used with {@link SVGRenderer}. + * + * @default 'round' + */ + wireframeLinecap: "round" | "bevel" | "miter"; + /** + * Defines appearance of wireframe joints. + * + * Can only be used with {@link SVGRenderer}. + * + * @default 'round' + */ + wireframeLinejoin: "round" | "bevel" | "miter"; + /** + * Whether the material is affected by fog or not. + * + * @default true + */ + fog: boolean; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshBasicMaterialParameters + extends Partial> +{} + +/** + * A material for drawing geometries in a simple shaded (flat or wireframe) way. + * + * This material is not affected by lights. + */ +export class MeshBasicMaterial extends Material { + /** + * Constructs a new mesh basic material. + * + * @param {Object} [parameters] - An object with one or more properties + * defining the material's appearance. Any property of the material + * (including any property from inherited materials) can be passed + * in here. Color values can be passed any type of value accepted + * by {@link Color#set}. + */ + constructor(parameters?: MeshBasicMaterialParameters); + /** + * This flag can be used for type testing. + * + * @default true + */ + readonly isMeshBasicMaterial: boolean; + setValues(values?: MeshBasicMaterialParameters): void; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshBasicMaterial extends MeshBasicMaterialProperties {} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/MeshDepthMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/MeshDepthMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0ac60817ab347117b668e9f0a5138f4d5b6d03f8 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/MeshDepthMaterial.d.ts @@ -0,0 +1,106 @@ +import { DepthPackingStrategies } from "../constants.js"; +import { Texture } from "../textures/Texture.js"; +import { MapColorPropertiesToColorRepresentations, Material, MaterialProperties } from "./Material.js"; + +export interface MeshDepthMaterialProperties extends MaterialProperties { + /** + * Type for depth packing. + * + * @default BasicDepthPacking + */ + depthPacking: DepthPackingStrategies; + /** + * The color map. May optionally include an alpha channel, typically combined + * with {@link Material#transparent} or {@link Material#alphaTest}. + * + * @default null + */ + map: Texture | null; + /** + * The alpha map is a grayscale texture that controls the opacity across the + * surface (black: fully transparent; white: fully opaque). + * + * Only the color of the texture is used, ignoring the alpha channel if one + * exists. For RGB and RGBA textures, the renderer will use the green channel + * when sampling this texture due to the extra bit of precision provided for + * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and + * luminance/alpha textures will also still work as expected. + * + * @default null + */ + alphaMap: Texture | null; + /** + * The displacement map affects the position of the mesh's vertices. Unlike + * other maps which only affect the light and shade of the material the + * displaced vertices can cast shadows, block other objects, and otherwise + * act as real geometry. The displacement texture is an image where the value + * of each pixel (white being the highest) is mapped against, and + * repositions, the vertices of the mesh. + * + * @default null + */ + displacementMap: Texture | null; + /** + * How much the displacement map affects the mesh (where black is no + * displacement, and white is maximum displacement). Without a displacement + * map set, this value is not applied. + * + * @default 0 + */ + displacementScale: number; + /** + * The offset of the displacement map's values on the mesh's vertices. + * The bias is added to the scaled sample of the displacement map. + * Without a displacement map set, this value is not applied. + * + * @default 0 + */ + displacementBias: number; + /** + * Renders the geometry as a wireframe. + * + * @default false + */ + wireframe: boolean; + /** + * Controls the thickness of the wireframe. + * + * WebGL and WebGPU ignore this property and always render + * 1 pixel wide lines. + * + * @default 1 + */ + wireframeLinewidth: number; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshDepthMaterialParameters + extends Partial> +{} + +/** + * A material for drawing geometry by depth. Depth is based off of the camera + * near and far plane. White is nearest, black is farthest. + */ +export class MeshDepthMaterial extends Material { + /** + * Constructs a new mesh depth material. + * + * @param {Object} [parameters] - An object with one or more properties + * defining the material's appearance. Any property of the material + * (including any property from inherited materials) can be passed + * in here. Color values can be passed any type of value accepted + * by {@link Color#set}. + */ + constructor(parameters?: MeshDepthMaterialParameters); + /** + * This flag can be used for type testing. + * + * @default true + */ + readonly isMeshDepthMaterial: boolean; + setValues(values?: MeshDepthMaterialParameters): void; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshDepthMaterial extends MeshDepthMaterialProperties {} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/MeshDistanceMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/MeshDistanceMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b704fc907bbcdf936dc8cd58d17a85ba9fe02dfd --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/MeshDistanceMaterial.d.ts @@ -0,0 +1,89 @@ +import { Texture } from "../textures/Texture.js"; +import { MapColorPropertiesToColorRepresentations, Material, MaterialProperties } from "./Material.js"; + +export interface MeshDistanceMaterialProperties extends MaterialProperties { + /** + * The color map. May optionally include an alpha channel, typically combined + * with {@link Material#transparent} or {@link Material#alphaTest}. + * + * @default null + */ + map: Texture | null; + /** + * The alpha map is a grayscale texture that controls the opacity across the + * surface (black: fully transparent; white: fully opaque). + * + * Only the color of the texture is used, ignoring the alpha channel if one + * exists. For RGB and RGBA textures, the renderer will use the green channel + * when sampling this texture due to the extra bit of precision provided for + * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and + * luminance/alpha textures will also still work as expected. + * + * @default null + */ + alphaMap: Texture | null; + /** + * The displacement map affects the position of the mesh's vertices. Unlike + * other maps which only affect the light and shade of the material the + * displaced vertices can cast shadows, block other objects, and otherwise + * act as real geometry. The displacement texture is an image where the value + * of each pixel (white being the highest) is mapped against, and + * repositions, the vertices of the mesh. + * + * @default null + */ + displacementMap: Texture | null; + /** + * How much the displacement map affects the mesh (where black is no + * displacement, and white is maximum displacement). Without a displacement + * map set, this value is not applied. + * + * @default 0 + */ + displacementScale: number; + /** + * The offset of the displacement map's values on the mesh's vertices. + * The bias is added to the scaled sample of the displacement map. + * Without a displacement map set, this value is not applied. + * + * @default 0 + */ + displacementBias: number; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshDistanceMaterialParameters + extends Partial> +{} + +/** + * A material used internally for implementing shadow mapping with + * point lights. + * + * Can also be used to customize the shadow casting of an object by assigning + * an instance of `MeshDistanceMaterial` to {@link Object3D#customDistanceMaterial}. + * The following examples demonstrates this approach in order to ensure + * transparent parts of objects do not cast shadows. + */ +export class MeshDistanceMaterial extends Material { + /** + * Constructs a new mesh distance material. + * + * @param {Object} [parameters] - An object with one or more properties + * defining the material's appearance. Any property of the material + * (including any property from inherited materials) can be passed + * in here. Color values can be passed any type of value accepted + * by {@link Color#set}. + */ + constructor(parameters?: MeshDistanceMaterialParameters); + /** + * This flag can be used for type testing. + * + * @default true + */ + readonly isMeshDistanceMaterial: boolean; + setValues(values?: MeshDistanceMaterialParameters): void; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshDistanceMaterial extends MeshDistanceMaterialProperties {} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/MeshLambertMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/MeshLambertMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..97e9115e9895879ed749a4c426e9420c1648bb92 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/MeshLambertMaterial.d.ts @@ -0,0 +1,276 @@ +import { Combine, NormalMapTypes } from "../constants.js"; +import { Color } from "../math/Color.js"; +import { Euler } from "../math/Euler.js"; +import { Vector2 } from "../math/Vector2.js"; +import { Texture } from "../textures/Texture.js"; +import { MapColorPropertiesToColorRepresentations, Material, MaterialProperties } from "./Material.js"; + +export interface MeshLambertMaterialProperties extends MaterialProperties { + /** + * Color of the material. + * + * @default (1,1,1) + */ + color: Color; + /** + * The color map. May optionally include an alpha channel, typically combined + * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map + * color is modulated by the diffuse `color`. + * + * @default null + */ + map: Texture | null; + /** + * The light map. Requires a second set of UVs. + * + * @default null + */ + lightMap: Texture | null; + /** + * Intensity of the baked light. + * + * @default 1 + */ + lightMapIntensity: number; + /** + * The red channel of this texture is used as the ambient occlusion map. + * Requires a second set of UVs. + * + * @default null + */ + aoMap: Texture | null; + /** + * Intensity of the ambient occlusion effect. Range is `[0,1]`, where `0` + * disables ambient occlusion. Where intensity is `1` and the AO map's + * red channel is also `1`, ambient light is fully occluded on a surface. + * + * @default 1 + */ + aoMapIntensity: number; + /** + * Emissive (light) color of the material, essentially a solid color + * unaffected by other lighting. + * + * @default (0,0,0) + */ + emissive: Color; + /** + * Intensity of the emissive light. Modulates the emissive color. + * + * @default 1 + */ + emissiveIntensity: number; + /** + * Set emissive (glow) map. The emissive map color is modulated by the + * emissive color and the emissive intensity. If you have an emissive map, + * be sure to set the emissive color to something other than black. + * + * @default null + */ + emissiveMap: Texture | null; + /** + * The texture to create a bump map. The black and white values map to the + * perceived depth in relation to the lights. Bump doesn't actually affect + * the geometry of the object, only the lighting. If a normal map is defined + * this will be ignored. + * + * @default null + */ + bumpMap: Texture | null; + /** + * How much the bump map affects the material. Typical range is `[0,1]`. + * + * @default 1 + */ + bumpScale: number; + /** + * The texture to create a normal map. The RGB values affect the surface + * normal for each pixel fragment and change the way the color is lit. Normal + * maps do not change the actual shape of the surface, only the lighting. In + * case the material has a normal map authored using the left handed + * convention, the `y` component of `normalScale` should be negated to compensate + * for the different handedness. + * + * @default null + */ + normalMap: Texture | null; + /** + * The type of normal map. + * + * @default TangentSpaceNormalMap + */ + normalMapType: NormalMapTypes; + /** + * How much the normal map affects the material. Typical value range is `[0,1]`. + * + * @default (1,1) + */ + normalScale: Vector2; + /** + * The displacement map affects the position of the mesh's vertices. Unlike + * other maps which only affect the light and shade of the material the + * displaced vertices can cast shadows, block other objects, and otherwise + * act as real geometry. The displacement texture is an image where the value + * of each pixel (white being the highest) is mapped against, and + * repositions, the vertices of the mesh. + * + * @default null + */ + displacementMap: Texture | null; + /** + * How much the displacement map affects the mesh (where black is no + * displacement, and white is maximum displacement). Without a displacement + * map set, this value is not applied. + * + * @default 0 + */ + displacementScale: number; + /** + * The offset of the displacement map's values on the mesh's vertices. + * The bias is added to the scaled sample of the displacement map. + * Without a displacement map set, this value is not applied. + * + * @default 0 + */ + displacementBias: number; + /** + * Specular map used by the material. + * + * @default null + */ + specularMap: Texture | null; + /** + * The alpha map is a grayscale texture that controls the opacity across the + * surface (black: fully transparent; white: fully opaque). + * + * Only the color of the texture is used, ignoring the alpha channel if one + * exists. For RGB and RGBA textures, the renderer will use the green channel + * when sampling this texture due to the extra bit of precision provided for + * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and + * luminance/alpha textures will also still work as expected. + * + * @default null + */ + alphaMap: Texture | null; + /** + * The environment map. + * + * @default null + */ + envMap: Texture | null; + /** + * The rotation of the environment map in radians. + * + * @default (0,0,0) + */ + envMapRotation: Euler; + /** + * How to combine the result of the surface's color with the environment map, if any. + * + * When set to `MixOperation`, the {@link MeshBasicMaterial#reflectivity} is used to + * blend between the two colors. + * + * @default MultiplyOperation + */ + combine: Combine; + /** + * How much the environment map affects the surface. + * The valid range is between `0` (no reflections) and `1` (full reflections). + * + * @default 1 + */ + reflectivity: number; + /** + * The index of refraction (IOR) of air (approximately 1) divided by the + * index of refraction of the material. It is used with environment mapping + * modes {@link CubeRefractionMapping} and {@link EquirectangularRefractionMapping}. + * The refraction ratio should not exceed `1`. + * + * @default 0.98 + */ + refractionRatio: number; + /** + * Renders the geometry as a wireframe. + * + * @default false + */ + wireframe: boolean; + /** + * Controls the thickness of the wireframe. + * + * Can only be used with {@link SVGRenderer}. + * + * @default 1 + */ + wireframeLinewidth: number; + /** + * Defines appearance of wireframe ends. + * + * Can only be used with {@link SVGRenderer}. + * + * @default 'round' + */ + wireframeLinecap: "round" | "bevel" | "miter"; + /** + * Defines appearance of wireframe joints. + * + * Can only be used with {@link SVGRenderer}. + * + * @default 'round' + */ + wireframeLinejoin: "round" | "bevel" | "miter"; + /** + * Whether the material is rendered with flat shading or not. + * + * @default false + */ + flatShading: boolean; + /** + * Whether the material is affected by fog or not. + * + * @default true + */ + fog: boolean; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshLambertMaterialParameters + extends Partial> +{} + +/** + * A material for non-shiny surfaces, without specular highlights. + * + * The material uses a non-physically based [Lambertian]{@link https://en.wikipedia.org/wiki/Lambertian_reflectance} + * model for calculating reflectance. This can simulate some surfaces (such + * as untreated wood or stone) well, but cannot simulate shiny surfaces with + * specular highlights (such as varnished wood). `MeshLambertMaterial` uses per-fragment + * shading. + * + * Due to the simplicity of the reflectance and illumination models, + * performance will be greater when using this material over the + * {@link MeshPhongMaterial}, {@link MeshStandardMaterial} or + * {@link MeshPhysicalMaterial}, at the cost of some graphical accuracy. + */ +export class MeshLambertMaterial extends Material { + /** + * Constructs a new mesh lambert material. + * + * @param {Object} [parameters] - An object with one or more properties + * defining the material's appearance. Any property of the material + * (including any property from inherited materials) can be passed + * in here. Color values can be passed any type of value accepted + * by {@link Color#set}. + */ + constructor(parameters?: MeshLambertMaterialParameters); + /** + * This flag can be used for type testing. + * + * @default true + */ + readonly isMeshLambertMaterial: boolean; + setValues(values?: MeshLambertMaterialParameters): void; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshLambertMaterial extends MeshLambertMaterialProperties {} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/MeshMatcapMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/MeshMatcapMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..463cec31ad3539e3903b4b9af8cb09ec7247b557 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/MeshMatcapMaterial.d.ts @@ -0,0 +1,155 @@ +import { NormalMapTypes } from "../constants.js"; +import { Color } from "../math/Color.js"; +import { Vector2 } from "../math/Vector2.js"; +import { Texture } from "../textures/Texture.js"; +import { MapColorPropertiesToColorRepresentations, Material, MaterialProperties } from "./Material.js"; + +export interface MeshMatcapMaterialProperties extends MaterialProperties { + /** + * Color of the material. + * + * @default (1,1,1) + */ + color: Color; + /** + * The matcap map. + * + * @default null + */ + matcap: Texture | null; + /** + * The color map. May optionally include an alpha channel, typically combined + * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map + * color is modulated by the diffuse `color`. + * + * @default null + */ + map: Texture | null; + /** + * The texture to create a bump map. The black and white values map to the + * perceived depth in relation to the lights. Bump doesn't actually affect + * the geometry of the object, only the lighting. If a normal map is defined + * this will be ignored. + * + * @default null + */ + bumpMap: Texture | null; + /** + * How much the bump map affects the material. Typical range is `[0,1]`. + * + * @default 1 + */ + bumpScale: number; + /** + * The texture to create a normal map. The RGB values affect the surface + * normal for each pixel fragment and change the way the color is lit. Normal + * maps do not change the actual shape of the surface, only the lighting. In + * case the material has a normal map authored using the left handed + * convention, the `y` component of `normalScale` should be negated to compensate + * for the different handedness. + * + * @default null + */ + normalMap: Texture | null; + /** + * The type of normal map. + * + * @default TangentSpaceNormalMap + */ + normalMapType: NormalMapTypes; + /** + * How much the normal map affects the material. Typical value range is `[0,1]`. + * + * @default (1,1) + */ + normalScale: Vector2; + /** + * The displacement map affects the position of the mesh's vertices. Unlike + * other maps which only affect the light and shade of the material the + * displaced vertices can cast shadows, block other objects, and otherwise + * act as real geometry. The displacement texture is an image where the value + * of each pixel (white being the highest) is mapped against, and + * repositions, the vertices of the mesh. + * + * @default null + */ + displacementMap: Texture | null; + /** + * How much the displacement map affects the mesh (where black is no + * displacement, and white is maximum displacement). Without a displacement + * map set, this value is not applied. + * + * @default 0 + */ + displacementScale: number; + /** + * The offset of the displacement map's values on the mesh's vertices. + * The bias is added to the scaled sample of the displacement map. + * Without a displacement map set, this value is not applied. + * + * @default 0 + */ + displacementBias: number; + /** + * The alpha map is a grayscale texture that controls the opacity across the + * surface (black: fully transparent; white: fully opaque). + * + * Only the color of the texture is used, ignoring the alpha channel if one + * exists. For RGB and RGBA textures, the renderer will use the green channel + * when sampling this texture due to the extra bit of precision provided for + * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and + * luminance/alpha textures will also still work as expected. + * + * @default null + */ + alphaMap: Texture | null; + /** + * Whether the material is rendered with flat shading or not. + * + * @default false + */ + flatShading: boolean; + /** + * Whether the material is affected by fog or not. + * + * @default true + */ + fog: boolean; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshMatcapMaterialParameters + extends Partial> +{} + +/** + * This material is defined by a MatCap (or Lit Sphere) texture, which encodes the + * material color and shading. + * + * `MeshMatcapMaterial` does not respond to lights since the matcap image file encodes + * baked lighting. It will cast a shadow onto an object that receives shadows + * (and shadow clipping works), but it will not self-shadow or receive + * shadows. + */ +export class MeshMatcapMaterial extends Material { + /** + * Constructs a new mesh matcap material. + * + * @param {Object} [parameters] - An object with one or more properties + * defining the material's appearance. Any property of the material + * (including any property from inherited materials) can be passed + * in here. Color values can be passed any type of value accepted + * by {@link Color#set}. + */ + constructor(parameters?: MeshMatcapMaterialParameters); + /** + * This flag can be used for type testing. + * + * @default true + */ + readonly isMeshMatcapMaterial: boolean; + setValues(values?: MeshMatcapMaterialParameters): void; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshMatcapMaterial extends MeshMatcapMaterialProperties {} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/MeshNormalMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/MeshNormalMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2428b5bd015856fabdd8cdd4de00ed28cdaa205d --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/MeshNormalMaterial.d.ts @@ -0,0 +1,124 @@ +import { NormalMapTypes } from "../constants.js"; +import { Vector2 } from "../math/Vector2.js"; +import { Texture } from "../textures/Texture.js"; +import { MapColorPropertiesToColorRepresentations, Material, MaterialProperties } from "./Material.js"; + +export interface MeshNormalMaterialProperties extends MaterialProperties { + /** + * The texture to create a bump map. The black and white values map to the + * perceived depth in relation to the lights. Bump doesn't actually affect + * the geometry of the object, only the lighting. If a normal map is defined + * this will be ignored. + * + * @default null + */ + bumpMap: Texture | null; + /** + * How much the bump map affects the material. Typical range is `[0,1]`. + * + * @default 1 + */ + bumpScale: number; + /** + * The texture to create a normal map. The RGB values affect the surface + * normal for each pixel fragment and change the way the color is lit. Normal + * maps do not change the actual shape of the surface, only the lighting. In + * case the material has a normal map authored using the left handed + * convention, the `y` component of `normalScale` should be negated to compensate + * for the different handedness. + * + * @default null + */ + normalMap: Texture | null; + /** + * The type of normal map. + * + * @default TangentSpaceNormalMap + */ + normalMapType: NormalMapTypes; + /** + * How much the normal map affects the material. Typical value range is `[0,1]`. + * + * @default (1,1) + */ + normalScale: Vector2; + /** + * The displacement map affects the position of the mesh's vertices. Unlike + * other maps which only affect the light and shade of the material the + * displaced vertices can cast shadows, block other objects, and otherwise + * act as real geometry. The displacement texture is an image where the value + * of each pixel (white being the highest) is mapped against, and + * repositions, the vertices of the mesh. + * + * @default null + */ + displacementMap: Texture | null; + /** + * How much the displacement map affects the mesh (where black is no + * displacement, and white is maximum displacement). Without a displacement + * map set, this value is not applied. + * + * @default 0 + */ + displacementScale: number; + /** + * The offset of the displacement map's values on the mesh's vertices. + * The bias is added to the scaled sample of the displacement map. + * Without a displacement map set, this value is not applied. + * + * @default 0 + */ + displacementBias: number; + /** + * Renders the geometry as a wireframe. + * + * @default false + */ + wireframe: boolean; + /** + * Controls the thickness of the wireframe. + * + * WebGL and WebGPU ignore this property and always render + * 1 pixel wide lines. + * + * @default 1 + */ + wireframeLinewidth: number; + /** + * Whether the material is rendered with flat shading or not. + * + * @default false + */ + flatShading: boolean; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshNormalMaterialParameters + extends Partial> +{} + +/** + * A material that maps the normal vectors to RGB colors. + */ +export class MeshNormalMaterial extends Material { + /** + * Constructs a new mesh normal material. + * + * @param {Object} [parameters] - An object with one or more properties + * defining the material's appearance. Any property of the material + * (including any property from inherited materials) can be passed + * in here. Color values can be passed any type of value accepted + * by {@link Color#set}. + */ + constructor(parameters?: MeshNormalMaterialParameters); + /** + * This flag can be used for type testing. + * + * @default true + */ + readonly isMeshNormalMaterial: boolean; + setValues(values?: MeshNormalMaterialParameters): void; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshNormalMaterial extends MeshNormalMaterialProperties {} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/MeshPhongMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/MeshPhongMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2a1add23bcf94bb285599196847a59311d1bfbfc --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/MeshPhongMaterial.d.ts @@ -0,0 +1,288 @@ +import { Combine, NormalMapTypes } from "../constants.js"; +import { Color } from "../math/Color.js"; +import { Euler } from "../math/Euler.js"; +import { Vector2 } from "../math/Vector2.js"; +import { Texture } from "../textures/Texture.js"; +import { MapColorPropertiesToColorRepresentations, Material, MaterialProperties } from "./Material.js"; + +export interface MeshPhongMaterialProperties extends MaterialProperties { + /** + * Color of the material. + * + * @default (1,1,1) + */ + color: Color; + /** + * Specular color of the material. The default color is set to `0x111111` (very dark grey) + * + * This defines how shiny the material is and the color of its shine. + */ + specular: Color; + /** + * How shiny the specular highlight is; a higher value gives a sharper highlight. + * + * @default 30 + */ + shininess: number; + /** + * The color map. May optionally include an alpha channel, typically combined + * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map + * color is modulated by the diffuse `color`. + * + * @default null + */ + map: Texture | null; + /** + * The light map. Requires a second set of UVs. + * + * @default null + */ + lightMap: Texture | null; + /** + * Intensity of the baked light. + * + * @default 1 + */ + lightMapIntensity: number; + /** + * The red channel of this texture is used as the ambient occlusion map. + * Requires a second set of UVs. + * + * @default null + */ + aoMap: Texture | null; + /** + * Intensity of the ambient occlusion effect. Range is `[0,1]`, where `0` + * disables ambient occlusion. Where intensity is `1` and the AO map's + * red channel is also `1`, ambient light is fully occluded on a surface. + * + * @default 1 + */ + aoMapIntensity: number; + /** + * Emissive (light) color of the material, essentially a solid color + * unaffected by other lighting. + * + * @default (0,0,0) + */ + emissive: Color; + /** + * Intensity of the emissive light. Modulates the emissive color. + * + * @default 1 + */ + emissiveIntensity: number; + /** + * Set emissive (glow) map. The emissive map color is modulated by the + * emissive color and the emissive intensity. If you have an emissive map, + * be sure to set the emissive color to something other than black. + * + * @default null + */ + emissiveMap: Texture | null; + /** + * The texture to create a bump map. The black and white values map to the + * perceived depth in relation to the lights. Bump doesn't actually affect + * the geometry of the object, only the lighting. If a normal map is defined + * this will be ignored. + * + * @default null + */ + bumpMap: Texture | null; + /** + * How much the bump map affects the material. Typical range is `[0,1]`. + * + * @default 1 + */ + bumpScale: number; + /** + * The texture to create a normal map. The RGB values affect the surface + * normal for each pixel fragment and change the way the color is lit. Normal + * maps do not change the actual shape of the surface, only the lighting. In + * case the material has a normal map authored using the left handed + * convention, the `y` component of `normalScale` should be negated to compensate + * for the different handedness. + * + * @default null + */ + normalMap: Texture | null; + /** + * The type of normal map. + * + * @default TangentSpaceNormalMap + */ + normalMapType: NormalMapTypes; + /** + * How much the normal map affects the material. Typical value range is `[0,1]`. + * + * @default (1,1) + */ + normalScale: Vector2; + /** + * The displacement map affects the position of the mesh's vertices. Unlike + * other maps which only affect the light and shade of the material the + * displaced vertices can cast shadows, block other objects, and otherwise + * act as real geometry. The displacement texture is an image where the value + * of each pixel (white being the highest) is mapped against, and + * repositions, the vertices of the mesh. + * + * @default null + */ + displacementMap: Texture | null; + /** + * How much the displacement map affects the mesh (where black is no + * displacement, and white is maximum displacement). Without a displacement + * map set, this value is not applied. + * + * @default 0 + */ + displacementScale: number; + /** + * The offset of the displacement map's values on the mesh's vertices. + * The bias is added to the scaled sample of the displacement map. + * Without a displacement map set, this value is not applied. + * + * @default 0 + */ + displacementBias: number; + /** + * The specular map value affects both how much the specular surface + * highlight contributes and how much of the environment map affects the + * surface. + * + * @default null + */ + specularMap: Texture | null; + /** + * The alpha map is a grayscale texture that controls the opacity across the + * surface (black: fully transparent; white: fully opaque). + * + * Only the color of the texture is used, ignoring the alpha channel if one + * exists. For RGB and RGBA textures, the renderer will use the green channel + * when sampling this texture due to the extra bit of precision provided for + * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and + * luminance/alpha textures will also still work as expected. + * + * @default null + */ + alphaMap: Texture | null; + /** + * The environment map. + * + * @default null + */ + envMap: Texture | null; + /** + * The rotation of the environment map in radians. + * + * @default (0,0,0) + */ + envMapRotation: Euler; + /** + * How to combine the result of the surface's color with the environment map, if any. + * + * When set to `MixOperation`, the {@link MeshBasicMaterial#reflectivity} is used to + * blend between the two colors. + * + * @default MultiplyOperation + */ + combine: Combine; + /** + * How much the environment map affects the surface. + * The valid range is between `0` (no reflections) and `1` (full reflections). + * + * @default 1 + */ + reflectivity: number; + /** + * The index of refraction (IOR) of air (approximately 1) divided by the + * index of refraction of the material. It is used with environment mapping + * modes {@link CubeRefractionMapping} and {@link EquirectangularRefractionMapping}. + * The refraction ratio should not exceed `1`. + * + * @default 0.98 + */ + refractionRatio: number; + /** + * Renders the geometry as a wireframe. + * + * @default false + */ + wireframe: boolean; + /** + * Controls the thickness of the wireframe. + * + * Can only be used with {@link SVGRenderer}. + * + * @default 1 + */ + wireframeLinewidth: number; + /** + * Defines appearance of wireframe ends. + * + * Can only be used with {@link SVGRenderer}. + * + * @default 'round' + */ + wireframeLinecap: "round" | "bevel" | "miter"; + /** + * Defines appearance of wireframe joints. + * + * Can only be used with {@link SVGRenderer}. + * + * @default 'round' + */ + wireframeLinejoin: "round" | "bevel" | "miter"; + /** + * Whether the material is rendered with flat shading or not. + * + * @default false + */ + flatShading: boolean; + /** + * Whether the material is affected by fog or not. + * + * @default true + */ + fog: boolean; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshPhongMaterialParameters + extends Partial> +{} + +/** + * A material for shiny surfaces with specular highlights. + * + * The material uses a non-physically based [Blinn-Phong]{@link https://en.wikipedia.org/wiki/Blinn-Phong_shading_model} + * model for calculating reflectance. Unlike the Lambertian model used in the + * {@link MeshLambertMaterial} this can simulate shiny surfaces with specular + * highlights (such as varnished wood). `MeshPhongMaterial` uses per-fragment shading. + * + * Performance will generally be greater when using this material over the + * {@link MeshStandardMaterial} or {@link MeshPhysicalMaterial}, at the cost of + * some graphical accuracy. + */ +export class MeshPhongMaterial extends Material { + /** + * Constructs a new mesh phong material. + * + * @param {Object} [parameters] - An object with one or more properties + * defining the material's appearance. Any property of the material + * (including any property from inherited materials) can be passed + * in here. Color values can be passed any type of value accepted + * by {@link Color#set}. + */ + constructor(parameters?: MeshPhongMaterialParameters); + /** + * This flag can be used for type testing. + * + * @default true + */ + readonly isMeshPhongMaterial: boolean; + setValues(values?: MeshPhongMaterialParameters): void; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshPhongMaterial extends MeshPhongMaterialProperties {} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/MeshPhysicalMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/MeshPhysicalMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0838f4bd9ceaa89bf13a9fa364b7acc54351c89d --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/MeshPhysicalMaterial.d.ts @@ -0,0 +1,291 @@ +import { Color } from "../math/Color.js"; +import { Vector2 } from "../math/Vector2.js"; +import { Texture } from "../textures/Texture.js"; +import { MapColorPropertiesToColorRepresentations } from "./Material.js"; +import { MeshStandardMaterial, MeshStandardMaterialProperties } from "./MeshStandardMaterial.js"; + +export interface MeshPhysicalMaterialProperties extends MeshStandardMaterialProperties { + /** + * The rotation of the anisotropy in tangent, bitangent space, measured in radians + * counter-clockwise from the tangent. When `anisotropyMap` is present, this + * property provides additional rotation to the vectors in the texture. + * + * @default 1 + */ + anisotropyRotation: number; + /** + * Red and green channels represent the anisotropy direction in `[-1, 1]` tangent, + * bitangent space, to be rotated by `anisotropyRotation`. The blue channel + * contains strength as `[0, 1]` to be multiplied by `anisotropy`. + * + * @default null + */ + anisotropyMap: Texture | null; + /** + * The red channel of this texture is multiplied against `clearcoat`, + * for per-pixel control over a coating's intensity. + * + * @default null + */ + clearcoatMap: Texture | null; + /** + * Roughness of the clear coat layer, from `0.0` to `1.0`. + * + * @default 0 + */ + clearcoatRoughness: number; + /** + * The green channel of this texture is multiplied against + * `clearcoatRoughness`, for per-pixel control over a coating's roughness. + * + * @default null + */ + clearcoatRoughnessMap: Texture | null; + /** + * How much `clearcoatNormalMap` affects the clear coat layer, from + * `(0,0)` to `(1,1)`. + * + * @default (1,1) + */ + clearcoatNormalScale: Vector2; + /** + * Can be used to enable independent normals for the clear coat layer. + * + * @default null + */ + clearcoatNormalMap: Texture | null; + /** + * Index-of-refraction for non-metallic materials, from `1.0` to `2.333`. + * + * @default 1.5 + */ + ior: number; + /** + * Degree of reflectivity, from `0.0` to `1.0`. Default is `0.5`, which + * corresponds to an index-of-refraction of `1.5`. + * + * This models the reflectivity of non-metallic materials. It has no effect + * when `metalness` is `1.0` + * + * @name MeshPhysicalMaterial#reflectivity + * @default 0.5 + */ + get reflectivity(): number; + set reflectivity(reflectivity: number); + /** + * The red channel of this texture is multiplied against `iridescence`, for per-pixel + * control over iridescence. + * + * @default null + */ + iridescenceMap: Texture | null; + /** + * Strength of the iridescence RGB color shift effect, represented by an index-of-refraction. + * Between `1.0` to `2.333`. + * + * @default 1.3 + */ + iridescenceIOR: number; + /** + *Array of exactly 2 elements, specifying minimum and maximum thickness of the iridescence layer. + Thickness of iridescence layer has an equivalent effect of the one `thickness` has on `ior`. + * + * @default [100,400] + */ + iridescenceThicknessRange: [number, number]; + /** + * A texture that defines the thickness of the iridescence layer, stored in the green channel. + * Minimum and maximum values of thickness are defined by `iridescenceThicknessRange` array: + * - `0.0` in the green channel will result in thickness equal to first element of the array. + * - `1.0` in the green channel will result in thickness equal to second element of the array. + * - Values in-between will linearly interpolate between the elements of the array. + * + * @default null + */ + iridescenceThicknessMap: Texture | null; + /** + * The sheen tint. + * + * @default (0,0,0) + */ + sheenColor: Color; + /** + * The RGB channels of this texture are multiplied against `sheenColor`, for per-pixel control + * over sheen tint. + * + * @default null + */ + sheenColorMap: Texture | null; + /** + * Roughness of the sheen layer, from `0.0` to `1.0`. + * + * @default 1 + */ + sheenRoughness: number; + /** + * The alpha channel of this texture is multiplied against `sheenRoughness`, for per-pixel control + * over sheen roughness. + * + * @default null + */ + sheenRoughnessMap: Texture | null; + /** + * The red channel of this texture is multiplied against `transmission`, for per-pixel control over + * optical transparency. + * + * @default null + */ + transmissionMap: Texture | null; + /** + * The thickness of the volume beneath the surface. The value is given in the + * coordinate space of the mesh. If the value is `0` the material is + * thin-walled. Otherwise the material is a volume boundary. + * + * @default 0 + */ + thickness: number; + /** + * A texture that defines the thickness, stored in the green channel. This will + * be multiplied by `thickness`. + * + * @default null + */ + thicknessMap: Texture | null; + /** + * Density of the medium given as the average distance that light travels in + * the medium before interacting with a particle. The value is given in world + * space units, and must be greater than zero. + * + * @default Infinity + */ + attenuationDistance: number; + /** + * The color that white light turns into due to absorption when reaching the + * attenuation distance. + * + * @default (1,1,1) + */ + attenuationColor: Color; + /** + * A float that scales the amount of specular reflection for non-metals only. + * When set to zero, the model is effectively Lambertian. From `0.0` to `1.0`. + * + * @default 1 + */ + specularIntensity: number; + /** + * The alpha channel of this texture is multiplied against `specularIntensity`, + * for per-pixel control over specular intensity. + * + * @default null + */ + specularIntensityMap: Texture | null; + /** + * Tints the specular reflection at normal incidence for non-metals only. + * + * @default (1,1,1) + */ + specularColor: Color; + /** + * The RGB channels of this texture are multiplied against `specularColor`, + * for per-pixel control over specular color. + * + * @default null + */ + specularColorMap: Texture | null; + set anisotropy(value: number); + /** + * The anisotropy strength. + * + * @default 0 + */ + get anisotropy(): number; + set clearcoat(value: number); + /** + * Represents the intensity of the clear coat layer, from `0.0` to `1.0`. Use + * clear coat related properties to enable multilayer materials that have a + * thin translucent layer over the base layer. + * + * @default 0 + */ + get clearcoat(): number; + set iridescence(value: number); + /** + * The intensity of the iridescence layer, simulating RGB color shift based on the angle between + * the surface and the viewer, from `0.0` to `1.0`. + * + * @default 0 + */ + get iridescence(): number; + set dispersion(value: number); + /** + * Defines the strength of the angular separation of colors (chromatic aberration) transmitting + * through a relatively clear volume. Any value zero or larger is valid, the typical range of + * realistic values is `[0, 1]`. This property can be only be used with transmissive objects. + * + * @default 0 + */ + get dispersion(): number; + set sheen(value: number); + /** + * The intensity of the sheen layer, from `0.0` to `1.0`. + * + * @default 0 + */ + get sheen(): number; + set transmission(value: number); + /** + * Degree of transmission (or optical transparency), from `0.0` to `1.0`. + * + * Thin, transparent or semitransparent, plastic or glass materials remain + * largely reflective even if they are fully transmissive. The transmission + * property can be used to model these materials. + * + * When transmission is non-zero, `opacity` should be set to `1`. + * + * @default 0 + */ + get transmission(): number; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshPhysicalMaterialParameters + extends Partial> +{} + +/** + * An extension of the {@link MeshStandardMaterial}, providing more advanced + * physically-based rendering properties: + * + * - Anisotropy: Ability to represent the anisotropic property of materials + * as observable with brushed metals. + * - Clearcoat: Some materials — like car paints, carbon fiber, and wet surfaces — require + * a clear, reflective layer on top of another layer that may be irregular or rough. + * Clearcoat approximates this effect, without the need for a separate transparent surface. + * - Iridescence: Allows to render the effect where hue varies depending on the viewing + * angle and illumination angle. This can be seen on soap bubbles, oil films, or on the + * wings of many insects. + * - Physically-based transparency: One limitation of {@link Material#opacity} is that highly + * transparent materials are less reflective. Physically-based transmission provides a more + * realistic option for thin, transparent surfaces like glass. + * - Advanced reflectivity: More flexible reflectivity for non-metallic materials. + * - Sheen: Can be used for representing cloth and fabric materials. + * + * As a result of these complex shading features, `MeshPhysicalMaterial` has a + * higher performance cost, per pixel, than other three.js materials. Most + * effects are disabled by default, and add cost as they are enabled. For + * best results, always specify an environment map when using this material. + */ +export class MeshPhysicalMaterial extends MeshStandardMaterial { + constructor(parameters?: MeshPhysicalMaterialParameters); + /** + * This flag can be used for type testing. + * + * @default true + */ + readonly isMeshPhysicalMaterial: boolean; + setValues(values?: MeshPhysicalMaterialParameters): void; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshPhysicalMaterial extends MeshPhysicalMaterialProperties {} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/MeshStandardMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/MeshStandardMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..56ba5fe3fdcd4ca8548da995bdebfb42e1774ca5 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/MeshStandardMaterial.d.ts @@ -0,0 +1,300 @@ +import { NormalMapTypes } from "../constants.js"; +import { Color } from "../math/Color.js"; +import { Euler } from "../math/Euler.js"; +import { Vector2 } from "../math/Vector2.js"; +import { Texture } from "../textures/Texture.js"; +import { MapColorPropertiesToColorRepresentations, Material, MaterialProperties } from "./Material.js"; + +export interface MeshStandardMaterialProperties extends MaterialProperties { + /** + * Color of the material. + * + * @default (1,1,1) + */ + color: Color; + /** + * How rough the material appears. `0.0` means a smooth mirror reflection, `1.0` + * means fully diffuse. If `roughnessMap` is also provided, + * both values are multiplied. + * + * @default 1 + */ + roughness: number; + /** + * How much the material is like a metal. Non-metallic materials such as wood + * or stone use `0.0`, metallic use `1.0`, with nothing (usually) in between. + * A value between `0.0` and `1.0` could be used for a rusty metal look. + * If `metalnessMap` is also provided, both values are multiplied. + * + * @default 0 + */ + metalness: number; + /** + * The color map. May optionally include an alpha channel, typically combined + * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map + * color is modulated by the diffuse `color`. + * + * @default null + */ + map: Texture | null; + /** + * The light map. Requires a second set of UVs. + * + * @default null + */ + lightMap: Texture | null; + /** + * Intensity of the baked light. + * + * @default 1 + */ + lightMapIntensity: number; + /** + * The red channel of this texture is used as the ambient occlusion map. + * Requires a second set of UVs. + * + * @default null + */ + aoMap: Texture | null; + /** + * Intensity of the ambient occlusion effect. Range is `[0,1]`, where `0` + * disables ambient occlusion. Where intensity is `1` and the AO map's + * red channel is also `1`, ambient light is fully occluded on a surface. + * + * @default 1 + */ + aoMapIntensity: number; + /** + * Emissive (light) color of the material, essentially a solid color + * unaffected by other lighting. + * + * @default (0,0,0) + */ + emissive: Color; + /** + * Intensity of the emissive light. Modulates the emissive color. + * + * @default 1 + */ + emissiveIntensity: number; + /** + * Set emissive (glow) map. The emissive map color is modulated by the + * emissive color and the emissive intensity. If you have an emissive map, + * be sure to set the emissive color to something other than black. + * + * @default null + */ + emissiveMap: Texture | null; + /** + * The texture to create a bump map. The black and white values map to the + * perceived depth in relation to the lights. Bump doesn't actually affect + * the geometry of the object, only the lighting. If a normal map is defined + * this will be ignored. + * + * @default null + */ + bumpMap: Texture | null; + /** + * How much the bump map affects the material. Typical range is `[0,1]`. + * + * @default 1 + */ + bumpScale: number; + /** + * The texture to create a normal map. The RGB values affect the surface + * normal for each pixel fragment and change the way the color is lit. Normal + * maps do not change the actual shape of the surface, only the lighting. In + * case the material has a normal map authored using the left handed + * convention, the `y` component of `normalScale` should be negated to compensate + * for the different handedness. + * + * @default null + */ + normalMap: Texture | null; + /** + * The type of normal map. + * + * @default TangentSpaceNormalMap + */ + normalMapType: NormalMapTypes; + /** + * How much the normal map affects the material. Typical value range is `[0,1]`. + * + * @default (1,1) + */ + normalScale: Vector2; + /** + * The displacement map affects the position of the mesh's vertices. Unlike + * other maps which only affect the light and shade of the material the + * displaced vertices can cast shadows, block other objects, and otherwise + * act as real geometry. The displacement texture is an image where the value + * of each pixel (white being the highest) is mapped against, and + * repositions, the vertices of the mesh. + * + * @default null + */ + displacementMap: Texture | null; + /** + * How much the displacement map affects the mesh (where black is no + * displacement, and white is maximum displacement). Without a displacement + * map set, this value is not applied. + * + * @default 0 + */ + displacementScale: number; + /** + * The offset of the displacement map's values on the mesh's vertices. + * The bias is added to the scaled sample of the displacement map. + * Without a displacement map set, this value is not applied. + * + * @default 0 + */ + displacementBias: number; + /** + * The green channel of this texture is used to alter the roughness of the + * material. + * + * @default null + */ + roughnessMap: Texture | null; + /** + * The blue channel of this texture is used to alter the metalness of the + * material. + * + * @default null + */ + metalnessMap: Texture | null; + /** + * The alpha map is a grayscale texture that controls the opacity across the + * surface (black: fully transparent; white: fully opaque). + * + * Only the color of the texture is used, ignoring the alpha channel if one + * exists. For RGB and RGBA textures, the renderer will use the green channel + * when sampling this texture due to the extra bit of precision provided for + * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and + * luminance/alpha textures will also still work as expected. + * + * @default null + */ + alphaMap: Texture | null; + /** + * The environment map. To ensure a physically correct rendering, environment maps + * are internally pre-processed with {@link PMREMGenerator}. + * + * @default null + */ + envMap: Texture | null; + /** + * The rotation of the environment map in radians. + * + * @default (0,0,0) + */ + envMapRotation: Euler; + /** + * Scales the effect of the environment map by multiplying its color. + * + * @default 1 + */ + envMapIntensity: number; + /** + * Renders the geometry as a wireframe. + * + * @default false + */ + wireframe: boolean; + /** + * Controls the thickness of the wireframe. + * + * Can only be used with {@link SVGRenderer}. + * + * @default 1 + */ + wireframeLinewidth: number; + /** + * Defines appearance of wireframe ends. + * + * Can only be used with {@link SVGRenderer}. + * + * @default 'round' + */ + wireframeLinecap: "round" | "bevel" | "miter"; + /** + * Defines appearance of wireframe joints. + * + * Can only be used with {@link SVGRenderer}. + * + * @default 'round' + */ + wireframeLinejoin: "round" | "bevel" | "miter"; + /** + * Whether the material is rendered with flat shading or not. + * + * @default false + */ + flatShading: boolean; + /** + * Whether the material is affected by fog or not. + * + * @default true + */ + fog: boolean; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshStandardMaterialParameters + extends Partial> +{} + +/** + * A standard physically based material, using Metallic-Roughness workflow. + * + * Physically based rendering (PBR) has recently become the standard in many + * 3D applications, such as [Unity]{@link https://blogs.unity3d.com/2014/10/29/physically-based-shading-in-unity-5-a-primer/}, + * [Unreal]{@link https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/PhysicallyBased/} and + * [3D Studio Max]{@link http://area.autodesk.com/blogs/the-3ds-max-blog/what039s-new-for-rendering-in-3ds-max-2017}. + * + * This approach differs from older approaches in that instead of using + * approximations for the way in which light interacts with a surface, a + * physically correct model is used. The idea is that, instead of tweaking + * materials to look good under specific lighting, a material can be created + * that will react 'correctly' under all lighting scenarios. + * + * In practice this gives a more accurate and realistic looking result than + * the {@link MeshLambertMaterial} or {@link MeshPhongMaterial}, at the cost of + * being somewhat more computationally expensive. `MeshStandardMaterial` uses per-fragment + * shading. + * + * Note that for best results you should always specify an environment map when using this material. + * + * For a non-technical introduction to the concept of PBR and how to set up a + * PBR material, check out these articles by the people at [marmoset]{@link https://www.marmoset.co}: + * + * - [Basic Theory of Physically Based Rendering]{@link https://www.marmoset.co/posts/basic-theory-of-physically-based-rendering/} + * - [Physically Based Rendering and You Can Too]{@link https://www.marmoset.co/posts/physically-based-rendering-and-you-can-too/} + * + * Technical details of the approach used in three.js (and most other PBR systems) can be found is this + * [paper from Disney]{@link https://media.disneyanimation.com/uploads/production/publication_asset/48/asset/s2012_pbs_disney_brdf_notes_v3.pdf} + * (pdf), by Brent Burley. + */ +export class MeshStandardMaterial extends Material { + /** + * Constructs a new mesh standard material. + * + * @param {Object} [parameters] - An object with one or more properties + * defining the material's appearance. Any property of the material + * (including any property from inherited materials) can be passed + * in here. Color values can be passed any type of value accepted + * by {@link Color#set}. + */ + constructor(parameters?: MeshStandardMaterialParameters); + /** + * This flag can be used for type testing. + * + * @default true + */ + readonly isMeshStandardMaterial: boolean; + setValues(values?: MeshStandardMaterialParameters): void; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshStandardMaterial extends MeshStandardMaterialProperties {} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/MeshToonMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/MeshToonMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e7d42f7d7d1a99bf3dbcacfb1281e533a7d5d085 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/MeshToonMaterial.d.ts @@ -0,0 +1,223 @@ +import { NormalMapTypes } from "../constants.js"; +import { Color } from "../math/Color.js"; +import { Vector2 } from "../math/Vector2.js"; +import { Texture } from "../textures/Texture.js"; +import { MapColorPropertiesToColorRepresentations, Material, MaterialProperties } from "./Material.js"; + +export interface MeshToonMaterialProperties extends MaterialProperties { + /** + * Color of the material. + * + * @default (1,1,1) + */ + color: Color; + /** + * The color map. May optionally include an alpha channel, typically combined + * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map + * color is modulated by the diffuse `color`. + * + * @default null + */ + map: Texture | null; + /** + * Gradient map for toon shading. It's required to set + * {@link Texture#minFilter} and {@link Texture#magFilter} to {@linkNearestFilter} + * when using this type of texture. + * + * @default null + */ + gradientMap: Texture | null; + /** + * The light map. Requires a second set of UVs. + * + * @default null + */ + lightMap: Texture | null; + /** + * Intensity of the baked light. + * + * @default 1 + */ + lightMapIntensity: number; + /** + * The red channel of this texture is used as the ambient occlusion map. + * Requires a second set of UVs. + * + * @default null + */ + aoMap: Texture | null; + /** + * Intensity of the ambient occlusion effect. Range is `[0,1]`, where `0` + * disables ambient occlusion. Where intensity is `1` and the AO map's + * red channel is also `1`, ambient light is fully occluded on a surface. + * + * @default 1 + */ + aoMapIntensity: number; + /** + * Emissive (light) color of the material, essentially a solid color + * unaffected by other lighting. + * + * @default (0,0,0) + */ + emissive: Color; + /** + * Intensity of the emissive light. Modulates the emissive color. + * + * @default 1 + */ + emissiveIntensity: number; + /** + * Set emissive (glow) map. The emissive map color is modulated by the + * emissive color and the emissive intensity. If you have an emissive map, + * be sure to set the emissive color to something other than black. + * + * @default null + */ + emissiveMap: Texture | null; + /** + * The texture to create a bump map. The black and white values map to the + * perceived depth in relation to the lights. Bump doesn't actually affect + * the geometry of the object, only the lighting. If a normal map is defined + * this will be ignored. + * + * @default null + */ + bumpMap: Texture | null; + /** + * How much the bump map affects the material. Typical range is `[0,1]`. + * + * @default 1 + */ + bumpScale: number; + /** + * The texture to create a normal map. The RGB values affect the surface + * normal for each pixel fragment and change the way the color is lit. Normal + * maps do not change the actual shape of the surface, only the lighting. In + * case the material has a normal map authored using the left handed + * convention, the `y` component of `normalScale` should be negated to compensate + * for the different handedness. + * + * @default null + */ + normalMap: Texture | null; + /** + * The type of normal map. + * + * @default TangentSpaceNormalMap + */ + normalMapType: NormalMapTypes; + /** + * How much the normal map affects the material. Typical value range is `[0,1]`. + * + * @default (1,1) + */ + normalScale: Vector2; + /** + * The displacement map affects the position of the mesh's vertices. Unlike + * other maps which only affect the light and shade of the material the + * displaced vertices can cast shadows, block other objects, and otherwise + * act as real geometry. The displacement texture is an image where the value + * of each pixel (white being the highest) is mapped against, and + * repositions, the vertices of the mesh. + * + * @default null + */ + displacementMap: Texture | null; + /** + * How much the displacement map affects the mesh (where black is no + * displacement, and white is maximum displacement). Without a displacement + * map set, this value is not applied. + * + * @default 0 + */ + displacementScale: number; + /** + * The offset of the displacement map's values on the mesh's vertices. + * The bias is added to the scaled sample of the displacement map. + * Without a displacement map set, this value is not applied. + * + * @default 0 + */ + displacementBias: number; + /** + * The alpha map is a grayscale texture that controls the opacity across the + * surface (black: fully transparent; white: fully opaque). + * + * Only the color of the texture is used, ignoring the alpha channel if one + * exists. For RGB and RGBA textures, the renderer will use the green channel + * when sampling this texture due to the extra bit of precision provided for + * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and + * luminance/alpha textures will also still work as expected. + * + * @default null + */ + alphaMap: Texture | null; + /** + * Renders the geometry as a wireframe. + * + * @default false + */ + wireframe: boolean; + /** + * Controls the thickness of the wireframe. + * + * Can only be used with {@link SVGRenderer}. + * + * @default 1 + */ + wireframeLinewidth: number; + /** + * Defines appearance of wireframe ends. + * + * Can only be used with {@link SVGRenderer}. + * + * @default 'round' + */ + wireframeLinecap: "round" | "bevel" | "miter"; + /** + * Defines appearance of wireframe joints. + * + * Can only be used with {@link SVGRenderer}. + * + * @default 'round' + */ + wireframeLinejoin: "round" | "bevel" | "miter"; + /** + * Whether the material is affected by fog or not. + * + * @default true + */ + fog: boolean; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshToonMaterialParameters + extends Partial> +{} + +/** + * A material implementing toon shading. + */ +export class MeshToonMaterial extends Material { + /** + * Constructs a new mesh toon material. + * + * @param {Object} [parameters] - An object with one or more properties + * defining the material's appearance. Any property of the material + * (including any property from inherited materials) can be passed + * in here. Color values can be passed any type of value accepted + * by {@link Color#set}. + */ + constructor(parameters?: MeshToonMaterialParameters); + /** + * This flag can be used for type testing. + * + * @default true + */ + readonly isMeshToonMaterial: boolean; + setValues(values?: MeshToonMaterialParameters): void; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshToonMaterial extends MeshToonMaterialProperties {} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/PointsMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/PointsMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fe69504f3a0bc7ba9b8065dbe2d2f0a78c0c0733 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/PointsMaterial.d.ts @@ -0,0 +1,104 @@ +import { Color } from "../math/Color.js"; +import { Texture } from "../textures/Texture.js"; +import { MapColorPropertiesToColorRepresentations, Material, MaterialProperties } from "./Material.js"; + +export interface PointsMaterialProperties extends MaterialProperties { + /** + * Color of the material. + * + * @default (1,1,1) + */ + color: Color; + /** + * The color map. May optionally include an alpha channel, typically combined + * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map + * color is modulated by the diffuse `color`. + * + * @default null + */ + map: Texture | null; + /** + * The alpha map is a grayscale texture that controls the opacity across the + * surface (black: fully transparent; white: fully opaque). + * + * Only the color of the texture is used, ignoring the alpha channel if one + * exists. For RGB and RGBA textures, the renderer will use the green channel + * when sampling this texture due to the extra bit of precision provided for + * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and + * luminance/alpha textures will also still work as expected. + * + * @default null + */ + alphaMap: Texture | null; + /** + * Defines the size of the points in pixels. + * + * Might be capped if the value exceeds hardware dependent parameters like [gl.ALIASED_POINT_SIZE_RANGE]{@link https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getParamete}. + * + * @default 1 + */ + size: number; + /** + * Specifies whether size of individual points is attenuated by the camera depth (perspective camera only). + * + * @default true + */ + sizeAttenuation: boolean; + /** + * Whether the material is affected by fog or not. + * + * @default true + */ + fog: boolean; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface PointsMaterialParameters + extends Partial> +{} + +/** + * A material for rendering point primitives. + * + * Materials define the appearance of renderable 3D objects. + * + * ```js + * const vertices = []; + * + * for ( let i = 0; i < 10000; i ++ ) { + * const x = THREE.MathUtils.randFloatSpread( 2000 ); + * const y = THREE.MathUtils.randFloatSpread( 2000 ); + * const z = THREE.MathUtils.randFloatSpread( 2000 ); + * + * vertices.push( x, y, z ); + * } + * + * const geometry = new THREE.BufferGeometry(); + * geometry.setAttribute( 'position', new THREE.Float32BufferAttribute( vertices, 3 ) ); + * const material = new THREE.PointsMaterial( { color: 0x888888 } ); + * const points = new THREE.Points( geometry, material ); + * scene.add( points ); + * ``` + */ +export class PointsMaterial extends Material { + /** + * Constructs a new points material. + * + * @param {Object} [parameters] - An object with one or more properties + * defining the material's appearance. Any property of the material + * (including any property from inherited materials) can be passed + * in here. Color values can be passed any type of value accepted + * by {@link Color#set}. + */ + constructor(parameters?: PointsMaterialParameters); + /** + * This flag can be used for type testing. + * + * @default true + */ + readonly isPointsMaterial: boolean; + setValues(values?: PointsMaterialParameters): void; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface PointsMaterial extends PointsMaterialProperties {} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/RawShaderMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/RawShaderMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fdabc654f672537d1c0ea3c0fcd35d34eebd84bc --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/RawShaderMaterial.d.ts @@ -0,0 +1,17 @@ +import { ShaderMaterial } from "./ShaderMaterial.js"; + +/** + * This class works just like {@link ShaderMaterial}, except that definitions + * of built-in uniforms and attributes are not automatically prepended to the + * GLSL shader code. + * + * `RawShaderMaterial` can only be used with {@link WebGLRenderer}. + */ +export class RawShaderMaterial extends ShaderMaterial { + /** + * This flag can be used for type testing. + * + * @default true + */ + readonly isRawShaderMaterial: boolean; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/ShaderMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/ShaderMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ca4adb7ac1c1dce1abda2329e428ac62e2334a69 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/ShaderMaterial.d.ts @@ -0,0 +1,251 @@ +import { GLSLVersion } from "../constants.js"; +import { JSONMeta } from "../core/Object3D.js"; +import { UniformsGroup } from "../core/UniformsGroup.js"; +import { Matrix3Tuple } from "../math/Matrix3.js"; +import { Matrix4Tuple } from "../math/Matrix4.js"; +import { Vector2Tuple } from "../math/Vector2.js"; +import { Vector3Tuple } from "../math/Vector3.js"; +import { Vector4Tuple } from "../math/Vector4.js"; +import { IUniform } from "../renderers/shaders/UniformsLib.js"; +import { MapColorPropertiesToColorRepresentations, Material, MaterialJSON, MaterialProperties } from "./Material.js"; + +export interface ShaderMaterialProperties extends MaterialProperties { + /** + * Defines custom constants using `#define` directives within the GLSL code + * for both the vertex shader and the fragment shader; each key/value pair + * yields another directive. + * ```js + * defines: { + * FOO: 15, + * BAR: true + * } + * ``` + * Yields the lines: + * ``` + * #define FOO 15 + * #define BAR true + * ``` + */ + defines: { [key: string]: any }; + /** + * An object of the form: + * ```js + * { + * "uniform1": { value: 1.0 }, + * "uniform2": { value: 2 } + * } + * ``` + * specifying the uniforms to be passed to the shader code; keys are uniform + * names, values are definitions of the form + * ``` + * { + * value: 1.0 + * } + * ``` + * where `value` is the value of the uniform. Names must match the name of + * the uniform, as defined in the GLSL code. Note that uniforms are refreshed + * on every frame, so updating the value of the uniform will immediately + * update the value available to the GLSL code. + */ + uniforms: { [uniform: string]: IUniform }; + /** + * An array holding uniforms groups for configuring UBOs. + */ + uniformsGroups: Array; + /** + * Vertex shader GLSL code. This is the actual code for the shader. + */ + vertexShader: string; + /** + * Fragment shader GLSL code. This is the actual code for the shader. + */ + fragmentShader: string; + /** + * Controls line thickness or lines. + * + * WebGL and WebGPU ignore this setting and always render line primitives with a + * width of one pixel. + * + * @default 1 + */ + linewidth: number; + /** + * Renders the geometry as a wireframe. + * + * @default false + */ + wireframe: boolean; + /** + * Controls the thickness of the wireframe. + * + * WebGL and WebGPU ignore this property and always render + * 1 pixel wide lines. + * + * @default 1 + */ + wireframeLinewidth: number; + /** + * Define whether the material color is affected by global fog settings; `true` + * to pass fog uniforms to the shader. + * + * @default false + */ + fog: boolean; + /** + * Defines whether this material uses lighting; `true` to pass uniform data + * related to lighting to this shader. + * + * @default false + */ + lights: boolean; + /** + * Defines whether this material supports clipping; `true` to let the renderer + * pass the clippingPlanes uniform. + * + * @default false + */ + clipping: boolean; + /** + * This object allows to enable certain WebGL 2 extensions. + * + * - clipCullDistance: set to `true` to use vertex shader clipping + * - multiDraw: set to `true` to use vertex shader multi_draw / enable gl_DrawID + */ + extensions: { + clipCullDistance: boolean; + multiDraw: boolean; + }; + /** + * When the rendered geometry doesn't include these attributes but the + * material does, these default values will be passed to the shaders. This + * avoids errors when buffer data is missing. + * + * - color: [ 1, 1, 1 ] + * - uv: [ 0, 0 ] + * - uv1: [ 0, 0 ] + */ + defaultAttributeValues: { + color: [number, number, number]; + uv: [number, number]; + uv1: [number, number]; + }; + /** + * If set, this calls [gl.bindAttribLocation]{@link https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bindAttribLocation} + * to bind a generic vertex index to an attribute variable. + * + * @default undefined + */ + index0AttributeName: string | undefined; + /** + * Can be used to force a uniform update while changing uniforms in + * {@link Object3D#onBeforeRender}. + * + * @default false + */ + uniformsNeedUpdate: boolean; + /** + * Defines the GLSL version of custom shader code. + * + * @default null + */ + glslVersion: GLSLVersion | null; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface ShaderMaterialParameters + extends Partial> +{} + +export type ShaderMaterialUniformJSON = { + type: "t"; + value: string; +} | { + type: "c"; + value: number; +} | { + type: "v2"; + value: Vector2Tuple; +} | { + type: "v3"; + value: Vector3Tuple; +} | { + type: "v4"; + value: Vector4Tuple; +} | { + type: "m3"; + value: Matrix3Tuple; +} | { + type: "m4"; + value: Matrix4Tuple; +} | { + value: unknown; +}; + +export interface ShaderMaterialJSON extends MaterialJSON { + glslVersion: number | null; + uniforms: Record; + + defines?: Record; + + vertexShader: string; + fragmentShader: string; + + lights: boolean; + clipping: boolean; + + extensions?: Record; +} + +/** + * A material rendered with custom shaders. A shader is a small program written in GLSL. + * that runs on the GPU. You may want to use a custom shader if you need to implement an + * effect not included with any of the built-in materials. + * + * There are the following notes to bear in mind when using a `ShaderMaterial`: + * + * - `ShaderMaterial` can only be used with {@link WebGLRenderer}. + * - Built in attributes and uniforms are passed to the shaders along with your code. If + * you don't want that, use {@link RawShaderMaterial} instead. + * - You can use the directive `#pragma unroll_loop_start` and `#pragma unroll_loop_end` + * in order to unroll a `for` loop in GLSL by the shader preprocessor. The directive has + * to be placed right above the loop. The loop formatting has to correspond to a defined standard. + * - The loop has to be [normalized]{@link https://en.wikipedia.org/wiki/Normalized_loop}. + * - The loop variable has to be *i*. + * - The value `UNROLLED_LOOP_INDEX` will be replaced with the explicitly + * value of *i* for the given iteration and can be used in preprocessor + * statements. + * + * ```js + * const material = new THREE.ShaderMaterial( { + * uniforms: { + * time: { value: 1.0 }, + * resolution: { value: new THREE.Vector2() } + * }, + * vertexShader: document.getElementById( 'vertexShader' ).textContent, + * fragmentShader: document.getElementById( 'fragmentShader' ).textContent + * } ); + * ``` + */ +export class ShaderMaterial extends Material { + /** + * Constructs a new shader material. + * + * @param {Object} [parameters] - An object with one or more properties + * defining the material's appearance. Any property of the material + * (including any property from inherited materials) can be passed + * in here. Color values can be passed any type of value accepted + * by {@link Color#set}. + */ + constructor(parameters?: ShaderMaterialParameters); + /** + * This flag can be used for type testing. + * + * @default true + */ + readonly isShaderMaterial: boolean; + setValues(values?: ShaderMaterialParameters): void; + toJSON(meta?: JSONMeta): ShaderMaterialJSON; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface ShaderMaterial extends ShaderMaterialProperties {} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/ShadowMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/ShadowMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..abbba674bc37ffe675e2a8ef6e879e484fd5d686 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/ShadowMaterial.d.ts @@ -0,0 +1,61 @@ +import { Color } from "../math/Color.js"; +import { MapColorPropertiesToColorRepresentations, Material, MaterialProperties } from "./Material.js"; + +export interface ShadowMaterialProperties extends MaterialProperties { + /** + * Color of the material. + * + * @default (0,0,0) + */ + color: Color; + /** + * Whether the material is affected by fog or not. + * + * @default true + */ + fog: boolean; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface ShadowMaterialParameters + extends Partial> +{} + +/** + * This material can receive shadows, but otherwise is completely transparent. + * + * ```js + * const geometry = new THREE.PlaneGeometry( 2000, 2000 ); + * geometry.rotateX( - Math.PI / 2 ); + * + * const material = new THREE.ShadowMaterial(); + * material.opacity = 0.2; + * + * const plane = new THREE.Mesh( geometry, material ); + * plane.position.y = -200; + * plane.receiveShadow = true; + * scene.add( plane ); + * ``` + */ +export class ShadowMaterial extends Material { + /** + * Constructs a new shadow material. + * + * @param {Object} [parameters] - An object with one or more properties + * defining the material's appearance. Any property of the material + * (including any property from inherited materials) can be passed + * in here. Color values can be passed any type of value accepted + * by {@link Color#set}. + */ + constructor(parameters?: ShadowMaterialParameters); + /** + * This flag can be used for type testing. + * + * @default true + */ + readonly isShadowMaterial: boolean; + setValues(values?: ShadowMaterialParameters): void; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface ShadowMaterial extends ShadowMaterialProperties {} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/SpriteMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/SpriteMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e5fff0a18235f8ce78f0f937c2740e8195b4c652 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/SpriteMaterial.d.ts @@ -0,0 +1,91 @@ +import { Color } from "../math/Color.js"; +import { Texture } from "../textures/Texture.js"; +import { MapColorPropertiesToColorRepresentations, Material, MaterialProperties } from "./Material.js"; + +export interface SpriteMaterialProperties extends MaterialProperties { + /** + * Color of the material. + * + * @default (1,1,1) + */ + color: Color; + /** + * The color map. May optionally include an alpha channel, typically combined + * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map + * color is modulated by the diffuse `color`. + * + * @default null + */ + map: Texture | null; + /** + * The alpha map is a grayscale texture that controls the opacity across the + * surface (black: fully transparent; white: fully opaque). + * + * Only the color of the texture is used, ignoring the alpha channel if one + * exists. For RGB and RGBA textures, the renderer will use the green channel + * when sampling this texture due to the extra bit of precision provided for + * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and + * luminance/alpha textures will also still work as expected. + * + * @default null + */ + alphaMap: Texture | null; + /** + * The rotation of the sprite in radians. + * + * @default 0 + */ + rotation: number; + /** + * Specifies whether size of the sprite is attenuated by the camera depth (perspective camera only). + * + * @default true + */ + sizeAttenuation: boolean; + /** + * Whether the material is affected by fog or not. + * + * @default true + */ + fog: boolean; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface SpriteMaterialParameters + extends Partial> +{} + +/** + * A material for rendering instances of {@link Sprite}. + * + * ```js + * const map = new THREE.TextureLoader().load( 'textures/sprite.png' ); + * const material = new THREE.SpriteMaterial( { map: map, color: 0xffffff } ); + * + * const sprite = new THREE.Sprite( material ); + * sprite.scale.set(200, 200, 1) + * scene.add( sprite ); + * ``` + */ +export class SpriteMaterial extends Material { + /** + * Constructs a new sprite material. + * + * @param {Object} [parameters] - An object with one or more properties + * defining the material's appearance. Any property of the material + * (including any property from inherited materials) can be passed + * in here. Color values can be passed any type of value accepted + * by {@link Color#set}. + */ + constructor(parameters?: SpriteMaterialParameters); + /** + * This flag can be used for type testing. + * + * @default true + */ + readonly isSpriteMaterial: boolean; + setValues(values?: SpriteMaterialParameters): void; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface SpriteMaterial extends SpriteMaterialProperties {} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/Line2NodeMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/Line2NodeMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9d4234166dec4000b43725c5daa94f7b3c44923d --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/Line2NodeMaterial.d.ts @@ -0,0 +1,96 @@ +import Node from "../../nodes/core/Node.js"; +import { LineDashedMaterialParameters, LineDashedMaterialProperties } from "../LineDashedMaterial.js"; +import { MapColorPropertiesToColorRepresentations } from "../Material.js"; +import NodeMaterial, { NodeMaterialNodeProperties } from "./NodeMaterial.js"; + +export interface Line2NodeMaterialNodeProperties extends NodeMaterialNodeProperties { + /** + * Whether vertex colors should be used or not. + * + * @default false + */ + useColor: boolean; + /** + * The dash offset. + * + * @default 0 + */ + dashOffset: number; + /** + * Defines the lines color. + * + * @default null + */ + lineColorNode: Node | null; + /** + * Defines the offset. + * + * @default null + */ + offsetNode: Node | null; + /** + * Defines the dash scale. + * + * @default null + */ + dashScaleNode: Node | null; + /** + * Defines the dash size. + * + * @default null + */ + dashSizeNode: Node | null; + /** + * Defines the gap size. + * + * @default null + */ + gapSizeNode: Node | null; + set worldUnits(value: boolean); + /** + * Whether the lines should sized in world units or not. + * When set to `false` the unit is pixel. + * + * @default false + */ + get worldUnits(): boolean; + set dashed(value: boolean); + /** + * Whether the lines should be dashed or not. + * + * @default false + */ + get dashed(): boolean; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface Line2NodeMaterialParameters + extends + Partial>, + LineDashedMaterialParameters +{} + +/** + * This node material can be used to render lines with a size larger than one + * by representing them as instanced meshes. + */ +declare class Line2NodeMaterial extends NodeMaterial { + /** + * Constructs a new node material for wide line rendering. + * + * @param {Object} [parameters={}] - The configuration parameter. + */ + constructor(parameters?: Line2NodeMaterialParameters); + /** + * This flag can be used for type testing. + * + * @default true + */ + readonly isLine2NodeMaterial: boolean; + setValues(values?: Line2NodeMaterialParameters): void; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +interface Line2NodeMaterial extends Line2NodeMaterialNodeProperties, LineDashedMaterialProperties {} + +export default Line2NodeMaterial; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/LineBasicNodeMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/LineBasicNodeMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fe6b177a83e8a349c5d7d8271d014de36672ee45 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/LineBasicNodeMaterial.d.ts @@ -0,0 +1,42 @@ +import { LineBasicMaterialParameters, LineBasicMaterialProperties } from "../LineBasicMaterial.js"; +import { MapColorPropertiesToColorRepresentations } from "../Material.js"; +import NodeMaterial, { NodeMaterialNodeProperties } from "./NodeMaterial.js"; + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface LineBasicNodeMaterialNodeProperties extends NodeMaterialNodeProperties { +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface LineBasicNodeMaterialParameters + extends + Partial>, + LineBasicMaterialParameters +{} + +/** + * Node material version of {@link LineBasicMaterial}. + * + * @augments NodeMaterial + */ +declare class LineBasicNodeMaterial extends NodeMaterial { + /** + * Constructs a new line basic node material. + * + * @param {Object} [parameters] - The configuration parameter. + */ + constructor(parameters?: LineBasicNodeMaterialParameters); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isLineBasicNodeMaterial: boolean; + setValues(values?: LineBasicNodeMaterialParameters): void; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +interface LineBasicNodeMaterial extends LineBasicNodeMaterialNodeProperties, LineBasicMaterialProperties {} + +export default LineBasicNodeMaterial; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/LineDashedNodeMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/LineDashedNodeMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4ab90073a93d9586b600a48ad0323e8b050405d2 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/LineDashedNodeMaterial.d.ts @@ -0,0 +1,88 @@ +import Node from "../../nodes/core/Node.js"; +import { LineDashedMaterialParameters, LineDashedMaterialProperties } from "../LineDashedMaterial.js"; +import { MapColorPropertiesToColorRepresentations } from "../Material.js"; +import NodeMaterial, { NodeMaterialNodeProperties } from "./NodeMaterial.js"; + +export interface LineDashedNodeMaterialNodeProperties extends NodeMaterialNodeProperties { + /** + * The dash offset. + * + * @default 0 + */ + dashOffset: number; + /** + * The offset of dash materials is by default inferred from the `dashOffset` + * property. This node property allows to overwrite the default + * and define the offset with a node instead. + * + * If you don't want to overwrite the offset but modify the existing + * value instead, use {@link materialLineDashOffset}. + * + * @default null + */ + offsetNode: Node | null; + /** + * The scale of dash materials is by default inferred from the `scale` + * property. This node property allows to overwrite the default + * and define the scale with a node instead. + * + * If you don't want to overwrite the scale but modify the existing + * value instead, use {@link materialLineScale}. + * + * @default null + */ + dashScaleNode: Node | null; + /** + * The dash size of dash materials is by default inferred from the `dashSize` + * property. This node property allows to overwrite the default + * and define the dash size with a node instead. + * + * If you don't want to overwrite the dash size but modify the existing + * value instead, use {@link materialLineDashSize}. + * + * @default null + */ + dashSizeNode: Node | null; + /** + * The gap size of dash materials is by default inferred from the `gapSize` + * property. This node property allows to overwrite the default + * and define the gap size with a node instead. + * + * If you don't want to overwrite the gap size but modify the existing + * value instead, use {@link materialLineGapSize}. + * + * @default null + */ + gapSizeNode: Node | null; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface LineDashedNodeMaterialParameters + extends + Partial>, + LineDashedMaterialParameters +{} + +/** + * Node material version of {@link LineDashedMaterial}. + */ +declare class LineDashedNodeMaterial extends NodeMaterial { + /** + * Constructs a new line dashed node material. + * + * @param {Object} [parameters] - The configuration parameter. + */ + constructor(parameters?: LineDashedNodeMaterialParameters); + /** + * This flag can be used for type testing. + * + * @default true + */ + readonly isLineDashedNodeMaterial: boolean; + setValues(values?: LineDashedNodeMaterialParameters): void; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +interface LineDashedNodeMaterial extends LineDashedNodeMaterialNodeProperties, LineDashedMaterialProperties {} + +export default LineDashedNodeMaterial; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/MeshBasicNodeMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/MeshBasicNodeMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a42ef14f1d93989ed14e5fad853b1bc6f8f4d3f7 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/MeshBasicNodeMaterial.d.ts @@ -0,0 +1,56 @@ +import NodeBuilder from "../../nodes/core/NodeBuilder.js"; +import BasicLightingModel from "../../nodes/functions/BasicLightingModel.js"; +import BasicEnvironmentNode from "../../nodes/lighting/BasicEnvironmentNode.js"; +import { MapColorPropertiesToColorRepresentations } from "../Material.js"; +import { MeshBasicMaterialParameters, MeshBasicMaterialProperties } from "../MeshBasicMaterial.js"; +import NodeMaterial, { NodeMaterialNodeProperties } from "./NodeMaterial.js"; + +export interface MeshBasicNodeMaterialNodeProperties extends NodeMaterialNodeProperties { +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshBasicNodeMaterialParameters + extends + Partial>, + MeshBasicMaterialParameters +{} + +/** + * Node material version of {@link MeshBasicMaterial}. + */ +declare class MeshBasicNodeMaterial extends NodeMaterial { + /** + * Constructs a new mesh basic node material. + * + * @param {Object} [parameters] - The configuration parameter. + */ + constructor(parameters?: MeshBasicNodeMaterialParameters); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isMeshBasicNodeMaterial: boolean; + setValues(values?: MeshBasicNodeMaterialParameters): void; + /** + * Overwritten since this type of material uses {@link BasicEnvironmentNode} + * to implement the default environment mapping. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {?BasicEnvironmentNode} The environment node. + */ + setupEnvironment(builder: NodeBuilder): BasicEnvironmentNode | null; + /** + * Setups the lighting model. + * + * @return {BasicLightingModel} The lighting model. + */ + setupLightingModel(): BasicLightingModel; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +interface MeshBasicNodeMaterial extends MeshBasicNodeMaterialNodeProperties, MeshBasicMaterialProperties {} + +export default MeshBasicNodeMaterial; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/MeshLambertNodeMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/MeshLambertNodeMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..88dd57330a75c5f232d8ab38a262490e5da7262b --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/MeshLambertNodeMaterial.d.ts @@ -0,0 +1,57 @@ +import NodeBuilder from "../../nodes/core/NodeBuilder.js"; +import PhongLightingModel from "../../nodes/functions/PhongLightingModel.js"; +import BasicEnvironmentNode from "../../nodes/lighting/BasicEnvironmentNode.js"; +import { MapColorPropertiesToColorRepresentations } from "../Material.js"; +import { MeshLambertMaterialParameters, MeshLambertMaterialProperties } from "../MeshLambertMaterial.js"; +import NodeMaterial, { NodeMaterialNodeProperties } from "./NodeMaterial.js"; + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshLambertNodeMaterialNodeProperties extends NodeMaterialNodeProperties { +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshLambertNodeMaterialParameters + extends + Partial>, + MeshLambertMaterialParameters +{} + +/** + * Node material version of {@link MeshLambertMaterial}. + */ +declare class MeshLambertNodeMaterial extends NodeMaterial { + /** + * Constructs a new mesh lambert node material. + * + * @param {Object} [parameters] - The configuration parameter. + */ + constructor(parameters?: MeshLambertNodeMaterialParameters); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isMeshLambertNodeMaterial: boolean; + setValues(values?: MeshLambertNodeMaterialParameters): void; + /** + * Overwritten since this type of material uses {@link BasicEnvironmentNode} + * to implement the default environment mapping. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {?BasicEnvironmentNode} The environment node. + */ + setupEnvironment(builder: NodeBuilder): BasicEnvironmentNode | null; + /** + * Setups the lighting model. + * + * @return {PhongLightingModel} The lighting model. + */ + setupLightingModel(): PhongLightingModel; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +interface MeshLambertNodeMaterial extends MeshLambertNodeMaterialNodeProperties, MeshLambertMaterialProperties {} + +export default MeshLambertNodeMaterial; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/MeshMatcapNodeMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/MeshMatcapNodeMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..20cff34fa9fc47b306e4f92f862bb9f5408e5ef4 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/MeshMatcapNodeMaterial.d.ts @@ -0,0 +1,45 @@ +import NodeBuilder from "../../nodes/core/NodeBuilder.js"; +import { MapColorPropertiesToColorRepresentations } from "../Material.js"; +import { MeshMatcapMaterialParameters, MeshMatcapMaterialProperties } from "../MeshMatcapMaterial.js"; +import NodeMaterial, { NodeMaterialNodeProperties } from "./NodeMaterial.js"; + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshMatcapNodeMaterialNodeProperties extends NodeMaterialNodeProperties { +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshMatcapNodeMaterialParameters + extends + Partial>, + MeshMatcapMaterialParameters +{} + +/** + * Node material version of {@link MeshMatcapMaterial}. + */ +declare class MeshMatcapNodeMaterial extends NodeMaterial { + /** + * Constructs a new mesh normal node material. + * + * @param {Object} [parameters] - The configuration parameter. + */ + constructor(parameters?: MeshMatcapNodeMaterialParameters); + /** + * This flag can be used for type testing. + * + * @default true + */ + readonly isMeshMatcapNodeMaterial: boolean; + setValues(values?: MeshMatcapNodeMaterialParameters): void; + /** + * Setups the matcap specific node variables. + * + * @param {NodeBuilder} builder - The current node builder. + */ + setupVariants(builder: NodeBuilder): void; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +interface MeshMatcapNodeMaterial extends MeshMatcapNodeMaterialNodeProperties, MeshMatcapMaterialProperties {} + +export default MeshMatcapNodeMaterial; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/MeshNormalNodeMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/MeshNormalNodeMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ce18f998329be3bb412e117973f4655ae71f3b49 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/MeshNormalNodeMaterial.d.ts @@ -0,0 +1,43 @@ +import { MapColorPropertiesToColorRepresentations } from "../Material.js"; +import { MeshNormalMaterialParameters, MeshNormalMaterialProperties } from "../MeshNormalMaterial.js"; +import NodeMaterial, { NodeMaterialNodeProperties } from "./NodeMaterial.js"; + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshNormalNodeMaterialNodeProperties extends NodeMaterialNodeProperties { +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshNormalNodeMaterialParameters + extends + Partial>, + MeshNormalMaterialParameters +{} + +/** + * Node material version of {@link MeshNormalMaterial}. + */ +declare class MeshNormalNodeMaterial extends NodeMaterial { + /** + * Constructs a new mesh normal node material. + * + * @param {Object} [parameters] - The configuration parameter. + */ + constructor(parameters?: MeshNormalNodeMaterialParameters); + /** + * This flag can be used for type testing. + * + * @type {boolean} + */ + readonly isMeshNormalNodeMaterial: boolean; + setValues(values?: MeshNormalNodeMaterialParameters): void; + /** + * Overwrites the default implementation by computing the diffuse color + * based on the normal data. + */ + setupDiffuseColor(): void; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +interface MeshNormalNodeMaterial extends MeshNormalNodeMaterialNodeProperties, MeshNormalMaterialProperties {} + +export default MeshNormalNodeMaterial; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/MeshPhongNodeMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/MeshPhongNodeMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c678ec080c18cd5de0422274f41e2ec71889c375 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/MeshPhongNodeMaterial.d.ts @@ -0,0 +1,77 @@ +import Node from "../../nodes/core/Node.js"; +import NodeBuilder from "../../nodes/core/NodeBuilder.js"; +import PhongLightingModel from "../../nodes/functions/PhongLightingModel.js"; +import BasicEnvironmentNode from "../../nodes/lighting/BasicEnvironmentNode.js"; +import { MapColorPropertiesToColorRepresentations } from "../Material.js"; +import { MeshPhongMaterialParameters, MeshPhongMaterialProperties } from "../MeshPhongMaterial.js"; +import NodeMaterial, { NodeMaterialNodeProperties } from "./NodeMaterial.js"; + +export interface MeshPhongNodeMaterialNodeProperties extends NodeMaterialNodeProperties { + /** + * The shininess of phong materials is by default inferred from the `shininess` + * property. This node property allows to overwrite the default + * and define the shininess with a node instead. + * + * If you don't want to overwrite the shininess but modify the existing + * value instead, use {@link materialShininess}. + * + * @default null + */ + shininessNode: Node | null; + /** + * The specular color of phong materials is by default inferred from the + * `specular` property. This node property allows to overwrite the default + * and define the specular color with a node instead. + * + * If you don't want to overwrite the specular color but modify the existing + * value instead, use {@link materialSpecular}. + * + * @default null + */ + specularNode: Node | null; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshPhongNodeMaterialParameters + extends + Partial>, + MeshPhongMaterialParameters +{} + +/** + * Node material version of {@link MeshPhongMaterial}. + */ +declare class MeshPhongNodeMaterial extends NodeMaterial { + /** + * Constructs a new mesh lambert node material. + * + * @param {Object} [parameters] - The configuration parameter. + */ + constructor(parameters?: MeshPhongNodeMaterialParameters); + /** + * This flag can be used for type testing. + * + * @default true + */ + readonly isMeshPhongNodeMaterial: boolean; + setValues(values?: MeshPhongNodeMaterialParameters): void; + /** + * Overwritten since this type of material uses {@link BasicEnvironmentNode} + * to implement the default environment mapping. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {?BasicEnvironmentNode} The environment node. + */ + setupEnvironment(builder: NodeBuilder): BasicEnvironmentNode | null; + /** + * Setups the lighting model. + * + * @return {PhongLightingModel} The lighting model. + */ + setupLightingModel(): PhongLightingModel; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +interface MeshPhongNodeMaterial extends MeshPhongNodeMaterialNodeProperties, MeshPhongMaterialProperties {} + +export default MeshPhongNodeMaterial; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/MeshPhysicalNodeMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/MeshPhysicalNodeMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..aff931a92e688c394386639888415dc9bc5c2ff5 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/MeshPhysicalNodeMaterial.d.ts @@ -0,0 +1,269 @@ +import Node from "../../nodes/core/Node.js"; +import NodeBuilder from "../../nodes/core/NodeBuilder.js"; +import { MapColorPropertiesToColorRepresentations } from "../Material.js"; +import { MeshPhysicalMaterialParameters, MeshPhysicalMaterialProperties } from "../MeshPhysicalMaterial.js"; +import MeshStandardNodeMaterial, { MeshStandardNodeMaterialNodeProperties } from "./MeshStandardNodeMaterial.js"; + +export interface MeshPhysicalNodeMaterialNodeProperties extends MeshStandardNodeMaterialNodeProperties { + /** + * The clearcoat of physical materials is by default inferred from the `clearcoat` + * and `clearcoatMap` properties. This node property allows to overwrite the default + * and define the clearcoat with a node instead. + * + * If you don't want to overwrite the clearcoat but modify the existing + * value instead, use {@link materialClearcoat}. + * + * @default null + */ + clearcoatNode: Node | null; + /** + * The clearcoat roughness of physical materials is by default inferred from the `clearcoatRoughness` + * and `clearcoatRoughnessMap` properties. This node property allows to overwrite the default + * and define the clearcoat roughness with a node instead. + * + * If you don't want to overwrite the clearcoat roughness but modify the existing + * value instead, use {@link materialClearcoatRoughness}. + * + * @default null + */ + clearcoatRoughnessNode: Node | null; + /** + * The clearcoat normal of physical materials is by default inferred from the `clearcoatNormalMap` + * property. This node property allows to overwrite the default + * and define the clearcoat normal with a node instead. + * + * If you don't want to overwrite the clearcoat normal but modify the existing + * value instead, use {@link materialClearcoatNormal}. + * + * @default null + */ + clearcoatNormalNode: Node | null; + /** + * The sheen of physical materials is by default inferred from the `sheen`, `sheenColor` + * and `sheenColorMap` properties. This node property allows to overwrite the default + * and define the sheen with a node instead. + * + * If you don't want to overwrite the sheen but modify the existing + * value instead, use {@link materialSheen}. + * + * @default null + */ + sheenNode: Node | null; + /** + * The sheen roughness of physical materials is by default inferred from the `sheenRoughness` and + * `sheenRoughnessMap` properties. This node property allows to overwrite the default + * and define the sheen roughness with a node instead. + * + * If you don't want to overwrite the sheen roughness but modify the existing + * value instead, use {@link materialSheenRoughness}. + * + * @default null + */ + sheenRoughnessNode: Node | null; + /** + * The iridescence of physical materials is by default inferred from the `iridescence` + * property. This node property allows to overwrite the default + * and define the iridescence with a node instead. + * + * If you don't want to overwrite the iridescence but modify the existing + * value instead, use {@link materialIridescence}. + * + * @default null + */ + iridescenceNode: Node | null; + /** + * The iridescence IOR of physical materials is by default inferred from the `iridescenceIOR` + * property. This node property allows to overwrite the default + * and define the iridescence IOR with a node instead. + * + * If you don't want to overwrite the iridescence IOR but modify the existing + * value instead, use {@link materialIridescenceIOR}. + * + * @default null + */ + iridescenceIORNode: Node | null; + /** + * The iridescence thickness of physical materials is by default inferred from the `iridescenceThicknessRange` + * and `iridescenceThicknessMap` properties. This node property allows to overwrite the default + * and define the iridescence thickness with a node instead. + * + * If you don't want to overwrite the iridescence thickness but modify the existing + * value instead, use {@link materialIridescenceThickness}. + * + * @default null + */ + iridescenceThicknessNode: Node | null; + /** + * The specular intensity of physical materials is by default inferred from the `specularIntensity` + * and `specularIntensityMap` properties. This node property allows to overwrite the default + * and define the specular intensity with a node instead. + * + * If you don't want to overwrite the specular intensity but modify the existing + * value instead, use {@link materialSpecularIntensity}. + * + * @default null + */ + specularIntensityNode: Node | null; + /** + * The specular color of physical materials is by default inferred from the `specularColor` + * and `specularColorMap` properties. This node property allows to overwrite the default + * and define the specular color with a node instead. + * + * If you don't want to overwrite the specular color but modify the existing + * value instead, use {@link materialSpecularColor}. + * + * @default null + */ + specularColorNode: Node | null; + /** + * The ior of physical materials is by default inferred from the `ior` + * property. This node property allows to overwrite the default + * and define the ior with a node instead. + * + * If you don't want to overwrite the ior but modify the existing + * value instead, use {@link materialIOR}. + * + * @default null + */ + iorNode: Node | null; + /** + * The transmission of physical materials is by default inferred from the `transmission` and + * `transmissionMap` properties. This node property allows to overwrite the default + * and define the transmission with a node instead. + * + * If you don't want to overwrite the transmission but modify the existing + * value instead, use {@link materialTransmission}. + * + * @default null + */ + transmissionNode: Node | null; + /** + * The thickness of physical materials is by default inferred from the `thickness` and + * `thicknessMap` properties. This node property allows to overwrite the default + * and define the thickness with a node instead. + * + * If you don't want to overwrite the thickness but modify the existing + * value instead, use {@link materialThickness}. + * + * @default null + */ + thicknessNode: Node | null; + /** + * The attenuation distance of physical materials is by default inferred from the + * `attenuationDistance` property. This node property allows to overwrite the default + * and define the attenuation distance with a node instead. + * + * If you don't want to overwrite the attenuation distance but modify the existing + * value instead, use {@link materialAttenuationDistance}. + * + * @default null + */ + attenuationDistanceNode: Node | null; + /** + * The attenuation color of physical materials is by default inferred from the + * `attenuationColor` property. This node property allows to overwrite the default + * and define the attenuation color with a node instead. + * + * If you don't want to overwrite the attenuation color but modify the existing + * value instead, use {@link materialAttenuationColor}. + * + * @default null + */ + attenuationColorNode: Node | null; + /** + * The dispersion of physical materials is by default inferred from the + * `dispersion` property. This node property allows to overwrite the default + * and define the dispersion with a node instead. + * + * If you don't want to overwrite the dispersion but modify the existing + * value instead, use {@link materialDispersion}. + * + * @default null + */ + dispersionNode: Node | null; + /** + * The anisotropy of physical materials is by default inferred from the + * `anisotropy` property. This node property allows to overwrite the default + * and define the anisotropy with a node instead. + * + * If you don't want to overwrite the anisotropy but modify the existing + * value instead, use {@link materialAnisotropy}. + * + * @default null + */ + anisotropyNode: Node | null; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshPhysicalNodeMaterialParameters + extends + Partial>, + MeshPhysicalMaterialParameters +{} + +/** + * Node material version of {@link MeshPhysicalMaterial}. + */ +declare class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial { + constructor(parameters?: MeshPhysicalNodeMaterialParameters); + /** + * This flag can be used for type testing. + * + * @default true + */ + readonly isMeshPhysicalNodeMaterial: boolean; + setValues(values?: MeshPhysicalNodeMaterialParameters): void; + /** + * Whether the lighting model should use clearcoat or not. + * + * @default true + */ + get useClearcoat(): boolean; + /** + * Whether the lighting model should use iridescence or not. + * + * @default true + */ + get useIridescence(): boolean; + /** + * Whether the lighting model should use sheen or not. + * + * @default true + */ + get useSheen(): boolean; + /** + * Whether the lighting model should use anisotropy or not. + * + * @default true + */ + get useAnisotropy(): boolean; + /** + * Whether the lighting model should use transmission or not. + * + * @default true + */ + get useTransmission(): boolean; + /** + * Whether the lighting model should use dispersion or not. + * + * @default true + */ + get useDispersion(): boolean; + /** + * Setups the physical specific node variables. + * + * @param {NodeBuilder} builder - The current node builder. + */ + setupVariants(builder: NodeBuilder): void; + /** + * Setups the clearcoat normal node. + * + * @return {Node} The clearcoat normal. + */ + setupClearcoatNormal(): Node; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +interface MeshPhysicalNodeMaterial extends MeshPhysicalNodeMaterialNodeProperties, MeshPhysicalMaterialProperties {} + +export default MeshPhysicalNodeMaterial; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/MeshSSSNodeMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/MeshSSSNodeMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..45b86f3d98524232a14f21d02531495feccdb35f --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/MeshSSSNodeMaterial.d.ts @@ -0,0 +1,113 @@ +import InputNode from "../../nodes/core/InputNode.js"; +import { LightingModelDirectInput } from "../../nodes/core/LightingModel.js"; +import Node from "../../nodes/core/Node.js"; +import NodeBuilder from "../../nodes/core/NodeBuilder.js"; +import PhysicalLightingModel from "../../nodes/functions/PhysicalLightingModel.js"; +import { MapColorPropertiesToColorRepresentations } from "../Material.js"; +import { MeshPhysicalMaterialParameters, MeshPhysicalMaterialProperties } from "../MeshPhysicalMaterial.js"; +import MeshPhysicalNodeMaterial, { MeshPhysicalNodeMaterialNodeProperties } from "./MeshPhysicalNodeMaterial.js"; + +/** + * Represents the lighting model for {@link MeshSSSNodeMaterial}. + */ +declare class SSSLightingModel extends PhysicalLightingModel { + /** + * Constructs a new physical lighting model. + * + * @param {boolean} [clearcoat=false] - Whether clearcoat is supported or not. + * @param {boolean} [sheen=false] - Whether sheen is supported or not. + * @param {boolean} [iridescence=false] - Whether iridescence is supported or not. + * @param {boolean} [anisotropy=false] - Whether anisotropy is supported or not. + * @param {boolean} [transmission=false] - Whether transmission is supported or not. + * @param {boolean} [dispersion=false] - Whether dispersion is supported or not. + * @param {boolean} [sss=false] - Whether SSS is supported or not. + */ + constructor( + clearcoat?: boolean, + sheen?: boolean, + iridescence?: boolean, + anisotropy?: boolean, + transmission?: boolean, + dispersion?: boolean, + sss?: boolean, + ); + /** + * Whether the lighting model should use SSS or not. + * + * @default false + */ + useSSS: boolean; + /** + * Extends the default implementation with a SSS term. + * + * Reference: [Approximating Translucency for a Fast, Cheap and Convincing Subsurface Scattering Look]{@link https://colinbarrebrisebois.com/2011/03/07/gdc-2011-approximating-translucency-for-a-fast-cheap-and-convincing-subsurface-scattering-look/} + * + * @param {Object} input - The input data. + * @param {NodeBuilder} builder - The current node builder. + */ + direct(input: LightingModelDirectInput, builder: NodeBuilder): void; +} + +export interface MeshSSSNodeMaterialNodeProperties extends MeshPhysicalNodeMaterialNodeProperties { + /** + * Represents the thickness color. + * + * @default null + */ + thicknessColorNode: Node | null; + /** + * Represents the distortion factor. + */ + thicknessDistortionNode: InputNode; + /** + * Represents the thickness ambient factor. + */ + thicknessAmbientNode: InputNode; + /** + * Represents the thickness attenuation. + */ + thicknessAttenuationNode: InputNode; + /** + * Represents the thickness power. + */ + thicknessPowerNode: InputNode; + /** + * Represents the thickness scale. + */ + thicknessScaleNode: InputNode; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshSSSNodeMaterialParameters + extends + Partial>, + MeshPhysicalMaterialParameters +{} + +/** + * This node material is an experimental extension of {@link MeshPhysicalNodeMaterial} + * that implements a Subsurface scattering (SSS) term. + * + * @augments MeshPhysicalNodeMaterial + */ +declare class MeshSSSNodeMaterial extends MeshPhysicalNodeMaterial { + constructor(parameters?: MeshSSSNodeMaterialParameters); + setValues(values?: MeshSSSNodeMaterialParameters): void; + /** + * Whether the lighting model should use SSS or not. + * + * @default true + */ + get useSSS(): boolean; + /** + * Setups the lighting model. + * + * @return {SSSLightingModel} The lighting model. + */ + setupLightingModel(): SSSLightingModel; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +interface MeshSSSNodeMaterial extends MeshSSSNodeMaterialNodeProperties, MeshPhysicalMaterialProperties {} + +export default MeshSSSNodeMaterial; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/MeshStandardNodeMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/MeshStandardNodeMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..81e03bd86bcbd221fd5a41d08c5e42902e53ed0b --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/MeshStandardNodeMaterial.d.ts @@ -0,0 +1,93 @@ +import Node from "../../nodes/core/Node.js"; +import NodeBuilder from "../../nodes/core/NodeBuilder.js"; +import PhysicalLightingModel from "../../nodes/functions/PhysicalLightingModel.js"; +import EnvironmentNode from "../../nodes/lighting/EnvironmentNode.js"; +import { MapColorPropertiesToColorRepresentations } from "../Material.js"; +import { MeshStandardMaterialParameters, MeshStandardMaterialProperties } from "../MeshStandardMaterial.js"; +import NodeMaterial, { NodeMaterialNodeProperties } from "./NodeMaterial.js"; + +export interface MeshStandardNodeMaterialNodeProperties extends NodeMaterialNodeProperties { + /** + * The emissive color of standard materials is by default inferred from the `emissive`, + * `emissiveIntensity` and `emissiveMap` properties. This node property allows to + * overwrite the default and define the emissive color with a node instead. + * + * If you don't want to overwrite the emissive color but modify the existing + * value instead, use {@link materialEmissive}. + * + * @default null + */ + emissiveNode: Node | null; + /** + * The metalness of standard materials is by default inferred from the `metalness`, + * and `metalnessMap` properties. This node property allows to + * overwrite the default and define the metalness with a node instead. + * + * If you don't want to overwrite the metalness but modify the existing + * value instead, use {@link materialMetalness}. + * + * @default null + */ + metalnessNode: Node | null; + /** + * The roughness of standard materials is by default inferred from the `roughness`, + * and `roughnessMap` properties. This node property allows to + * overwrite the default and define the roughness with a node instead. + * + * If you don't want to overwrite the roughness but modify the existing + * value instead, use {@link materialRoughness}. + * + * @default null + */ + roughnessNode: Node | null; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshStandardNodeMaterialParameters + extends + Partial>, + MeshStandardMaterialParameters +{} + +/** + * Node material version of {@link MeshStandardMaterial}. + */ +declare class MeshStandardNodeMaterial extends NodeMaterial { + /** + * Constructs a new mesh standard node material. + * + * @param {Object} [parameters] - The configuration parameter. + */ + constructor(parameters?: MeshStandardNodeMaterialParameters); + /** + * This flag can be used for type testing. + * + * @default true + */ + readonly isMeshStandardNodeMaterial: boolean; + setValues(values?: MeshStandardNodeMaterialParameters): void; + /** + * Overwritten since this type of material uses {@link EnvironmentNode} + * to implement the PBR (PMREM based) environment mapping. Besides, the + * method honors `Scene.environment`. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {?EnvironmentNode} The environment node. + */ + setupEnvironment(builder: NodeBuilder): EnvironmentNode | null; + /** + * Setups the lighting model. + * + * @return {PhysicalLightingModel} The lighting model. + */ + setupLightingModel(): PhysicalLightingModel; + /** + * Setups the specular related node variables. + */ + setupSpecular(): void; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +interface MeshStandardNodeMaterial extends MeshStandardNodeMaterialNodeProperties, MeshStandardMaterialProperties {} + +export default MeshStandardNodeMaterial; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/MeshToonNodeMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/MeshToonNodeMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c5c013981af7cfaa88d3420f5421bb51e65516ad --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/MeshToonNodeMaterial.d.ts @@ -0,0 +1,49 @@ +import ToonLightingModel from "../../nodes/functions/ToonLightingModel.js"; +import { MapColorPropertiesToColorRepresentations } from "../Material.js"; +import { MeshToonMaterialParameters, MeshToonMaterialProperties } from "../MeshToonMaterial.js"; +import NodeMaterial, { NodeMaterialNodeProperties } from "./NodeMaterial.js"; + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshToonNodeMaterialNodeProperties extends NodeMaterialNodeProperties { +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MeshToonNodeMaterialParameters + extends + Partial>, + MeshToonMaterialParameters +{} + +/** + * Node material version of {@link MeshToonMaterial}. + * + * @augments NodeMaterial + */ +declare class MeshToonNodeMaterial extends NodeMaterial { + /** + * Constructs a new mesh toon node material. + * + * @param {Object} [parameters] - The configuration parameter. + */ + constructor(parameters?: MeshToonNodeMaterialParameters); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isMeshToonNodeMaterial: boolean; + setValues(values?: MeshToonNodeMaterialParameters): void; + /** + * Setups the lighting model. + * + * @return {ToonLightingModel} The lighting model. + */ + setupLightingModel(): ToonLightingModel; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +interface MeshToonNodeMaterial extends MeshToonNodeMaterialNodeProperties, MeshToonMaterialProperties {} + +export default MeshToonNodeMaterial; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/NodeMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/NodeMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..04e828d9da639e0567c5566208860828f843171d --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/NodeMaterial.d.ts @@ -0,0 +1,470 @@ +import ClippingNode from "../../nodes/accessors/ClippingNode.js"; +import LightingModel from "../../nodes/core/LightingModel.js"; +import MRTNode from "../../nodes/core/MRTNode.js"; +import Node from "../../nodes/core/Node.js"; +import NodeBuilder from "../../nodes/core/NodeBuilder.js"; +import LightsNode from "../../nodes/lighting/LightsNode.js"; +import { ShaderNodeObject } from "../../nodes/tsl/TSLCore.js"; +import { MapColorPropertiesToColorRepresentations, Material, MaterialParameters } from "../Material.js"; +import NodeMaterialObserver from "./manager/NodeMaterialObserver.js"; + +export interface NodeMaterialNodeProperties { + /** + * Whether this material is affected by fog or not. + * + * @default true + */ + fog: boolean; + /** + * Whether this material is affected by lights or not. + * + * @default false + */ + lights: boolean; + /** + * Whether this material uses hardware clipping or not. + * This property is managed by the engine and should not be + * modified by apps. + * + * @default false + */ + hardwareClipping: boolean; + /** + * Node materials which set their `lights` property to `true` + * are affected by all lights of the scene. Sometimes selective + * lighting is wanted which means only _some_ lights in the scene + * affect a material. This can be achieved by creating an instance + * of {@link LightsNode} with a list of selective + * lights and assign the node to this property. + * + * ```js + * const customLightsNode = lights( [ light1, light2 ] ); + * material.lightsNode = customLightsNode; + * ``` + * + * @default null + */ + lightsNode: LightsNode | null; + /** + * The environment of node materials can be defined by an environment + * map assigned to the `envMap` property or by `Scene.environment` + * if the node material is a PBR material. This node property allows to overwrite + * the default behavior and define the environment with a custom node. + * + * ```js + * material.envNode = pmremTexture( renderTarget.texture ); + * ``` + * + * @default null + */ + envNode: Node | null; + /** + * The lighting of node materials might be influenced by ambient occlusion. + * The default AO is inferred from an ambient occlusion map assigned to `aoMap` + * and the respective `aoMapIntensity`. This node property allows to overwrite + * the default and define the ambient occlusion with a custom node instead. + * + * If you don't want to overwrite the diffuse color but modify the existing + * values instead, use {@link materialAO}. + * + * @default null + */ + aoNode: Node | null; + /** + * The diffuse color of node materials is by default inferred from the + * `color` and `map` properties. This node property allows to overwrite the default + * and define the diffuse color with a node instead. + * + * ```js + * material.colorNode = color( 0xff0000 ); // define red color + * ``` + * + * If you don't want to overwrite the diffuse color but modify the existing + * values instead, use {@link materialColor}. + * + * ```js + * material.colorNode = materialColor.mul( color( 0xff0000 ) ); // give diffuse colors a red tint + * ``` + * + * @default null + */ + colorNode: Node | null; + /** + * The normals of node materials are by default inferred from the `normalMap`/`normalScale` + * or `bumpMap`/`bumpScale` properties. This node property allows to overwrite the default + * and define the normals with a node instead. + * + * If you don't want to overwrite the normals but modify the existing values instead, + * use {@link materialNormal}. + * + * @default null + */ + normalNode: Node | null; + /** + * The opacity of node materials is by default inferred from the `opacity` + * and `alphaMap` properties. This node property allows to overwrite the default + * and define the opacity with a node instead. + * + * If you don't want to overwrite the normals but modify the existing + * value instead, use {@link materialOpacity}. + * + * @default null + */ + opacityNode: Node | null; + /** + * This node can be used to implement a variety of filter-like effects. The idea is + * to store the current rendering into a texture e.g. via `viewportSharedTexture()`, use it + * to create an arbitrary effect and then assign the node composition to this property. + * Everything behind the object using this material will now be affected by a filter. + * + * ```js + * const material = new NodeMaterial() + * material.transparent = true; + * + * // everything behind the object will be monochromatic + * material.backdropNode = saturation( viewportSharedTexture().rgb, 0 ); + * ``` + * + * Backdrop computations are part of the lighting so only lit materials can use this property. + * + * @default null + */ + backdropNode: Node | null; + /** + * This node allows to modulate the influence of `backdropNode` to the outgoing light. + * + * @default null + */ + backdropAlphaNode: Node | null; + /** + * The alpha test of node materials is by default inferred from the `alphaTest` + * property. This node property allows to overwrite the default and define the + * alpha test with a node instead. + * + * If you don't want to overwrite the alpha test but modify the existing + * value instead, use {@link materialAlphaTest}. + * + * @default null + */ + alphaTestNode: Node | null; + /** + * Discards the fragment if the mask value is `false`. + * + * @default null + */ + maskNode: Node | null; + /** + * The local vertex positions are computed based on multiple factors like the + * attribute data, morphing or skinning. This node property allows to overwrite + * the default and define local vertex positions with nodes instead. + * + * If you don't want to overwrite the vertex positions but modify the existing + * values instead, use {@link positionLocal}. + * + * ```js + * material.positionNode = positionLocal.add( displace ); + * ``` + * + * @default null + */ + positionNode: Node | null; + /** + * This node property is intended for logic which modifies geometry data once or per animation step. + * Apps usually place such logic randomly in initialization routines or in the animation loop. + * `geometryNode` is intended as a dedicated API so there is an intended spot where geometry modifications + * can be implemented. + * + * The idea is to assign a `Fn` definition that holds the geometry modification logic. A typical example + * would be a GPU based particle system that provides a node material for usage on app level. The particle + * simulation would be implemented as compute shaders and managed inside a `Fn` function. This function is + * eventually assigned to `geometryNode`. + * + * @default null + */ + geometryNode: (() => Node) | null; + /** + * Allows to overwrite depth values in the fragment shader. + * + * @default null + */ + depthNode: Node | null; + /** + * Allows to overwrite the position used for shadow map rendering which + * is by default {@link positionWorld}, the vertex position + * in world space. + * + * @default null + */ + receivedShadowPositionNode: Node | null; + /** + * Allows to overwrite the geometry position used for shadow map projection which + * is by default {@link positionLocal}, the vertex position in local space. + * + * @default null + */ + castShadowPositionNode: Node | null; + /** + * This node can be used to influence how an object using this node material + * receive shadows. + * + * ```js + * const totalShadows = float( 1 ).toVar(); + * material.receivedShadowNode = Fn( ( [ shadow ] ) => { + * totalShadows.mulAssign( shadow ); + * //return float( 1 ); // bypass received shadows + * return shadow.mix( color( 0xff0000 ), 1 ); // modify shadow color + * } ); + * + * @default null + */ + receivedShadowNode: (() => Node) | null; + /** + * This node can be used to influence how an object using this node material + * casts shadows. To apply a color to shadows, you can simply do: + * + * ```js + * material.castShadowNode = vec4( 1, 0, 0, 1 ); + * ``` + * + * Which can be nice to fake colored shadows of semi-transparent objects. It + * is also common to use the property with `Fn` function so checks are performed + * per fragment. + * + * ```js + * materialCustomShadow.castShadowNode = Fn( () => { + * hash( vertexIndex ).greaterThan( 0.5 ).discard(); + * return materialColor; + * } )(); + * ``` + * + * @default null + */ + castShadowNode: Node | null; + /** + * This node can be used to define the final output of the material. + * + * TODO: Explain the differences to `fragmentNode`. + * + * @default null + */ + outputNode: Node | null; + /** + * MRT configuration is done on renderer or pass level. This node allows to + * overwrite what values are written into MRT targets on material level. This + * can be useful for implementing selective FX features that should only affect + * specific objects. + * + * @default null + */ + mrtNode: MRTNode | null; + /** + * This node property can be used if you need complete freedom in implementing + * the fragment shader. Assigning a node will replace the built-in material + * logic used in the fragment stage. + * + * @default null + */ + fragmentNode: Node | null; + /** + * This node property can be used if you need complete freedom in implementing + * the vertex shader. Assigning a node will replace the built-in material logic + * used in the vertex stage. + * + * @default null + */ + vertexNode: Node | null; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface NodeMaterialParameters + extends Partial>, MaterialParameters +{} + +/** + * Base class for all node materials. + */ +declare class NodeMaterial extends Material { + static get type(): string; + /** + * This flag can be used for type testing. + * + * @default true + */ + readonly isNodeMaterial: boolean; + setValues(values?: NodeMaterialParameters): void; + /** + * Builds this material with the given node builder. + * + * @param {NodeBuilder} builder - The current node builder. + */ + build(builder: NodeBuilder): void; + /** + * Setups a node material observer with the given builder. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {NodeMaterialObserver} The node material observer. + */ + setupObserver(builder: NodeBuilder): NodeMaterialObserver; + /** + * Setups the vertex and fragment stage of this node material. + * + * @param {NodeBuilder} builder - The current node builder. + */ + setup(builder: NodeBuilder): void; + /** + * Setups the clipping node. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {ClippingNode} The clipping node. + */ + setupClipping(builder: NodeBuilder): ClippingNode; + /** + * Setups the hardware clipping if available on the current device. + * + * @param {NodeBuilder} builder - The current node builder. + */ + setupHardwareClipping(builder: NodeBuilder): void; + /** + * Setups the depth of this material. + * + * @param {NodeBuilder} builder - The current node builder. + */ + setupDepth(builder: NodeBuilder): void; + /** + * Setups the position node in view space. This method exists + * so derived node materials can modify the implementation e.g. sprite materials. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {Node} The position in view space. + */ + setupPositionView(builder: NodeBuilder): Node; + /** + * Setups the position in clip space. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {Node} The position in view space. + */ + setupModelViewProjection(): Node; + /** + * Setups the logic for the vertex stage. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {Node} The position in clip space. + */ + setupVertex(builder: NodeBuilder): Node; + /** + * Setups the computation of the position in local space. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {Node} The position in local space. + */ + setupPosition(builder: NodeBuilder): Node; + /** + * Setups the computation of the material's diffuse color. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {BufferGeometry} geometry - The geometry. + */ + setupDiffuseColor(builder: NodeBuilder): void; + /** + * Abstract interface method that can be implemented by derived materials + * to setup material-specific node variables. + * + * @abstract + * @param {NodeBuilder} builder - The current node builder. + */ + setupVariants(builder: NodeBuilder): void; + /** + * Setups the outgoing light node variable + * + * @return {Node} The outgoing light node. + */ + setupOutgoingLight(): Node; + /** + * Setups the normal node from the material. + * + * @return {Node} The normal node. + */ + setupNormal(): ShaderNodeObject; + /** + * Setups the environment node from the material. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {Node} The environment node. + */ + setupEnvironment(builder: NodeBuilder): Node | null; + /** + * Setups the light map node from the material. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {Node} The light map node. + */ + setupLightMap(builder: NodeBuilder): Node; + /** + * Setups the lights node based on the scene, environment and material. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {LightsNode} The lights node. + */ + setupLights(builder: NodeBuilder): LightsNode; + /** + * This method should be implemented by most derived materials + * since it defines the material's lighting model. + * + * @abstract + * @param {NodeBuilder} builder - The current node builder. + * @return {LightingModel} The lighting model. + */ + setupLightingModel(): LightingModel; + /** + * Setups the outgoing light node. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {Node} The outgoing light node. + */ + setupLighting(builder: NodeBuilder): Node; + /** + * Setup the fog. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {Node} outputNode - The existing output node. + * @return {Node} The output node. + */ + setupFog(builder: NodeBuilder, outputNode: Node): Node; + /** + * Setups premultiplied alpha. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {Node} outputNode - The existing output node. + * @return {Node} The output node. + */ + setupPremultipliedAlpha(builder: NodeBuilder, outputNode: Node): Node; + /** + * Setups the output node. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {Node} outputNode - The existing output node. + * @return {Node} The output node. + */ + setupOutput(builder: NodeBuilder, outputNode: Node): Node; + /** + * Most classic material types have a node pendant e.g. for `MeshBasicMaterial` + * there is `MeshBasicNodeMaterial`. This utility method is intended for + * defining all material properties of the classic type in the node type. + * + * @param {Material} material - The material to copy properties with their values to this node material. + */ + setDefaultValues(material: Material): void; + /** + * Copies the properties of the given node material to this instance. + * + * @param {NodeMaterial} source - The material to copy. + * @return {NodeMaterial} A reference to this node material. + */ + copy(source: NodeMaterial): this; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +interface NodeMaterial extends NodeMaterialNodeProperties {} + +export default NodeMaterial; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/NodeMaterials.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/NodeMaterials.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f44527cc79380c64b1f175b971f12c8628442e71 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/NodeMaterials.d.ts @@ -0,0 +1,18 @@ +export { default as Line2NodeMaterial, Line2NodeMaterialParameters } from "./Line2NodeMaterial.js"; +export { default as LineBasicNodeMaterial, LineBasicNodeMaterialParameters } from "./LineBasicNodeMaterial.js"; +export { default as LineDashedNodeMaterial, LineDashedNodeMaterialParameters } from "./LineDashedNodeMaterial.js"; +export { default as NodeMaterialObserver } from "./manager/NodeMaterialObserver.js"; +export { default as MeshBasicNodeMaterial, MeshBasicNodeMaterialParameters } from "./MeshBasicNodeMaterial.js"; +export { default as MeshLambertNodeMaterial, MeshLambertNodeMaterialParameters } from "./MeshLambertNodeMaterial.js"; +export { default as MeshMatcapNodeMaterial, MeshMatcapNodeMaterialParameters } from "./MeshMatcapNodeMaterial.js"; +export { default as MeshNormalNodeMaterial, MeshNormalNodeMaterialParameters } from "./MeshNormalNodeMaterial.js"; +export { default as MeshPhongNodeMaterial, MeshPhongNodeMaterialParameters } from "./MeshPhongNodeMaterial.js"; +export { default as MeshPhysicalNodeMaterial, MeshPhysicalNodeMaterialParameters } from "./MeshPhysicalNodeMaterial.js"; +export { default as MeshSSSNodeMaterial, MeshSSSNodeMaterialParameters } from "./MeshSSSNodeMaterial.js"; +export { default as MeshStandardNodeMaterial, MeshStandardNodeMaterialParameters } from "./MeshStandardNodeMaterial.js"; +export { default as MeshToonNodeMaterial, MeshToonNodeMaterialParameters } from "./MeshToonNodeMaterial.js"; +export { default as NodeMaterial, NodeMaterialParameters } from "./NodeMaterial.js"; +export { default as PointsNodeMaterial, PointsNodeMaterialParameters } from "./PointsNodeMaterial.js"; +export { default as ShadowNodeMaterial, ShadowNodeMaterialParameters } from "./ShadowNodeMaterial.js"; +export { default as SpriteNodeMaterial, SpriteNodeMaterialParameters } from "./SpriteNodeMaterial.js"; +export { default as VolumeNodeMaterial, VolumeNodeMaterialParameters } from "./VolumeNodeMaterial.js"; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/PointsNodeMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/PointsNodeMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..15d6b4947ff7e0777ab5d02ff9c198adfb70c2eb --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/PointsNodeMaterial.d.ts @@ -0,0 +1,60 @@ +import Node from "../../nodes/core/Node.js"; +import { MapColorPropertiesToColorRepresentations } from "../Material.js"; +import { PointsMaterialParameters, PointsMaterialProperties } from "../PointsMaterial.js"; +import SpriteNodeMaterial, { SpriteNodeMaterialNodeProperties } from "./SpriteNodeMaterial.js"; + +export interface PointsNodeMaterialNodeProperties extends SpriteNodeMaterialNodeProperties { + /** + * This node property provides an additional way to set the point size. + * + * Note that WebGPU only supports point primitives with 1 pixel size. Consequently, + * this node has no effect when the material is used with {@link Points} and a WebGPU + * backend. If an application wants to render points with a size larger than 1 pixel, + * the material should be used with {@link Sprite} and instancing. + * + * @default null + */ + sizeNode: Node; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface PointsNodeMaterialParameters + extends + Partial>, + PointsMaterialParameters +{} + +/** + * Node material version of {@link PointsMaterial}. + * + * This material can be used in two ways: + * + * - By rendering point primitives with {@link Points}. Since WebGPU only supports point primitives + * with a pixel size of `1`, it's not possible to define a size. + * + * ```js + * const pointCloud = new THREE.Points( geometry, new THREE.PointsNodeMaterial() ); + * ``` + * + * - By rendering point primitives with {@link Sprites}. In this case, size is honored, + * see {@link PointsNodeMaterial#sizeNode}. + * + * ```js + * const instancedPoints = new THREE.Sprite( new THREE.PointsNodeMaterial( { positionNode: instancedBufferAttribute( positionAttribute ) } ) ); + * ``` + */ +declare class PointsNodeMaterial extends SpriteNodeMaterial { + constructor(parameters?: PointsNodeMaterialParameters); + /** + * This flag can be used for type testing. + * + * @default true + */ + readonly isPointsNodeMaterial: boolean; + setValues(values?: PointsNodeMaterialParameters): void; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +interface PointsNodeMaterial extends PointsNodeMaterialNodeProperties, PointsMaterialProperties {} + +export default PointsNodeMaterial; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/ShadowNodeMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/ShadowNodeMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c6f764840c5879fd1b167d2b56458c2e282f9ccf --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/ShadowNodeMaterial.d.ts @@ -0,0 +1,45 @@ +import ShadowMaskModel from "../../nodes/functions/ShadowMaskModel.js"; +import { MapColorPropertiesToColorRepresentations } from "../Material.js"; +import { ShadowMaterialParameters, ShadowMaterialProperties } from "../ShadowMaterial.js"; +import NodeMaterial, { NodeMaterialNodeProperties } from "./NodeMaterial.js"; + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface ShadowNodeMaterialNodeProperties extends NodeMaterialNodeProperties { +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface ShadowNodeMaterialParameters + extends + Partial>, + ShadowMaterialParameters +{} + +/** + * Node material version of {@link ShadowMaterial}. + */ +declare class ShadowNodeMaterial extends NodeMaterial { + /** + * Constructs a new shadow node material. + * + * @param {Object} [parameters] - The configuration parameter. + */ + constructor(parameters?: ShadowNodeMaterialParameters); + /** + * This flag can be used for type testing. + * + * @default true + */ + readonly isShadowNodeMaterial: boolean; + setValues(values?: ShadowNodeMaterialParameters): void; + /** + * Setups the lighting model. + * + * @return {ShadowMaskModel} The lighting model. + */ + setupLightingModel(): ShadowMaskModel; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +interface ShadowNodeMaterial extends ShadowNodeMaterialNodeProperties, ShadowMaterialProperties {} + +export default ShadowNodeMaterial; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/SpriteNodeMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/SpriteNodeMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5e1543b3c6c8518eb2187e94aec3c7d89c4bb6ea --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/SpriteNodeMaterial.d.ts @@ -0,0 +1,77 @@ +import Node from "../../nodes/core/Node.js"; +import NodeBuilder from "../../nodes/core/NodeBuilder.js"; +import { MapColorPropertiesToColorRepresentations } from "../Material.js"; +import { SpriteMaterialParameters, SpriteMaterialProperties } from "../SpriteMaterial.js"; +import NodeMaterial, { NodeMaterialNodeProperties } from "./NodeMaterial.js"; + +export interface SpriteNodeMaterialNodeProperties extends NodeMaterialNodeProperties { + /** + * The rotation of sprite materials is by default inferred from the `rotation`, + * property. This node property allows to overwrite the default and define + * the rotation with a node instead. + * + * If you don't want to overwrite the rotation but modify the existing + * value instead, use {@link materialRotation}. + * + * @default null + */ + rotationNode: Node | null; + /** + * This node property provides an additional way to scale sprites next to + * `Object3D.scale`. The scale transformation based in `Object3D.scale` + * is multiplied with the scale value of this node in the vertex shader. + * + * @default null + */ + scaleNode: Node | null; + set sizeAttenuation(value: boolean); + /** + * Whether to use size attenuation or not. + * + * @type {boolean} + * @default true + */ + get sizeAttenuation(): boolean; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface SpriteNodeMaterialParameters + extends + Partial>, + SpriteMaterialParameters +{} + +/** + * Node material version of {@link SpriteMaterial}. + */ +declare class SpriteNodeMaterial extends NodeMaterial { + /** + * Constructs a new sprite node material. + * + * @param {Object} [parameters] - The configuration parameter. + */ + constructor(parameters?: SpriteNodeMaterialParameters); + readonly isSpriteMaterial: boolean; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isSpriteNodeMaterial: boolean; + setValues(values?: SpriteNodeMaterialParameters): void; + /** + * Setups the position node in view space. This method implements + * the sprite specific vertex shader. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {Node} The position in view space. + */ + setupPositionView(builder: NodeBuilder): Node; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +interface SpriteNodeMaterial extends SpriteNodeMaterialNodeProperties, SpriteMaterialProperties {} + +export default SpriteNodeMaterial; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/VolumeNodeMaterial.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/VolumeNodeMaterial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b988fe8b72e714078dfc475521b773b4127c1850 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/VolumeNodeMaterial.d.ts @@ -0,0 +1,59 @@ +import Node from "../../nodes/core/Node.js"; +import VolumetricLightingModel from "../../nodes/functions/VolumetricLightingModel.js"; +import { ShaderNodeObject } from "../../nodes/tsl/TSLCore.js"; +import { MapColorPropertiesToColorRepresentations, MaterialParameters, MaterialProperties } from "../Material.js"; +import NodeMaterial, { NodeMaterialNodeProperties } from "./NodeMaterial.js"; + +export interface VolumeNodeMaterialNodeProperties extends NodeMaterialNodeProperties { + /** + * Number of steps used for raymarching. + * + * @default 25 + */ + steps: number; + /** + * Offsets the distance a ray has been traveled through a volume. + * Can be used to implement dithering to reduce banding. + * + * @default null + */ + offsetNode: Node; + /** + * Node used for scattering calculations. + * + * @default null + */ + scatteringNode: (params: { positionRay: ShaderNodeObject }) => Node | null; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface VolumeNodeMaterialParameters + extends Partial>, MaterialParameters +{} + +/** + * Volume node material. + * + * @augments NodeMaterial + */ +declare class VolumeNodeMaterial extends NodeMaterial { + /** + * Constructs a new volume node material. + * + * @param {Object} [parameters] - The configuration parameter. + */ + constructor(parameters?: VolumeNodeMaterialParameters); + /** + * This flag can be used for type testing. + * + * @default true + */ + readonly isVolumeNodeMaterial: boolean; + setValues(values?: VolumeNodeMaterialParameters): void; + setupLightingModel(): VolumetricLightingModel; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +interface VolumeNodeMaterial extends VolumeNodeMaterialNodeProperties, MaterialProperties {} + +export default VolumeNodeMaterial; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/manager/NodeMaterialObserver.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/manager/NodeMaterialObserver.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e95b24b215139a80bfc12bfdf38cbd9cb43c7792 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/materials/nodes/manager/NodeMaterialObserver.d.ts @@ -0,0 +1,186 @@ +import { BufferAttribute } from "../../../core/BufferAttribute.js"; +import { Light } from "../../../lights/Light.js"; +import { Matrix4 } from "../../../math/Matrix4.js"; +import NodeBuilder from "../../../nodes/core/NodeBuilder.js"; +import NodeFrame from "../../../nodes/core/NodeFrame.js"; +import LightsNode from "../../../nodes/lighting/LightsNode.js"; +import Renderer from "../../../renderers/common/Renderer.js"; +import RenderObject from "../../../renderers/common/RenderObject.js"; +import { Material } from "../../Material.js"; +declare const refreshUniforms: readonly [ + "alphaMap", + "alphaTest", + "anisotropy", + "anisotropyMap", + "anisotropyRotation", + "aoMap", + "aoMapIntensity", + "attenuationColor", + "attenuationDistance", + "bumpMap", + "clearcoat", + "clearcoatMap", + "clearcoatNormalMap", + "clearcoatNormalScale", + "clearcoatRoughness", + "color", + "dispersion", + "displacementMap", + "emissive", + "emissiveIntensity", + "emissiveMap", + "envMap", + "envMapIntensity", + "gradientMap", + "ior", + "iridescence", + "iridescenceIOR", + "iridescenceMap", + "iridescenceThicknessMap", + "lightMap", + "lightMapIntensity", + "map", + "matcap", + "metalness", + "metalnessMap", + "normalMap", + "normalScale", + "opacity", + "roughness", + "roughnessMap", + "sheen", + "sheenColor", + "sheenColorMap", + "sheenRoughnessMap", + "shininess", + "specular", + "specularColor", + "specularColorMap", + "specularIntensity", + "specularIntensityMap", + "specularMap", + "thickness", + "transmission", + "transmissionMap", +]; +type RefreshUniform = (typeof refreshUniforms)[number]; +type MaterialData = { + [K in RefreshUniform]?: unknown; +}; +interface AttributesData { + [name: string]: { + version: number; + }; +} +interface RenderObjectData { + material: MaterialData; + geometry: { + id: number; + attributes: AttributesData; + indexVersion: number | null; + drawRange: { + start: number; + count: number; + }; + }; + worldMatrix: Matrix4; + version?: number; +} +interface LightData { + map: number; +} +/** + * This class is used by {@link WebGPURenderer} as management component. + * It's primary purpose is to determine whether render objects require a + * refresh right before they are going to be rendered or not. + */ +declare class NodeMaterialObserver { + renderObjects: WeakMap; + hasNode: boolean; + hasAnimation: boolean; + refreshUniforms: readonly RefreshUniform[]; + renderId: number; + /** + * Constructs a new node material observer. + * + * @param {NodeBuilder} builder - The node builder. + */ + constructor(builder: NodeBuilder); + /** + * Returns `true` if the given render object is verified for the first time of this observer. + * + * @param {RenderObject} renderObject - The render object. + * @return {boolean} Whether the given render object is verified for the first time of this observer. + */ + firstInitialization(renderObject: RenderObject): boolean; + /** + * Returns `true` if the current rendering produces motion vectors. + * + * @param {Renderer} renderer - The renderer. + * @return {boolean} Whether the current rendering produces motion vectors or not. + */ + needsVelocity(renderer: Renderer): boolean; + /** + * Returns monitoring data for the given render object. + * + * @param {RenderObject} renderObject - The render object. + * @return {Object} The monitoring data. + */ + getRenderObjectData(renderObject: RenderObject): RenderObjectData; + /** + * Returns an attribute data structure holding the attributes versions for + * monitoring. + * + * @param {Object} attributes - The geometry attributes. + * @return {Object} An object for monitoring the versions of attributes. + */ + getAttributesData(attributes: Record): AttributesData; + /** + * Returns `true` if the node builder's material uses + * node properties. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {boolean} Whether the node builder's material uses node properties or not. + */ + containsNode(builder: NodeBuilder): boolean; + /** + * Returns a material data structure holding the material property values for + * monitoring. + * + * @param {Material} material - The material. + * @return {Object} An object for monitoring material properties. + */ + getMaterialData(material: Material): MaterialData; + /** + * Returns `true` if the given render object has not changed its state. + * + * @param {RenderObject} renderObject - The render object. + * @param {Array} lightsData - The current material lights. + * @return {boolean} Whether the given render object has changed its state or not. + */ + equals(renderObject: RenderObject, lightsData: Light[]): boolean; + /** + * Returns the lights data for the given material lights. + * + * @param {Array} materialLights - The material lights. + * @return {Array} The lights data for the given material lights. + */ + getLightsData(materialLights: Light[]): LightData[]; + /** + * Returns the lights for the given lights node and render ID. + * + * @param {LightsNode} lightsNode - The lights node. + * @param {number} renderId - The render ID. + * @return {Array} The lights for the given lights node and render ID. + */ + getLights(lightsNode: LightsNode, renderId: number): LightData[]; + /** + * Checks if the given render object requires a refresh. + * + * @param {RenderObject} renderObject - The render object. + * @param {NodeFrame} nodeFrame - The current node frame. + * @return {boolean} Whether the given render object requires a refresh or not. + */ + needsRefresh(renderObject: RenderObject, nodeFrame: NodeFrame): boolean; +} +export default NodeMaterialObserver; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/nodes/Nodes.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/Nodes.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..406cbdcb73933472d6f9f015df5b9ad6aaa6c6ee --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/Nodes.d.ts @@ -0,0 +1,158 @@ +// constants +export * from "./core/constants.js"; + +// core +export { default as ArrayNode } from "./core/ArrayNode.js"; +export { default as AssignNode } from "./core/AssignNode.js"; +export { default as AttributeNode } from "./core/AttributeNode.js"; +export { default as BypassNode } from "./core/BypassNode.js"; +export { default as CacheNode } from "./core/CacheNode.js"; +export { default as ConstNode } from "./core/ConstNode.js"; +export { default as ContextNode } from "./core/ContextNode.js"; +export { default as IndexNode, IndexNodeScope } from "./core/IndexNode.js"; +export { + default as LightingModel, + LightingModelDirectInput, + LightingModelDirectRectAreaInput, + LightingModelReflectedLight, +} from "./core/LightingModel.js"; +export { default as MRTNode } from "./core/MRTNode.js"; +export { default as Node, NodeJSONInputData, NodeJSONIntermediateOutputData } from "./core/Node.js"; +export { default as NodeAttribute } from "./core/NodeAttribute.js"; +export { + BuildStageOption, + default as NodeBuilder, + FlowData, + NodeBuilderContext, + NodeData, +} from "./core/NodeBuilder.js"; +export { default as NodeCache, ShaderStageNodeData } from "./core/NodeCache.js"; +export { default as NodeCode } from "./core/NodeCode.js"; +export { default as NodeFrame } from "./core/NodeFrame.js"; +export { default as NodeFunctionInput } from "./core/NodeFunctionInput.js"; +export { default as NodeUniform } from "./core/NodeUniform.js"; +export { default as NodeVar } from "./core/NodeVar.js"; +export { default as NodeVarying } from "./core/NodeVarying.js"; +export { default as OutputStructNode } from "./core/OutputStructNode.js"; +export { default as ParameterNode } from "./core/ParameterNode.js"; +export { default as PropertyNode } from "./core/PropertyNode.js"; +export { default as StackNode } from "./core/StackNode.js"; +export { default as StructNode } from "./core/StructNode.js"; +export { default as StructTypeNode } from "./core/StructTypeNode.js"; +export { default as SubBuildNode } from "./core/SubBuildNode.js"; +export { default as TempNode } from "./core/TempNode.js"; +export { default as UniformGroupNode } from "./core/UniformGroupNode.js"; +export { default as UniformNode } from "./core/UniformNode.js"; +export { default as VarNode } from "./core/VarNode.js"; +export { default as VaryingNode } from "./core/VaryingNode.js"; + +import * as NodeUtils from "./core/NodeUtils.js"; +export { NodeUtils }; + +// utils +export { default as ArrayElementNode } from "./utils/ArrayElementNode.js"; +export { default as ConvertNode } from "./utils/ConvertNode.js"; +export { default as DebugNode } from "./utils/DebugNode.js"; +export { default as EventNode } from "./utils/EventNode.js"; +export { default as FunctionOverloadingNode } from "./utils/FunctionOverloadingNode.js"; +export { default as JoinNode } from "./utils/JoinNode.js"; +export { default as LoopNode } from "./utils/LoopNode.js"; +export { default as MaxMipLevelNode } from "./utils/MaxMipLevelNode.js"; +export { default as MemberNode } from "./utils/MemberNode.js"; +export { default as ReflectorNode, ReflectorNodeParameters } from "./utils/ReflectorNode.js"; +export { default as RemapNode } from "./utils/RemapNode.js"; +export { default as RotateNode } from "./utils/RotateNode.js"; +export { default as RTTNode, RTTNodeOptions } from "./utils/RTTNode.js"; +export { default as SetNode } from "./utils/SetNode.js"; +export { default as SplitNode } from "./utils/SplitNode.js"; +export { default as SpriteSheetUVNode } from "./utils/SpriteSheetUVNode.js"; +export { default as StorageArrayElementNode } from "./utils/StorageArrayElementNode.js"; + +// math +export { default as BitcastNode } from "./math/BitcastNode.js"; + +// accessors +export { default as BatchNode } from "./accessors/BatchNode.js"; +export { default as BufferAttributeNode } from "./accessors/BufferAttributeNode.js"; +export { default as BufferNode } from "./accessors/BufferNode.js"; +export { default as CubeTextureNode } from "./accessors/CubeTextureNode.js"; +export { default as InstancedMeshNode } from "./accessors/InstancedMeshNode.js"; +export { default as InstanceNode } from "./accessors/InstanceNode.js"; +export { default as MaterialNode, MaterialNodeScope } from "./accessors/MaterialNode.js"; +export { default as MaterialReferenceNode } from "./accessors/MaterialReferenceNode.js"; +export { default as ModelNode } from "./accessors/ModelNode.js"; +export { default as MorphNode } from "./accessors/MorphNode.js"; +export { default as Object3DNode } from "./accessors/Object3DNode.js"; +export { default as PointUVNode } from "./accessors/PointUVNode.js"; +export { default as ReferenceNode } from "./accessors/ReferenceNode.js"; +export { default as RendererReferenceNode } from "./accessors/RendererReferenceNode.js"; +export { default as SceneNode, SceneNodeScope } from "./accessors/SceneNode.js"; +export { default as SkinningNode } from "./accessors/SkinningNode.js"; +export { default as StorageBufferNode } from "./accessors/StorageBufferNode.js"; +export { default as StorageTextureNode } from "./accessors/StorageTextureNode.js"; +export { default as Texture3DNode } from "./accessors/Texture3DNode.js"; +export { default as TextureNode } from "./accessors/TextureNode.js"; +export { default as TextureSizeNode } from "./accessors/TextureSizeNode.js"; +export { default as UniformArrayNode } from "./accessors/UniformArrayNode.js"; +export { default as UserDataNode, NodeUserData } from "./accessors/UserDataNode.js"; +export { default as VertexColorNode } from "./accessors/VertexColorNode.js"; + +// display +export { default as BumpMapNode } from "./display/BumpMapNode.js"; +export { default as ColorSpaceNode } from "./display/ColorSpaceNode.js"; +export { default as FrontFacingNode } from "./display/FrontFacingNode.js"; +export { default as NormalMapNode } from "./display/NormalMapNode.js"; +export { default as PassNode, PassNodeScope } from "./display/PassNode.js"; +export { default as PosterizeNode } from "./display/PosterizeNode.js"; +export { default as RenderOutputNode } from "./display/RenderOutputNode.js"; +export { default as ScreenNode, ScreenNodeScope } from "./display/ScreenNode.js"; +export { default as ToneMappingNode } from "./display/ToneMappingNode.js"; +export { default as ViewportDepthNode, ViewportDepthNodeScope } from "./display/ViewportDepthNode.js"; +export { default as ViewportDepthTextureNode } from "./display/ViewportDepthTextureNode.js"; +export { default as ViewportSharedTextureNode } from "./display/ViewportSharedTextureNode.js"; +export { default as ViewportTextureNode } from "./display/ViewportTextureNode.js"; + +// code +export { CodeNodeInclude, default as CodeNode } from "./code/CodeNode.js"; +export { default as ExpressionNode } from "./code/ExpressionNode.js"; +export { default as FunctionCallNode } from "./code/FunctionCallNode.js"; +export { default as FunctionNode } from "./code/FunctionNode.js"; +export { default as ScriptableNode } from "./code/ScriptableNode.js"; +export { default as ScriptableValueNode } from "./code/ScriptableValueNode.js"; + +// geometry +export { default as RangeNode } from "./geometry/RangeNode.js"; + +// gpgpu +export { default as ComputeNode } from "./gpgpu/ComputeNode.js"; + +// lighting +export { default as AmbientLightNode } from "./lighting/AmbientLightNode.js"; +export { default as AnalyticLightNode } from "./lighting/AnalyticLightNode.js"; +export { default as AONode } from "./lighting/AONode.js"; +export { default as BasicEnvironmentNode } from "./lighting/BasicEnvironmentNode.js"; +export { default as DirectionalLightNode } from "./lighting/DirectionalLightNode.js"; +export { default as EnvironmentNode } from "./lighting/EnvironmentNode.js"; +export { default as HemisphereLightNode } from "./lighting/HemisphereLightNode.js"; +export { default as IESSpotLightNode } from "./lighting/IESSpotLightNode.js"; +export { default as IrradianceNode } from "./lighting/IrradianceNode.js"; +export { default as LightingContextNode, LightingContext } from "./lighting/LightingContextNode.js"; +export { default as LightingNode } from "./lighting/LightingNode.js"; +export { default as LightProbeNode } from "./lighting/LightProbeNode.js"; +export { default as LightsNode } from "./lighting/LightsNode.js"; +export { default as PointLightNode } from "./lighting/PointLightNode.js"; +export { default as ProjectorLightNode } from "./lighting/ProjectorLightNode.js"; +export { default as RectAreaLightNode, RectAreaLightTexturesLib } from "./lighting/RectAreaLightNode.js"; +export { default as ShadowBaseNode } from "./lighting/ShadowBaseNode.js"; +export { default as ShadowNode } from "./lighting/ShadowNode.js"; +export { default as SpotLightNode } from "./lighting/SpotLightNode.js"; + +// pmrem +export { default as PMREMNode } from "./pmrem/PMREMNode.js"; + +// parsers +export { default as GLSLNodeParser } from "./parsers/GLSLNodeParser.js"; + +// lighting models +export { default as PhongLightingModel } from "./functions/PhongLightingModel.js"; +export { default as PhysicalLightingModel } from "./functions/PhysicalLightingModel.js"; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/nodes/TSL.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/TSL.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a5b55bc2e9bb82dde77c0b274f0dfa3367cf03a1 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/TSL.d.ts @@ -0,0 +1,173 @@ +// constants +export * from "./core/constants.js"; + +// core +export * from "./core/AssignNode.js"; +export * from "./core/AttributeNode.js"; +export * from "./core/BypassNode.js"; +export * from "./core/CacheNode.js"; +export * from "./core/ContextNode.js"; +export * from "./core/IndexNode.js"; +export * from "./core/MRTNode.js"; +export * from "./core/OutputStructNode.js"; +export * from "./core/ParameterNode.js"; +export * from "./core/PropertyNode.js"; +export * from "./core/StackNode.js"; +export * from "./core/StructNode.js"; +export * from "./core/UniformGroupNode.js"; +export * from "./core/UniformNode.js"; +export * from "./core/VaryingNode.js"; + +// math +export * from "./math/BitcastNode.js"; +export * from "./math/Hash.js"; +export * from "./math/MathUtils.js"; +export * from "./math/TriNoise3D.js"; + +// utils +export * from "./utils/EquirectUV.js"; +export * from "./utils/EventNode.js"; +export * from "./utils/FunctionOverloadingNode.js"; +export * from "./utils/LoopNode.js"; +export * from "./utils/MatcapUV.js"; +export * from "./utils/MaxMipLevelNode.js"; +export * from "./utils/Oscillators.js"; +export * from "./utils/Packing.js"; +export * from "./utils/PostProcessingUtils.js"; +export * from "./utils/ReflectorNode.js"; +export * from "./utils/RemapNode.js"; +export * from "./utils/RotateNode.js"; +export * from "./utils/RTTNode.js"; +export * from "./utils/SampleNode.js"; +export * from "./utils/SpriteSheetUVNode.js"; +export * from "./utils/SpriteUtils.js"; +export * from "./utils/Timer.js"; +export * from "./utils/TriplanarTextures.js"; +export * from "./utils/UVUtils.js"; +export * from "./utils/ViewportUtils.js"; + +// three.js shading language +export * from "./tsl/TSLBase.js"; + +// accessors +export * from "./accessors/AccessorsUtils.js"; +export * from "./accessors/Arrays.js"; +export * from "./accessors/BatchNode.js"; +export * from "./accessors/Bitangent.js"; +export * from "./accessors/BufferAttributeNode.js"; +export * from "./accessors/BufferNode.js"; +export * from "./accessors/BuiltinNode.js"; +export * from "./accessors/Camera.js"; +export * from "./accessors/CubeTextureNode.js"; +export * from "./accessors/InstancedMeshNode.js"; +export * from "./accessors/InstanceNode.js"; +export * from "./accessors/MaterialNode.js"; +export * from "./accessors/MaterialProperties.js"; +export * from "./accessors/MaterialReferenceNode.js"; +export * from "./accessors/ModelNode.js"; +export * from "./accessors/ModelViewProjectionNode.js"; +export * from "./accessors/MorphNode.js"; +export * from "./accessors/Normal.js"; +export * from "./accessors/Object3DNode.js"; +export * from "./accessors/PointUVNode.js"; +export * from "./accessors/Position.js"; +export * from "./accessors/ReferenceNode.js"; +export * from "./accessors/ReflectVector.js"; +export * from "./accessors/RendererReferenceNode.js"; +export * from "./accessors/SceneNode.js"; +export * from "./accessors/SkinningNode.js"; +export * from "./accessors/StorageBufferNode.js"; +export * from "./accessors/StorageTextureNode.js"; +export * from "./accessors/Tangent.js"; +export * from "./accessors/Texture3DNode.js"; +export * from "./accessors/TextureBicubic.js"; +export * from "./accessors/TextureNode.js"; +export * from "./accessors/TextureSizeNode.js"; +export * from "./accessors/UniformArrayNode.js"; +export * from "./accessors/UserDataNode.js"; +export * from "./accessors/UV.js"; +export * from "./accessors/VelocityNode.js"; +export * from "./accessors/VertexColorNode.js"; + +// display +export * from "./display/BlendModes.js"; +export * from "./display/BumpMapNode.js"; +export * from "./display/ColorAdjustment.js"; +export * from "./display/ColorSpaceNode.js"; +export * from "./display/FrontFacingNode.js"; +export * from "./display/NormalMapNode.js"; +export * from "./display/PosterizeNode.js"; +export * from "./display/RenderOutputNode.js"; +export * from "./display/ScreenNode.js"; +export * from "./display/ToneMappingNode.js"; +export * from "./display/ToonOutlinePassNode.js"; +export * from "./display/ViewportDepthNode.js"; +export * from "./display/ViewportDepthTextureNode.js"; +export * from "./display/ViewportSharedTextureNode.js"; +export * from "./display/ViewportTextureNode.js"; + +export * from "./display/PassNode.js"; + +export * from "./display/ColorSpaceFunctions.js"; +export * from "./display/ToneMappingFunctions.js"; + +// code +export * from "./code/CodeNode.js"; +export * from "./code/ExpressionNode.js"; +export * from "./code/FunctionCallNode.js"; +export * from "./code/FunctionNode.js"; +export * from "./code/ScriptableNode.js"; +export * from "./code/ScriptableValueNode.js"; + +// fog +export * from "./fog/Fog.js"; + +// geometry +export * from "./geometry/RangeNode.js"; + +// gpgpu +export * from "./gpgpu/AtomicFunctionNode.js"; +export * from "./gpgpu/BarrierNode.js"; +export * from "./gpgpu/ComputeBuiltinNode.js"; +export * from "./gpgpu/ComputeNode.js"; +export * from "./gpgpu/SubgroupFunctionNode.js"; +export * from "./gpgpu/WorkgroupInfoNode.js"; + +// lighting +export * from "./accessors/Lights.js"; +export * from "./lighting/LightingContextNode.js"; +export * from "./lighting/LightsNode.js"; +export * from "./lighting/PointLightNode.js"; +export * from "./lighting/PointShadowNode.js"; +export * from "./lighting/ShadowBaseNode.js"; +export * from "./lighting/ShadowFilterNode.js"; +export * from "./lighting/ShadowNode.js"; + +// pmrem +export * from "./pmrem/PMREMNode.js"; +export * from "./pmrem/PMREMUtils.js"; + +// procedural +export * from "./procedural/Checker.js"; + +// shapes +export * from "./shapes/Shapes.js"; + +// materialX +export * from "./materialx/MaterialXNodes.js"; + +// functions +export { default as BRDF_GGX } from "./functions/BSDF/BRDF_GGX.js"; +export { default as BRDF_Lambert } from "./functions/BSDF/BRDF_Lambert.js"; +export { default as D_GGX } from "./functions/BSDF/D_GGX.js"; +export { default as DFGApprox } from "./functions/BSDF/DFGApprox.js"; +export { default as F_Schlick } from "./functions/BSDF/F_Schlick.js"; +export { default as Schlick_to_F0 } from "./functions/BSDF/Schlick_to_F0.js"; +export { default as V_GGX_SmithCorrelated } from "./functions/BSDF/V_GGX_SmithCorrelated.js"; + +export * from "./lighting/LightUtils.js"; + +export { default as getGeometryRoughness } from "./functions/material/getGeometryRoughness.js"; +export { default as getParallaxCorrectNormal } from "./functions/material/getParallaxCorrectNormal.js"; +export { default as getRoughness } from "./functions/material/getRoughness.js"; +export { default as getShIrradianceAt } from "./functions/material/getShIrradianceAt.js"; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/ArrayNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/ArrayNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b33068b9214aaf8682535a734f29eb113fb01abd --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/ArrayNode.d.ts @@ -0,0 +1,26 @@ +import { ShaderNodeObject } from "../tsl/TSLCore.js"; +import Node from "./Node.js"; +import TempNode from "./TempNode.js"; + +declare class ArrayNode extends TempNode { + count: number; + values: Node[]; + readonly isArrayNode: true; + + constructor(nodeType: string, count: number, values: Node[]); +} + +export default ArrayNode; + +interface ArrayFunction { + (values: Node[]): ShaderNodeObject; + (nodeType: string, count: number): ShaderNodeObject; +} + +export const array: ArrayFunction; + +declare module "../tsl/TSLCore.js" { + interface NodeElements { + toArray: typeof array; + } +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/AssignNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/AssignNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..020672effcc0b3396907456b1d0f4c6897149b28 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/AssignNode.d.ts @@ -0,0 +1,22 @@ +import { ShaderNodeObject } from "../tsl/TSLCore.js"; +import Node from "./Node.js"; +import NodeBuilder from "./NodeBuilder.js"; +import TempNode from "./TempNode.js"; + +declare class AssignNode extends TempNode { + readonly isAssignNode: true; + + constructor(targetNode: Node, sourceNode: Node); + + needsSplitAssign(builder: NodeBuilder): boolean; +} + +export default AssignNode; + +export const assign: (targetNode: Node, sourceNode: Node | number) => ShaderNodeObject; + +declare module "../tsl/TSLCore.js" { + interface NodeElements { + assign: typeof assign; + } +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/ConstNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/ConstNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f866b0c0c8b45e2a087e4ece65abbae8e506fe14 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/ConstNode.d.ts @@ -0,0 +1,9 @@ +import InputNode from "./InputNode.js"; +import NodeBuilder from "./NodeBuilder.js"; + +export default class ConstNode extends InputNode { + isConstNode: true; + constructor(value: Value, nodeType?: string | null); + + generateConst(builder: NodeBuilder): string; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/IndexNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/IndexNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..081250058602c35472f54d3e34c9e41f51226870 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/IndexNode.d.ts @@ -0,0 +1,30 @@ +import { ShaderNodeObject } from "../tsl/TSLCore.js"; +import Node from "./Node.js"; + +export type IndexNodeScope = + | typeof IndexNode.VERTEX + | typeof IndexNode.INSTANCE + | typeof IndexNode.INVOCATION_LOCAL + | typeof IndexNode.DRAW; + +declare class IndexNode extends Node { + scope: IndexNodeScope; + + readonly isInstanceNode: true; + + constructor(scope: IndexNodeScope); + + static VERTEX: "vertex"; + static INSTANCE: "instance"; + static INVOCATION_LOCAL: "invocationLocal"; + static DRAW: "draw"; +} + +export default IndexNode; + +export const vertexIndex: ShaderNodeObject; +export const instanceIndex: ShaderNodeObject; +export const subgroupIndex: ShaderNodeObject; +export const invocationSubgroupIndex: ShaderNodeObject; +export const invocationLocalIndex: ShaderNodeObject; +export const drawIndex: ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/MRTNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/MRTNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ef223da73bee838cf7d2516c7db55d6d5c582d5b --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/MRTNode.d.ts @@ -0,0 +1,24 @@ +import { Texture } from "../../textures/Texture.js"; +import { Node } from "../Nodes.js"; +import { ShaderNodeObject } from "../tsl/TSLCore.js"; +import OutputStructNode from "./OutputStructNode.js"; + +export function getTextureIndex(textures: ReadonlyArray, name: string): number; + +declare class MRTNode extends OutputStructNode { + outputNodes: { [name: string]: Node }; + + readonly isMRTNode: true; + + constructor(outputNodes: { [name: string]: Node }); + + has(name: string): boolean; + + get(name: string): Node; + + merge(mrtNode: MRTNode): ShaderNodeObject; +} + +export default MRTNode; + +export const mrt: (outputNodes: { [name: string]: Node }) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/NodeUniform.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/NodeUniform.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..81804abef0d97ac4170701c622f77a685bd799ce --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/NodeUniform.d.ts @@ -0,0 +1,42 @@ +import UniformNode from "./UniformNode.js"; +/** + * {@link NodeBuilder} is going to create instances of this class during the build process + * of nodes. They represent the final shader uniforms that are going to be generated + * by the builder. A dictionary of node uniforms is maintained in {@link NodeBuilder#uniforms} + * for this purpose. + */ +declare class NodeUniform { + readonly isNodeUniform: true; + name: string; + type: string | null; + node: UniformNode; + needsUpdate: boolean | undefined; + /** + * Constructs a new node uniform. + * + * @param {string} name - The name of the uniform. + * @param {string} type - The type of the uniform. + * @param {UniformNode} node - An reference to the node. + */ + constructor(name: string, type: string | null, node: UniformNode); + /** + * The value of the uniform node. + * + * @type {any} + */ + get value(): TValue; + set value(val: TValue); + /** + * The id of the uniform node. + * + * @type {number} + */ + get id(): number; + /** + * The uniform node's group. + * + * @type {UniformGroupNode} + */ + get groupNode(): import("./UniformGroupNode.js").default; +} +export default NodeUniform; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/OutputStructNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/OutputStructNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5a7fc6e7bffb3c55ab976e830b05075cb355c7a1 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/OutputStructNode.d.ts @@ -0,0 +1,12 @@ +import { ShaderNodeObject } from "../tsl/TSLCore.js"; +import Node from "./Node.js"; + +export default class OutputStructNode extends Node { + members: Node[]; + + readonly isOutputStructNode: true; + + constructor(...members: Node[]); +} + +export const outputStruct: (...members: Node[]) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/PropertyNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/PropertyNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b365d107bfdff9e83c4f83115292fc8d823326e1 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/PropertyNode.d.ts @@ -0,0 +1,43 @@ +import { ShaderNodeObject } from "../tsl/TSLCore.js"; +import Node from "./Node.js"; + +export default class PropertyNode extends Node { + name: string | null; + varying: boolean; + + readonly isPropertyNode: true; + + constructor(nodeType?: string | null, name?: string | null, varying?: boolean); +} + +export const property: (type?: string | null, name?: string | null) => ShaderNodeObject; +export const varyingProperty: (type?: string | null, name?: string | null) => ShaderNodeObject; + +export const diffuseColor: ShaderNodeObject; +export const emissive: ShaderNodeObject; +export const roughness: ShaderNodeObject; +export const metalness: ShaderNodeObject; +export const clearcoat: ShaderNodeObject; +export const clearcoatRoughness: ShaderNodeObject; +export const sheen: ShaderNodeObject; +export const sheenRoughness: ShaderNodeObject; +export const iridescence: ShaderNodeObject; +export const iridescenceIOR: ShaderNodeObject; +export const iridescenceThickness: ShaderNodeObject; +export const alphaT: ShaderNodeObject; +export const anisotropy: ShaderNodeObject; +export const anisotropyT: ShaderNodeObject; +export const anisotropyB: ShaderNodeObject; +export const specularColor: ShaderNodeObject; +export const specularF90: ShaderNodeObject; +export const shininess: ShaderNodeObject; +export const output: ShaderNodeObject; +export const dashSize: ShaderNodeObject; +export const gapSize: ShaderNodeObject; +export const pointWidth: ShaderNodeObject; +export const ior: ShaderNodeObject; +export const transmission: ShaderNodeObject; +export const thickness: ShaderNodeObject; +export const attenuationDistance: ShaderNodeObject; +export const attenuationColor: ShaderNodeObject; +export const dispersion: ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/SubBuildNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/SubBuildNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..66fff27e463ba29d706e8c35c1caefc179ad9dca --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/SubBuildNode.d.ts @@ -0,0 +1,15 @@ +import { ShaderNodeObject } from "../tsl/TSLCore.js"; +import Node from "./Node.js"; + +declare class SubBuildNode extends Node { + node: Node; + name: string; + + readonly isSubBuildNode: true; + + constructor(node: Node, name: string, nodeType?: string | null); +} + +export default SubBuildNode; + +export const subBuild: (node: Node, name: string, type?: string | null) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/UniformGroupNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/UniformGroupNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..de80f2a4c7606f370664b5f6fd0fbfcfe6f3ad84 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/UniformGroupNode.d.ts @@ -0,0 +1,21 @@ +import Node from "./Node.js"; + +export default class UniformGroupNode extends Node { + name: string; + version: number; + + shared: boolean; + + readonly isUniformGroup: true; + + constructor(name: string, shared?: boolean); + + set needsUpdate(value: boolean); +} + +export const uniformGroup: (name: string) => UniformGroupNode; +export const sharedUniformGroup: (name: string) => UniformGroupNode; + +export const frameGroup: UniformGroupNode; +export const renderGroup: UniformGroupNode; +export const objectGroup: UniformGroupNode; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/VarNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/VarNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..58dd5f401f5dbb01a56cd24b9797ec044fb471ee --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/VarNode.d.ts @@ -0,0 +1,34 @@ +import { ShaderNodeObject } from "../tsl/TSLCore.js"; +import Node from "./Node.js"; + +declare class VarNode extends Node { + node: Node; + name: string | null; + + readonly isVarNode: true; + + readOnly: boolean; + + intent: boolean; + + constructor(node: Node, name?: string | null, readOnly?: boolean); + + setIntent(value: boolean): this; + getIntent(): boolean; +} + +export default VarNode; + +export const Var: (node: Node, name?: string | null) => ShaderNodeObject; + +export const Const: (node: Node, name?: string | null) => ShaderNodeObject; + +export const VarIntent: (node: Node) => Node; + +declare module "../tsl/TSLCore.js" { + interface NodeElements { + toVar: (node: Node, name?: string | null) => ShaderNodeObject; + toConst: (node: Node, name?: string | null) => ShaderNodeObject; + toVarIntent: (node: Node) => Node; + } +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/constants.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/constants.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..72c280b6fbddeb1797d95bd8d8784f85c66ea25f --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/core/constants.d.ts @@ -0,0 +1,67 @@ +/** + * Possible shader stages. + * + * @property {string} VERTEX The vertex shader stage. + * @property {string} FRAGMENT The fragment shader stage. + */ +export declare const NodeShaderStage: { + readonly VERTEX: "vertex"; + readonly FRAGMENT: "fragment"; +}; +/** + * Update types of a node. + * + * @property {string} NONE The update method is not executed. + * @property {string} FRAME The update method is executed per frame. + * @property {string} RENDER The update method is executed per render. A frame might be produced by multiple render calls so this value allows more detailed updates than FRAME. + * @property {string} OBJECT The update method is executed per {@link Object3D} that uses the node for rendering. + */ +export declare const NodeUpdateType: { + readonly NONE: "none"; + readonly FRAME: "frame"; + readonly RENDER: "render"; + readonly OBJECT: "object"; +}; +/** + * Data types of a node. + * + * @property {string} BOOLEAN Boolean type. + * @property {string} INTEGER Integer type. + * @property {string} FLOAT Float type. + * @property {string} VECTOR2 Two-dimensional vector type. + * @property {string} VECTOR3 Three-dimensional vector type. + * @property {string} VECTOR4 Four-dimensional vector type. + * @property {string} MATRIX2 2x2 matrix type. + * @property {string} MATRIX3 3x3 matrix type. + * @property {string} MATRIX4 4x4 matrix type. + */ +export declare const NodeType: { + readonly BOOLEAN: "bool"; + readonly INTEGER: "int"; + readonly FLOAT: "float"; + readonly VECTOR2: "vec2"; + readonly VECTOR3: "vec3"; + readonly VECTOR4: "vec4"; + readonly MATRIX2: "mat2"; + readonly MATRIX3: "mat3"; + readonly MATRIX4: "mat4"; +}; +/** + * Access types of a node. These are relevant for compute and storage usage. + * + * @property {string} READ_ONLY Read-only access + * @property {string} WRITE_ONLY Write-only access. + * @property {string} READ_WRITE Read and write access. + */ +export declare const NodeAccess: { + readonly READ_ONLY: "readOnly"; + readonly WRITE_ONLY: "writeOnly"; + readonly READ_WRITE: "readWrite"; +}; +export type NodeShaderStage = "vertex" | "fragment" | "compute"; +export type NodeUpdateType = "none" | "frame" | "render" | "object"; +export type NodeAccess = "readOnly" | "writeOnly" | "readWrite"; +export declare const defaultShaderStages: NodeShaderStage[]; +export declare const defaultBuildStages: string[]; +export declare const shaderStages: NodeShaderStage[]; +export declare const vectorComponents: string[]; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/nodes/gpgpu/AtomicFunctionNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/gpgpu/AtomicFunctionNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..27f7f30fafc7847db6618f7357a222059e0419a0 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/gpgpu/AtomicFunctionNode.d.ts @@ -0,0 +1,82 @@ +import Node from "../core/Node.js"; +import { ShaderNodeObject } from "../tsl/TSLCore.js"; + +export type AtomicMethod = + | typeof AtomicFunctionNode.ATOMIC_LOAD + | typeof AtomicFunctionNode.ATOMIC_STORE + | typeof AtomicFunctionNode.ATOMIC_ADD + | typeof AtomicFunctionNode.ATOMIC_SUB + | typeof AtomicFunctionNode.ATOMIC_MAX + | typeof AtomicFunctionNode.ATOMIC_MIN + | typeof AtomicFunctionNode.ATOMIC_AND + | typeof AtomicFunctionNode.ATOMIC_OR + | typeof AtomicFunctionNode.ATOMIC_XOR; + +declare class AtomicFunctionNode extends Node { + method: AtomicMethod; + pointerNode: Node; + valueNode: Node; + parents: boolean; + + constructor(method: AtomicMethod, pointerNode: Node, valueNode: Node); + + static ATOMIC_LOAD: "atomicLoad"; + static ATOMIC_STORE: "atomicStore"; + static ATOMIC_ADD: "atomicAdd"; + static ATOMIC_SUB: "atomicSub"; + static ATOMIC_MAX: "atomicMax"; + static ATOMIC_MIN: "atomicMin"; + static ATOMIC_AND: "atomicAnd"; + static ATOMIC_OR: "atomicOr"; + static ATOMIC_XOR: "atomicXor"; +} + +export const atomicFunc: ( + method: AtomicMethod, + pointerNode: Node, + valueNode: Node, +) => ShaderNodeObject; + +export const atomicLoad: ( + pointerNode: Node, +) => ShaderNodeObject; + +export const atomicStore: ( + pointerNode: Node, + valueNode: Node | number, +) => ShaderNodeObject; + +export const atomicAdd: ( + pointerNode: Node, + valueNode: Node | number, +) => ShaderNodeObject; + +export const atomicSub: ( + pointerNode: Node, + valueNode: Node | number, +) => ShaderNodeObject; + +export const atomicMax: ( + pointerNode: Node, + valueNode: Node, +) => ShaderNodeObject; + +export const atomicMin: ( + pointerNode: Node, + valueNode: Node, +) => ShaderNodeObject; + +export const atomicAnd: ( + pointerNode: Node, + valueNode: Node, +) => ShaderNodeObject; + +export const atomicOr: ( + pointerNode: Node, + valueNode: Node, +) => ShaderNodeObject; + +export const atomicXor: ( + pointerNode: Node, + valueNode: Node, +) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/nodes/gpgpu/BarrierNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/gpgpu/BarrierNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5abf23f90a6ec7378f81fc64842cb6b40aa89ca8 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/gpgpu/BarrierNode.d.ts @@ -0,0 +1,12 @@ +import Node from "../core/Node.js"; +import { ShaderNodeObject } from "../tsl/TSLCore.js"; + +declare class BarrierNode extends Node { + scope: string; + + constructor(scope: string); +} + +export const workgroupBarrier: () => ShaderNodeObject; +export const storageBarrier: () => ShaderNodeObject; +export const textureBarrier: () => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/nodes/gpgpu/ComputeBuiltinNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/gpgpu/ComputeBuiltinNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..50884f665118c895879d02ee98b1d7fdd210da60 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/gpgpu/ComputeBuiltinNode.d.ts @@ -0,0 +1,14 @@ +import Node from "../core/Node.js"; +import { ShaderNodeObject } from "../tsl/TSLCore.js"; + +declare class ComputeBuiltinNode extends Node { + constructor(builtinName: string, nodeType: string); +} + +export default ComputeBuiltinNode; + +export const numWorkgroups: ShaderNodeObject; +export const workgroupId: ShaderNodeObject; +export const globalId: ShaderNodeObject; +export const localId: ShaderNodeObject; +export const subgroupSize: ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/nodes/gpgpu/ComputeNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/gpgpu/ComputeNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8b85d1f225ec8c921547414ff6a0e922323e45bb --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/gpgpu/ComputeNode.d.ts @@ -0,0 +1,43 @@ +import Renderer from "../../renderers/common/Renderer.js"; +import Node from "../core/Node.js"; +import { ShaderNodeObject } from "../tsl/TSLCore.js"; + +export default class ComputeNode extends Node { + readonly isComputeNode: true; + + computeNode: Node; + workgroupSize: number[]; + count: number | null; + name: string; + + onInitFunction: ((args: { renderer: Renderer }) => void) | null; + + constructor(computeNode: Node, workgroupSize: number[]); + + setCount(count: number): this; + getCount(): number | null; + + setName(name: string): this; + + /** + * @deprecated "label()" has been deprecated. Use "setName()" instead. + */ + label(name: string): this; + + onInit(callback: ((args: { renderer: Renderer }) => void) | null): void; +} + +export const computeKernel: (node: Node, workgroupSize?: number[]) => ShaderNodeObject; + +export const compute: ( + node: Node, + count: number, + workgroupSize?: number[], +) => ShaderNodeObject; + +declare module "../tsl/TSLCore.js" { + interface NodeElements { + compute: typeof compute; + computeKernel: typeof computeKernel; + } +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/nodes/gpgpu/SubgroupFunctionNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/gpgpu/SubgroupFunctionNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e32de328ac40e8b13ece89ccff425387f3e62a75 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/gpgpu/SubgroupFunctionNode.d.ts @@ -0,0 +1,100 @@ +import Node from "../core/Node.js"; +import TempNode from "../core/TempNode.js"; +import { ShaderNodeObject } from "../tsl/TSLCore.js"; + +export type SubgroupFunctionNodeMethod0 = typeof SubgroupFunctionNode.SUBGROUP_ELECT; + +export type SubgroupFunctionNodeMethod1 = + | typeof SubgroupFunctionNode.SUBGROUP_BALLOT + | typeof SubgroupFunctionNode.SUBGROUP_ADD + | typeof SubgroupFunctionNode.SUBGROUP_INCLUSIVE_ADD + | typeof SubgroupFunctionNode.SUBGROUP_EXCLUSIVE_AND + | typeof SubgroupFunctionNode.SUBGROUP_MUL + | typeof SubgroupFunctionNode.SUBGROUP_INCLUSIVE_MUL + | typeof SubgroupFunctionNode.SUBGROUP_EXCLUSIVE_MUL + | typeof SubgroupFunctionNode.SUBGROUP_AND + | typeof SubgroupFunctionNode.SUBGROUP_OR + | typeof SubgroupFunctionNode.SUBGROUP_XOR + | typeof SubgroupFunctionNode.SUBGROUP_MIN + | typeof SubgroupFunctionNode.SUBGROUP_MAX + | typeof SubgroupFunctionNode.SUBGROUP_ALL + | typeof SubgroupFunctionNode.SUBGROUP_ANY + | typeof SubgroupFunctionNode.SUBGROUP_BROADCAST_FIRST + | typeof SubgroupFunctionNode.QUAD_SWAP_X + | typeof SubgroupFunctionNode.QUAD_SWAP_Y + | typeof SubgroupFunctionNode.QUAD_SWAP_DIAGONAL; + +export type SubgroupFunctionNodeMethod2 = + | typeof SubgroupFunctionNode.SUBGROUP_BROADCAST + | typeof SubgroupFunctionNode.SUBGROUP_SHUFFLE + | typeof SubgroupFunctionNode.SUBGROUP_SHUFFLE_XOR + | typeof SubgroupFunctionNode.SUBGROUP_SHUFFLE_UP + | typeof SubgroupFunctionNode.SUBGROUP_SHUFFLE_DOWN + | typeof SubgroupFunctionNode.QUAD_BROADCAST; + +declare class SubgroupFunctionNode extends TempNode { + constructor(method: SubgroupFunctionNodeMethod0); + constructor(method: SubgroupFunctionNodeMethod1, aNode: Node); + constructor(method: SubgroupFunctionNodeMethod2, aNode: Node, bNode: Node); + + // 0 inputs + static SUBGROUP_ELECT: "subgroupElect"; + + // 1 input + static SUBGROUP_BALLOT: "subgroupBallot"; + static SUBGROUP_ADD: "subgroupAdd"; + static SUBGROUP_INCLUSIVE_ADD: "subgroupInclusiveAdd"; + static SUBGROUP_EXCLUSIVE_AND: "subgroupExclusiveAdd"; + static SUBGROUP_MUL: "subgroupMul"; + static SUBGROUP_INCLUSIVE_MUL: "subgroupInclusiveMul"; + static SUBGROUP_EXCLUSIVE_MUL: "subgroupExclusiveMul"; + static SUBGROUP_AND: "subgroupAnd"; + static SUBGROUP_OR: "subgroupOr"; + static SUBGROUP_XOR: "subgroupXor"; + static SUBGROUP_MIN: "subgroupMin"; + static SUBGROUP_MAX: "subgroupMax"; + static SUBGROUP_ALL: "subgroupAll"; + static SUBGROUP_ANY: "subgroupAny"; + static SUBGROUP_BROADCAST_FIRST: "subgroupBroadcastFirst"; + static QUAD_SWAP_X: "quadSwapX"; + static QUAD_SWAP_Y: "quadSwapY"; + static QUAD_SWAP_DIAGONAL: "quadSwapDiagonal"; + + // 2 inputs + static SUBGROUP_BROADCAST: "subgroupBroadcast"; + static SUBGROUP_SHUFFLE: "subgroupShuffle"; + static SUBGROUP_SHUFFLE_XOR: "subgroupShuffleXor"; + static SUBGROUP_SHUFFLE_UP: "subgroupShuffleUp"; + static SUBGROUP_SHUFFLE_DOWN: "subgroupShuffleDown"; + static QUAD_BROADCAST: "quadBroadcast"; +} + +export default SubgroupFunctionNode; + +export const subgroupElect: () => ShaderNodeObject; + +export const subgroupBallot: (pred: Node) => ShaderNodeObject; +export const subgroupAdd: (e: Node) => ShaderNodeObject; +export const subgroupInclusiveAdd: (e: Node) => ShaderNodeObject; +export const subgroupExclusiveAdd: (e: Node) => ShaderNodeObject; +export const subgroupMul: (e: Node) => ShaderNodeObject; +export const subgroupInclusiveMul: (e: Node) => ShaderNodeObject; +export const subgroupExclusiveMul: (e: Node) => ShaderNodeObject; +export const subgroupAnd: (e: Node) => ShaderNodeObject; +export const subgroupOr: (e: Node) => ShaderNodeObject; +export const subgroupXor: (e: Node) => ShaderNodeObject; +export const subgroupMin: (e: Node) => ShaderNodeObject; +export const subgroupMax: (e: Node) => ShaderNodeObject; +export const subgroupAll: () => ShaderNodeObject; +export const subgroupAny: () => ShaderNodeObject; +export const subgroupBroadcastFirst: (e: Node, id: Node) => ShaderNodeObject; +export const quadSwapX: (e: Node) => ShaderNodeObject; +export const quadSwapY: (e: Node) => ShaderNodeObject; +export const quadSwapDiagonal: (e: Node) => ShaderNodeObject; + +export const subgroupBroadcast: (e: Node, id: Node) => ShaderNodeObject; +export const subgroupShuffle: (v: Node, id: Node) => ShaderNodeObject; +export const subgroupShuffleXor: (v: Node, mask: Node) => ShaderNodeObject; +export const subgroupShuffleUp: (v: Node, delta: Node) => ShaderNodeObject; +export const subgroupShuffleDown: (v: Node, delta: Node) => ShaderNodeObject; +export const quadBroadcast: (e: Node) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/nodes/gpgpu/WorkgroupInfoNode.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/gpgpu/WorkgroupInfoNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d43135ae815a4ec4a886cec64e5ea6b5e1404760 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/gpgpu/WorkgroupInfoNode.d.ts @@ -0,0 +1,19 @@ +import Node from "../core/Node.js"; +import { ShaderNodeObject } from "../tsl/TSLCore.js"; + +declare class WorkgroupInfoNode extends Node { + bufferType: string; + bufferCount: number; + + readonly isWorkgroupInfoNode: true; + + elementType: string; + + scope: string; + + constructor(scope: string, bufferType: string, bufferCount?: number); +} + +export default WorkgroupInfoNode; + +export const workgroupArray: (type: string, count?: number) => ShaderNodeObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/nodes/parsers/GLSLNodeFunction.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/parsers/GLSLNodeFunction.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ec2396423089b156879204fb30d17079d86e07f3 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/parsers/GLSLNodeFunction.d.ts @@ -0,0 +1,9 @@ +import NodeFunction from "../core/NodeFunction.js"; + +declare class GLSLNodeFunction extends NodeFunction { + constructor(source: string); + + getCode(name?: string): string; +} + +export default GLSLNodeFunction; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/nodes/parsers/GLSLNodeParser.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/parsers/GLSLNodeParser.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f6b663d4b9bd2c5feb7a90dd1d6440335d61e8cd --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/nodes/parsers/GLSLNodeParser.d.ts @@ -0,0 +1,8 @@ +import NodeParser from "../core/NodeParser.js"; +import GLSLNodeFunction from "./GLSLNodeFunction.js"; + +declare class GLSLNodeParser extends NodeParser { + parseFunction(source: string): GLSLNodeFunction; +} + +export default GLSLNodeParser; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/WebGL3DRenderTarget.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/WebGL3DRenderTarget.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..420caa97ee23e80bf3930d246fe2efc62aa62379 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/WebGL3DRenderTarget.d.ts @@ -0,0 +1,29 @@ +import { RenderTargetOptions } from "../core/RenderTarget.js"; +import { Data3DTexture } from "../textures/Data3DTexture.js"; +import { WebGLRenderTarget } from "./WebGLRenderTarget.js"; + +/** + * Represents a three-dimensional render target. + */ +export class WebGL3DRenderTarget extends WebGLRenderTarget { + /** + * Creates a new WebGL3DRenderTarget. + * + * @param width the width of the render target, in pixels. Default is `1`. + * @param height the height of the render target, in pixels. Default is `1`. + * @param depth the depth of the render target. Default is `1`. + * @param options optional object that holds texture parameters for an auto-generated target texture and + * depthBuffer/stencilBuffer booleans. See {@link WebGLRenderTarget} for details. + */ + constructor(width?: number, height?: number, depth?: number, options?: RenderTargetOptions); + + textures: Data3DTexture[]; + + /** + * The texture property is overwritten with an instance of {@link Data3DTexture}. + */ + get texture(): Data3DTexture; + set texture(value: Data3DTexture); + + readonly isWebGL3DRenderTarget: true; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/WebGLArrayRenderTarget.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/WebGLArrayRenderTarget.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1ac617889cfe1c39ce22b3499a14a10f4d668ede --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/WebGLArrayRenderTarget.d.ts @@ -0,0 +1,29 @@ +import { RenderTargetOptions } from "../core/RenderTarget.js"; +import { DataArrayTexture } from "../textures/DataArrayTexture.js"; +import { WebGLRenderTarget } from "./WebGLRenderTarget.js"; + +/** + * This type of render target represents an array of textures. + */ +export class WebGLArrayRenderTarget extends WebGLRenderTarget { + /** + * Creates a new WebGLArrayRenderTarget. + * + * @param width the width of the render target, in pixels. Default is `1`. + * @param height the height of the render target, in pixels. Default is `1`. + * @param depth the depth/layer count of the render target. Default is `1`. + * @param options optional object that holds texture parameters for an auto-generated target texture and + * depthBuffer/stencilBuffer booleans. See {@link WebGLRenderTarget} for details. + */ + constructor(width?: number, height?: number, depth?: number, options?: RenderTargetOptions); + + textures: DataArrayTexture[]; + + /** + * The texture property is overwritten with an instance of {@link DataArrayTexture}. + */ + get texture(): DataArrayTexture; + set texture(value: DataArrayTexture); + + readonly isWebGLArrayRenderTarget: true; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/WebGLCubeRenderTarget.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/WebGLCubeRenderTarget.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c390adb67c523f7dc0425cc3235eddce2ddf6914 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/WebGLCubeRenderTarget.d.ts @@ -0,0 +1,18 @@ +import { RenderTargetOptions } from "../core/RenderTarget.js"; +import { CubeTexture } from "../textures/CubeTexture.js"; +import { Texture } from "../textures/Texture.js"; +import { WebGLRenderer } from "./WebGLRenderer.js"; +import { WebGLRenderTarget } from "./WebGLRenderTarget.js"; + +export class WebGLCubeRenderTarget extends WebGLRenderTarget { + constructor(size?: number, options?: RenderTargetOptions); + + textures: CubeTexture[]; + + get texture(): CubeTexture; + set texture(value: CubeTexture); + + fromEquirectangularTexture(renderer: WebGLRenderer, texture: Texture): this; + + clear(renderer: WebGLRenderer, color: boolean, depth: boolean, stencil: boolean): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/WebGLRenderTarget.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/WebGLRenderTarget.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fdff12e78dab08cd7b31b3b748dfa439262b720a --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/WebGLRenderTarget.d.ts @@ -0,0 +1,8 @@ +import { RenderTarget, RenderTargetOptions } from "../core/RenderTarget.js"; +import { Texture } from "../textures/Texture.js"; + +export class WebGLRenderTarget extends RenderTarget { + constructor(width?: number, height?: number, options?: RenderTargetOptions); + + readonly isWebGLRenderTarget: true; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/WebGLRenderer.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/WebGLRenderer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ef7b5e3180f6754191d894010f72413c83f1fbe2 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/WebGLRenderer.d.ts @@ -0,0 +1,540 @@ +import { Camera } from "../cameras/Camera.js"; +import { CullFace, ShadowMapType, ToneMapping, WebGLCoordinateSystem } from "../constants.js"; +import { TypedArray } from "../core/BufferAttribute.js"; +import { BufferGeometry } from "../core/BufferGeometry.js"; +import { Object3D } from "../core/Object3D.js"; +import { Material } from "../materials/Material.js"; +import { Box2 } from "../math/Box2.js"; +import { Box3 } from "../math/Box3.js"; +import { Color, ColorRepresentation } from "../math/Color.js"; +import { Plane } from "../math/Plane.js"; +import { Vector2 } from "../math/Vector2.js"; +import { Vector3 } from "../math/Vector3.js"; +import { Vector4 } from "../math/Vector4.js"; +import { Scene } from "../scenes/Scene.js"; +import { OffscreenCanvas, Texture } from "../textures/Texture.js"; +import { WebGLCapabilities, WebGLCapabilitiesParameters } from "./webgl/WebGLCapabilities.js"; +import { WebGLExtensions } from "./webgl/WebGLExtensions.js"; +import { WebGLInfo } from "./webgl/WebGLInfo.js"; +import { WebGLProgram } from "./webgl/WebGLProgram.js"; +import { WebGLProperties } from "./webgl/WebGLProperties.js"; +import { WebGLRenderLists } from "./webgl/WebGLRenderLists.js"; +import { WebGLShadowMap } from "./webgl/WebGLShadowMap.js"; +import { WebGLState } from "./webgl/WebGLState.js"; +import { WebGLRenderTarget } from "./WebGLRenderTarget.js"; +import { WebXRManager } from "./webxr/WebXRManager.js"; + +export interface WebGLRendererParameters extends WebGLCapabilitiesParameters { + /** + * A Canvas where the renderer draws its output. + */ + canvas?: HTMLCanvasElement | OffscreenCanvas | undefined; + + /** + * A WebGL Rendering Context. + * (https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext) + * Default is null + */ + context?: WebGLRenderingContext | undefined; + + /** + * default is false. + */ + alpha?: boolean | undefined; + + /** + * default is true. + */ + premultipliedAlpha?: boolean | undefined; + + /** + * default is false. + */ + antialias?: boolean | undefined; + + /** + * default is false. + */ + stencil?: boolean | undefined; + + /** + * default is false. + */ + preserveDrawingBuffer?: boolean | undefined; + + /** + * Can be "high-performance", "low-power" or "default" + */ + powerPreference?: WebGLPowerPreference | undefined; + + /** + * default is true. + */ + depth?: boolean | undefined; + + /** + * default is false. + */ + failIfMajorPerformanceCaveat?: boolean | undefined; +} + +export interface WebGLDebug { + /** + * Enables error checking and reporting when shader programs are being compiled. + */ + checkShaderErrors: boolean; + + /** + * A callback function that can be used for custom error reporting. The callback receives the WebGL context, an + * instance of WebGLProgram as well two instances of WebGLShader representing the vertex and fragment shader. + * Assigning a custom function disables the default error reporting. + * @default `null` + */ + onShaderError: + | (( + gl: WebGLRenderingContext, + program: WebGLProgram, + glVertexShader: WebGLShader, + glFragmentShader: WebGLShader, + ) => void) + | null; +} + +/** + * The WebGL renderer displays your beautifully crafted scenes using WebGL, if your device supports it. + * This renderer has way better performance than CanvasRenderer. + * + * see {@link https://github.com/mrdoob/three.js/blob/master/src/renderers/WebGLRenderer.js|src/renderers/WebGLRenderer.js} + */ +export class WebGLRenderer { + /** + * parameters is an optional object with properties defining the renderer's behavior. + * The constructor also accepts no parameters at all. + * In all cases, it will assume sane defaults when parameters are missing. + */ + constructor(parameters?: WebGLRendererParameters); + + /** + * A Canvas where the renderer draws its output. + * This is automatically created by the renderer in the constructor (if not provided already); you just need to add it to your page. + * @default document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' ) + */ + domElement: HTMLCanvasElement; + + /** + * Defines whether the renderer should automatically clear its output before rendering. + * @default true + */ + autoClear: boolean; + + /** + * If autoClear is true, defines whether the renderer should clear the color buffer. Default is true. + * @default true + */ + autoClearColor: boolean; + + /** + * If autoClear is true, defines whether the renderer should clear the depth buffer. Default is true. + * @default true + */ + autoClearDepth: boolean; + + /** + * If autoClear is true, defines whether the renderer should clear the stencil buffer. Default is true. + * @default true + */ + autoClearStencil: boolean; + + /** + * Debug configurations. + * @default { checkShaderErrors: true } + */ + debug: WebGLDebug; + + /** + * Defines whether the renderer should sort objects. Default is true. + * @default true + */ + sortObjects: boolean; + + /** + * @default [] + */ + clippingPlanes: Plane[]; + + /** + * @default false + */ + localClippingEnabled: boolean; + + extensions: WebGLExtensions; + + /** + * Color space used for output to HTMLCanvasElement. Supported values are + * {@link SRGBColorSpace} and {@link LinearSRGBColorSpace}. + * @default THREE.SRGBColorSpace. + */ + get outputColorSpace(): string; + set outputColorSpace(colorSpace: string); + + get coordinateSystem(): typeof WebGLCoordinateSystem; + + /** + * @default THREE.NoToneMapping + */ + toneMapping: ToneMapping; + + /** + * @default 1 + */ + toneMappingExposure: number; + + /** + * The normalized resolution scale for the transmission render target, measured in percentage of viewport + * dimensions. Lowering this value can result in significant improvements to {@link MeshPhysicalMaterial} + * transmission performance. Default is `1`. + */ + transmissionResolutionScale: number; + + info: WebGLInfo; + + shadowMap: WebGLShadowMap; + + capabilities: WebGLCapabilities; + properties: WebGLProperties; + renderLists: WebGLRenderLists; + state: WebGLState; + + xr: WebXRManager; + + /** + * Return the WebGL context. + */ + getContext(): WebGLRenderingContext | WebGL2RenderingContext; + getContextAttributes(): any; + forceContextLoss(): void; + forceContextRestore(): void; + + /** + * @deprecated Use {@link WebGLCapabilities#getMaxAnisotropy .capabilities.getMaxAnisotropy()} instead. + */ + getMaxAnisotropy(): number; + + /** + * @deprecated Use {@link WebGLCapabilities#precision .capabilities.precision} instead. + */ + getPrecision(): string; + + getPixelRatio(): number; + setPixelRatio(value: number): void; + + getDrawingBufferSize(target: Vector2): Vector2; + setDrawingBufferSize(width: number, height: number, pixelRatio: number): void; + + getSize(target: Vector2): Vector2; + + /** + * Resizes the output canvas to (width, height), and also sets the viewport to fit that size, starting in (0, 0). + */ + setSize(width: number, height: number, updateStyle?: boolean): void; + + getCurrentViewport(target: Vector4): Vector4; + + /** + * Copies the viewport into target. + */ + getViewport(target: Vector4): Vector4; + + /** + * Sets the viewport to render from (x, y) to (x + width, y + height). + * (x, y) is the lower-left corner of the region. + */ + setViewport(x: Vector4 | number, y?: number, width?: number, height?: number): void; + + /** + * Copies the scissor area into target. + */ + getScissor(target: Vector4): Vector4; + + /** + * Sets the scissor area from (x, y) to (x + width, y + height). + */ + setScissor(x: Vector4 | number, y?: number, width?: number, height?: number): void; + + /** + * Returns true if scissor test is enabled; returns false otherwise. + */ + getScissorTest(): boolean; + + /** + * Enable the scissor test. When this is enabled, only the pixels within the defined scissor area will be affected by further renderer actions. + */ + setScissorTest(enable: boolean): void; + + /** + * Sets the custom opaque sort function for the WebGLRenderLists. Pass null to use the default painterSortStable function. + */ + setOpaqueSort(method: ((a: any, b: any) => number) | null): void; + + /** + * Sets the custom transparent sort function for the WebGLRenderLists. Pass null to use the default reversePainterSortStable function. + */ + setTransparentSort(method: ((a: any, b: any) => number) | null): void; + + /** + * Returns a THREE.Color instance with the current clear color. + */ + getClearColor(target: Color): Color; + + /** + * Sets the clear color, using color for the color and alpha for the opacity. + */ + setClearColor(color: ColorRepresentation, alpha?: number): void; + + /** + * Returns a float with the current clear alpha. Ranges from 0 to 1. + */ + getClearAlpha(): number; + + setClearAlpha(alpha: number): void; + + /** + * Tells the renderer to clear its color, depth or stencil drawing buffer(s). + * Arguments default to true + */ + clear(color?: boolean, depth?: boolean, stencil?: boolean): void; + + clearColor(): void; + clearDepth(): void; + clearStencil(): void; + clearTarget(renderTarget: WebGLRenderTarget, color: boolean, depth: boolean, stencil: boolean): void; + + /** + * @deprecated Use {@link WebGLState#reset .state.reset()} instead. + */ + resetGLState(): void; + dispose(): void; + + renderBufferDirect( + camera: Camera, + scene: Scene, + geometry: BufferGeometry, + material: Material, + object: Object3D, + geometryGroup: any, + ): void; + + /** + * A build in function that can be used instead of requestAnimationFrame. For WebXR projects this function must be used. + * @param callback The function will be called every available frame. If `null` is passed it will stop any already ongoing animation. + */ + setAnimationLoop(callback: XRFrameRequestCallback | null): void; + + /** + * @deprecated Use {@link WebGLRenderer#setAnimationLoop .setAnimationLoop()} instead. + */ + animate(callback: () => void): void; + + /** + * Compiles all materials in the scene with the camera. This is useful to precompile shaders before the first + * rendering. If you want to add a 3D object to an existing scene, use the third optional parameter for applying the + * target scene. + * Note that the (target) scene's lighting should be configured before calling this method. + */ + compile: (scene: Object3D, camera: Camera, targetScene?: Scene | null) => Set; + + /** + * Asynchronous version of {@link compile}(). The method returns a Promise that resolves when the given scene can be + * rendered without unnecessary stalling due to shader compilation. + * This method makes use of the KHR_parallel_shader_compile WebGL extension. + */ + compileAsync: (scene: Object3D, camera: Camera, targetScene?: Scene | null) => Promise; + + /** + * Render a scene or an object using a camera. + * The render is done to a previously specified {@link WebGLRenderTarget#renderTarget .renderTarget} set by calling + * {@link WebGLRenderer#setRenderTarget .setRenderTarget} or to the canvas as usual. + * + * By default render buffers are cleared before rendering but you can prevent this by setting the property + * {@link WebGLRenderer#autoClear autoClear} to false. If you want to prevent only certain buffers being cleared + * you can set either the {@link WebGLRenderer#autoClearColor autoClearColor}, + * {@link WebGLRenderer#autoClearStencil autoClearStencil} or {@link WebGLRenderer#autoClearDepth autoClearDepth} + * properties to false. To forcibly clear one ore more buffers call {@link WebGLRenderer#clear .clear}. + */ + render(scene: Object3D, camera: Camera): void; + + /** + * Returns the current active cube face. + */ + getActiveCubeFace(): number; + + /** + * Returns the current active mipmap level. + */ + getActiveMipmapLevel(): number; + + /** + * Returns the current render target. If no render target is set, null is returned. + */ + getRenderTarget(): WebGLRenderTarget | null; + + /** + * @deprecated Use {@link WebGLRenderer#getRenderTarget .getRenderTarget()} instead. + */ + getCurrentRenderTarget(): WebGLRenderTarget | null; + + /** + * Sets the active render target. + * + * @param renderTarget The {@link WebGLRenderTarget renderTarget} that needs to be activated. When `null` is given, the canvas is set as the active render target instead. + * @param activeCubeFace Specifies the active cube side (PX 0, NX 1, PY 2, NY 3, PZ 4, NZ 5) of {@link WebGLCubeRenderTarget}. + * @param activeMipmapLevel Specifies the active mipmap level. + */ + setRenderTarget( + renderTarget: WebGLRenderTarget | WebGLRenderTarget | null, + activeCubeFace?: number, + activeMipmapLevel?: number, + ): void; + + readRenderTargetPixels( + renderTarget: WebGLRenderTarget | WebGLRenderTarget, + x: number, + y: number, + width: number, + height: number, + buffer: TypedArray, + activeCubeFaceIndex?: number, + textureIndex?: number, + ): void; + + readRenderTargetPixelsAsync( + renderTarget: WebGLRenderTarget | WebGLRenderTarget, + x: number, + y: number, + width: number, + height: number, + buffer: TypedArray, + activeCubeFaceIndex?: number, + textureIndex?: number, + ): Promise; + + /** + * Copies a region of the currently bound framebuffer into the selected mipmap level of the selected texture. + * This region is defined by the size of the destination texture's mip level, offset by the input position. + * + * @param texture Specifies the destination texture. + * @param position Specifies the pixel offset from which to copy out of the framebuffer. + * @param level Specifies the destination mipmap level of the texture. + */ + copyFramebufferToTexture(texture: Texture, position?: Vector2 | null, level?: number): void; + + /** + * Copies the pixels of a texture in the bounds [srcRegion]{@link Box3} in the destination texture starting from the + * given position. 2D Texture, 3D Textures, or a mix of the two can be used as source and destination texture + * arguments for copying between layers of 3d textures + * + * The `depthTexture` and `texture` property of render targets are supported as well. + * + * When using render target textures as `srcTexture` and `dstTexture`, you must make sure both render targets are + * initialized e.g. via {@link .initRenderTarget}(). + * + * @param srcTexture Specifies the source texture. + * @param dstTexture Specifies the destination texture. + * @param srcRegion Specifies the bounds + * @param dstPosition Specifies the pixel offset into the dstTexture where the copy will occur. + * @param srcLevel Specifies the source mipmap level of the texture. + * @param dstLevel Specifies the destination mipmap level of the texture. + */ + copyTextureToTexture( + srcTexture: Texture, + dstTexture: Texture, + srcRegion?: Box2 | Box3 | null, + dstPosition?: Vector2 | Vector3 | null, + srcLevel?: number, + dstLevel?: number, + ): void; + + /** + * Initializes the given WebGLRenderTarget memory. Useful for initializing a render target so data can be copied + * into it using {@link WebGLRenderer.copyTextureToTexture} before it has been rendered to. + * @param target + */ + initRenderTarget(target: WebGLRenderTarget): void; + + /** + * Initializes the given texture. Can be used to preload a texture rather than waiting until first render (which can cause noticeable lags due to decode and GPU upload overhead). + * + * @param texture The texture to Initialize. + */ + initTexture(texture: Texture): void; + + /** + * Can be used to reset the internal WebGL state. + */ + resetState(): void; + + /** + * @deprecated Use {@link WebGLRenderer#xr .xr} instead. + */ + vr: boolean; + + /** + * @deprecated Use {@link WebGLShadowMap#enabled .shadowMap.enabled} instead. + */ + shadowMapEnabled: boolean; + + /** + * @deprecated Use {@link WebGLShadowMap#type .shadowMap.type} instead. + */ + shadowMapType: ShadowMapType; + + /** + * @deprecated Use {@link WebGLShadowMap#cullFace .shadowMap.cullFace} instead. + */ + shadowMapCullFace: CullFace; + + /** + * @deprecated Use {@link WebGLExtensions#get .extensions.get( 'OES_texture_float' )} instead. + */ + supportsFloatTextures(): any; + + /** + * @deprecated Use {@link WebGLExtensions#get .extensions.get( 'OES_texture_half_float' )} instead. + */ + supportsHalfFloatTextures(): any; + + /** + * @deprecated Use {@link WebGLExtensions#get .extensions.get( 'OES_standard_derivatives' )} instead. + */ + supportsStandardDerivatives(): any; + + /** + * @deprecated Use {@link WebGLExtensions#get .extensions.get( 'WEBGL_compressed_texture_s3tc' )} instead. + */ + supportsCompressedTextureS3TC(): any; + + /** + * @deprecated Use {@link WebGLExtensions#get .extensions.get( 'WEBGL_compressed_texture_pvrtc' )} instead. + */ + supportsCompressedTexturePVRTC(): any; + + /** + * @deprecated Use {@link WebGLExtensions#get .extensions.get( 'EXT_blend_minmax' )} instead. + */ + supportsBlendMinMax(): any; + + /** + * @deprecated Use {@link WebGLCapabilities#vertexTextures .capabilities.vertexTextures} instead. + */ + supportsVertexTextures(): any; + + /** + * @deprecated Use {@link WebGLExtensions#get .extensions.get( 'ANGLE_instanced_arrays' )} instead. + */ + supportsInstancedArrays(): any; + + /** + * @deprecated Use {@link WebGLRenderer#setScissorTest .setScissorTest()} instead. + */ + enableScissorTest(boolean: any): any; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Animation.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Animation.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6507a8a4569dfe813b4e29d5cd4328a6c5f9ee14 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Animation.d.ts @@ -0,0 +1,62 @@ +import Info from "./Info.js"; +import Nodes from "./nodes/Nodes.js"; +export interface AnimationContext { + requestAnimationFrame(callback: FrameRequestCallback, xrFrame?: XRFrame): number; + cancelAnimationFrame(handle: number): void; +} +/** + * This module manages the internal animation loop of the renderer. + * + * @private + */ +declare class Animation { + nodes: Nodes; + info: Info; + _context: AnimationContext | null; + _animationLoop: ((time: DOMHighResTimeStamp, xrFrame?: XRFrame) => void) | null; + _requestId: number | null; + /** + * Constructs a new animation loop management component. + * + * @param {Nodes} nodes - Renderer component for managing nodes related logic. + * @param {Info} info - Renderer component for managing metrics and monitoring data. + */ + constructor(nodes: Nodes, info: Info); + /** + * Starts the internal animation loop. + */ + start(): void; + /** + * Stops the internal animation loop. + */ + stop(): void; + /** + * Returns the user-level animation loop. + * + * @return {?Function} The animation loop. + */ + getAnimationLoop(): ((time: DOMHighResTimeStamp, xrFrame?: XRFrame) => void) | null; + /** + * Defines the user-level animation loop. + * + * @param {?Function} callback - The animation loop. + */ + setAnimationLoop(callback: ((time: DOMHighResTimeStamp, xrFrame?: XRFrame) => void) | null): void; + /** + * Returns the animation context. + * + * @return {Window|XRSession} The animation context. + */ + getContext(): AnimationContext | null; + /** + * Defines the context in which `requestAnimationFrame()` is executed. + * + * @param {Window|XRSession} context - The context to set. + */ + setContext(context: AnimationContext): void; + /** + * Frees all internal resources and stops the animation loop. + */ + dispose(): void; +} +export default Animation; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Attributes.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Attributes.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9bc739d8e6d1c57a2a51eb961d3f0b509dc90502 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Attributes.d.ts @@ -0,0 +1,53 @@ +import { BufferAttribute } from "../../core/BufferAttribute.js"; +import { InterleavedBuffer } from "../../core/InterleavedBuffer.js"; +import { InterleavedBufferAttribute } from "../../core/InterleavedBufferAttribute.js"; +import Backend from "./Backend.js"; +import { AttributeType } from "./Constants.js"; +import DataMap from "./DataMap.js"; +interface Data { + version?: number | undefined; +} +/** + * This renderer module manages geometry attributes. + * + * @private + * @augments DataMap + */ +declare class Attributes extends DataMap<{ + attribute: { + key: BufferAttribute | InterleavedBufferAttribute; + value: Data; + }; +}> { + backend: Backend; + /** + * Constructs a new attribute management component. + * + * @param {Backend} backend - The renderer's backend. + */ + constructor(backend: Backend); + /** + * Deletes the data for the given attribute. + * + * @param {BufferAttribute} attribute - The attribute. + * @return {?Object} The deleted attribute data. + */ + delete(attribute: BufferAttribute | InterleavedBufferAttribute): Data; + /** + * Updates the given attribute. This method creates attribute buffers + * for new attributes and updates data for existing ones. + * + * @param {BufferAttribute} attribute - The attribute to update. + * @param {number} type - The attribute type. + */ + update(attribute: BufferAttribute | InterleavedBufferAttribute, type: AttributeType): void; + /** + * Utility method for handling interleaved buffer attributes correctly. + * To process them, their `InterleavedBuffer` is returned. + * + * @param {BufferAttribute} attribute - The attribute. + * @return {BufferAttribute|InterleavedBuffer} + */ + _getBufferAttribute(attribute: BufferAttribute | InterleavedBufferAttribute): BufferAttribute | InterleavedBuffer; +} +export default Attributes; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Backend.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Backend.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..105dd96135a6560bf8f70979c091e09129678d18 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Backend.d.ts @@ -0,0 +1,30 @@ +import { CoordinateSystem } from "../../constants.js"; +import Renderer from "./Renderer.js"; + +declare module "../../core/Object3D.js" { + interface Object3D { + // See https://github.com/mrdoob/three.js/pull/28683 + count?: number | undefined; + // See https://github.com/mrdoob/three.js/pull/26335 + occlusionTest?: boolean | undefined; + // https://github.com/mrdoob/three.js/pull/29386 + static?: boolean | undefined; + } +} + +export interface BackendParameters { + canvas?: HTMLCanvasElement | OffscreenCanvas | undefined; +} + +export default abstract class Backend { + renderer: Renderer | null; + domElement: HTMLCanvasElement | OffscreenCanvas | null; + + constructor(parameters?: BackendParameters); + + init(renderer: Renderer): void; + + abstract get coordinateSystem(): CoordinateSystem; + + getDomElement(): HTMLCanvasElement | OffscreenCanvas; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Background.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Background.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b3c6e59f2457a4724d93849e52414a40fea59747 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Background.d.ts @@ -0,0 +1,45 @@ +import { Mesh } from "../../objects/Mesh.js"; +import { Scene } from "../../scenes/Scene.js"; +import DataMap from "./DataMap.js"; +import Nodes from "./nodes/Nodes.js"; +import RenderContext from "./RenderContext.js"; +import Renderer from "./Renderer.js"; +import RenderList from "./RenderList.js"; +interface SceneData { + backgroundMesh?: Mesh; + backgroundCacheKey: string; +} +/** + * This renderer module manages the background. + * + * @private + * @augments DataMap + */ +declare class Background extends DataMap<{ + scene: { + key: Scene; + value: SceneData; + }; +}> { + renderer: Renderer; + nodes: Nodes; + /** + * Constructs a new background management component. + * + * @param {Renderer} renderer - The renderer. + * @param {Nodes} nodes - Renderer component for managing nodes related logic. + */ + constructor(renderer: Renderer, nodes: Nodes); + /** + * Updates the background for the given scene. Depending on how `Scene.background` + * or `Scene.backgroundNode` are configured, this method might configure a simple clear + * or add a mesh to the render list for rendering the background as a textured plane + * or skybox. + * + * @param {Scene} scene - The scene. + * @param {RenderList} renderList - The current render list. + * @param {RenderContext} renderContext - The current render context. + */ + update(scene: Scene, renderList: RenderList, renderContext: RenderContext): void; +} +export default Background; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/BindGroup.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/BindGroup.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..030079b924f9773e894516ffe4fc79bffd2b96e5 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/BindGroup.d.ts @@ -0,0 +1,31 @@ +import Binding from "./Binding.js"; +import NodeUniformsGroup from "./nodes/NodeUniformsGroup.js"; +/** + * A bind group represents a collection of bindings and thus a collection + * or resources. Bind groups are assigned to pipelines to provide them + * with the required resources (like uniform buffers or textures). + * + * @private + */ +declare class BindGroup { + name: string; + bindings: NodeUniformsGroup[] | Binding[]; + index: number; + bindingsReference: NodeUniformsGroup[] | BindGroup; + id: number; + /** + * Constructs a new bind group. + * + * @param {string} name - The bind group's name. + * @param {Array} bindings - An array of bindings. + * @param {number} index - The group index. + * @param {Array} bindingsReference - An array of reference bindings. + */ + constructor( + name?: string, + bindings?: NodeUniformsGroup[], + index?: number, + bindingsReference?: NodeUniformsGroup[] | BindGroup, + ); +} +export default BindGroup; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Binding.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Binding.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..68d241e30a8fadb3a873fbe5acf78c47869dd888 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Binding.d.ts @@ -0,0 +1,32 @@ +/** + * A binding represents the connection between a resource (like a texture, sampler + * or uniform buffer) and the resource definition in a shader stage. + * + * This module is an abstract base class for all concrete bindings types. + * + * @abstract + * @private + */ +declare class Binding { + name: string; + visibility: number; + /** + * Constructs a new binding. + * + * @param {string} [name=''] - The binding's name. + */ + constructor(name?: string); + /** + * Makes sure binding's resource is visible for the given shader stage. + * + * @param {number} visibility - The shader stage. + */ + setVisibility(visibility: number): void; + /** + * Clones the binding. + * + * @return {Binding} The cloned binding. + */ + clone(): Binding & this; +} +export default Binding; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Bindings.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Bindings.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b62b673aa68b0673cdbb608f18766eeb07c7adff --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Bindings.d.ts @@ -0,0 +1,96 @@ +import ComputeNode from "../../nodes/gpgpu/ComputeNode.js"; +import Attributes from "./Attributes.js"; +import Backend from "./Backend.js"; +import BindGroup from "./BindGroup.js"; +import DataMap from "./DataMap.js"; +import Info from "./Info.js"; +import Nodes from "./nodes/Nodes.js"; +import Pipelines from "./Pipelines.js"; +import RenderObject from "./RenderObject.js"; +import Textures from "./Textures.js"; +interface BindGroupData { + bindGroup?: BindGroup | undefined; +} +/** + * This renderer module manages the bindings of the renderer. + * + * @private + * @augments DataMap + */ +declare class Bindings extends DataMap<{ + /** + * Constructs a new bindings management component. + * + * @param {Backend} backend - The renderer's backend. + * @param {Nodes} nodes - Renderer component for managing nodes related logic. + * @param {Textures} textures - Renderer component for managing textures. + * @param {Attributes} attributes - Renderer component for managing attributes. + * @param {Pipelines} pipelines - Renderer component for managing pipelines. + * @param {Info} info - Renderer component for managing metrics and monitoring data. + */ + bindGroup: { + key: BindGroup; + value: BindGroupData; + }; +}> { + backend: Backend; + textures: Textures; + pipelines: Pipelines; + attributes: Attributes; + nodes: Nodes; + info: Info; + constructor( + backend: Backend, + nodes: Nodes, + textures: Textures, + attributes: Attributes, + pipelines: Pipelines, + info: Info, + ); + /** + * Returns the bind groups for the given render object. + * + * @param {RenderObject} renderObject - The render object. + * @return {Array} The bind groups. + */ + getForRender(renderObject: RenderObject): BindGroup[]; + /** + * Returns the bind groups for the given compute node. + * + * @param {Node} computeNode - The compute node. + * @return {Array} The bind groups. + */ + getForCompute(computeNode: ComputeNode): BindGroup[]; + /** + * Updates the bindings for the given compute node. + * + * @param {Node} computeNode - The compute node. + */ + updateForCompute(computeNode: ComputeNode): void; + /** + * Updates the bindings for the given render object. + * + * @param {RenderObject} renderObject - The render object. + */ + updateForRender(renderObject: RenderObject): void; + /** + * Updates the given array of bindings. + * + * @param {Array} bindings - The bind groups. + */ + _updateBindings(bindings: BindGroup[]): void; + /** + * Initializes the given bind group. + * + * @param {BindGroup} bindGroup - The bind group to initialize. + */ + _init(bindGroup: BindGroup): void; + /** + * Updates the given bind group. + * + * @param {BindGroup} bindGroup - The bind group to update. + * @param {Array} bindings - The bind groups. + */ + _update(bindGroup: BindGroup, bindings: BindGroup[]): void; +} +export default Bindings; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Buffer.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Buffer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9aaff070894a66cc3b1531c19d27a047ff703b5c --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Buffer.d.ts @@ -0,0 +1,42 @@ +import Binding from "./Binding.js"; +/** + * Represents a buffer binding type. + * + * @private + * @abstract + * @augments Binding + */ +declare class Buffer extends Binding { + readonly isBuffer: true; + bytesPerElement: number; + _buffer: Float32Array | null; + /** + * Constructs a new buffer. + * + * @param {string} name - The buffer's name. + * @param {TypedArray} [buffer=null] - The buffer. + */ + constructor(name?: string, buffer?: Float32Array | null); + /** + * The buffer's byte length. + * + * @type {number} + * @readonly + */ + get byteLength(): number; + /** + * A reference to the internal buffer. + * + * @type {Float32Array} + * @readonly + */ + get buffer(): Float32Array | null; + /** + * Updates the binding. + * + * @return {boolean} Whether the buffer has been updated and must be + * uploaded to the GPU. + */ + update(): boolean; +} +export default Buffer; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/BufferUtils.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/BufferUtils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dc441d93da6bc86d51f76e3034692aaa29ccea4c --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/BufferUtils.d.ts @@ -0,0 +1,29 @@ +/** + * This function is usually called with the length in bytes of an array buffer. + * It returns an padded value which ensure chunk size alignment according to STD140 layout. + * + * @function + * @param {number} floatLength - The buffer length. + * @return {number} The padded length. + */ +declare function getFloatLength(floatLength: number): number; +/** + * Given the count of vectors and their vector length, this function computes + * a total length in bytes with buffer alignment according to STD140 layout. + * + * @function + * @param {number} count - The number of vectors. + * @param {number} [vectorLength=4] - The vector length. + * @return {number} The padded length. + */ +declare function getVectorLength(count: number, vectorLength?: number): number; +/** + * This function is called with a vector length and ensure the computed length + * matches a predefined stride (in this case `4`). + * + * @function + * @param {number} vectorLength - The vector length. + * @return {number} The padded length. + */ +declare function getStrideLength(vectorLength: number): number; +export { getFloatLength, getStrideLength, getVectorLength }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/BundleGroup.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/BundleGroup.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d9fd773ee758bf2b33bb6a03d55ccfaeba44b5ce --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/BundleGroup.d.ts @@ -0,0 +1,32 @@ +import { Group } from "../../objects/Group.js"; +/** + * A specialized group which enables applications access to the + * Render Bundle API of WebGPU. The group with all its descendant nodes + * are considered as one render bundle and processed as such by + * the renderer. + * + * This module is only fully supported by `WebGPURenderer` with a WebGPU backend. + * With a WebGL backend, the group can technically be rendered but without + * any performance improvements. + * + * @augments Group + */ +declare class BundleGroup extends Group { + readonly isBundleGroup: true; + readonly type: string; + static: boolean; + version: number; + /** + * Constructs a new bundle group. + */ + constructor(); + /** + * Set this property to `true` when the bundle group has changed. + * + * @type {boolean} + * @default false + * @param {boolean} value + */ + set needsUpdate(value: boolean); +} +export default BundleGroup; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/ChainMap.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/ChainMap.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fd5c7ce619f4e2c5724abd4c2643e586ad449229 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/ChainMap.d.ts @@ -0,0 +1,39 @@ +type RecursiveWeakMap = WeakMap>; +/** + * Data structure for the renderer. It allows defining values + * with chained, hierarchical keys. Keys are meant to be + * objects since the module internally works with Weak Maps + * for performance reasons. + * + * @private + */ +declare class ChainMap { + weakMap: RecursiveWeakMap; + /** + * Constructs a new Chain Map. + */ + constructor(); + /** + * Returns the value for the given array of keys. + * + * @param {Array} keys - List of keys. + * @return {any} The value. Returns `undefined` if no value was found. + */ + get(keys: K): V | undefined; + /** + * Sets the value for the given keys. + * + * @param {Array} keys - List of keys. + * @param {any} value - The value to set. + * @return {ChainMap} A reference to this Chain Map. + */ + set(keys: K, value: V): this; + /** + * Deletes a value for the given keys. + * + * @param {Array} keys - The keys. + * @return {boolean} Returns `true` if the value has been removed successfully and `false` if the value has not be found. + */ + delete(keys: K): boolean; +} +export default ChainMap; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/ClippingContext.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/ClippingContext.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5577e211166d54a7ccebd688d696b338172ffc12 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/ClippingContext.d.ts @@ -0,0 +1,71 @@ +import { Camera } from "../../cameras/Camera.js"; +import { Matrix3 } from "../../math/Matrix3.js"; +import { Matrix4 } from "../../math/Matrix4.js"; +import { Plane } from "../../math/Plane.js"; +import { Vector4 } from "../../math/Vector4.js"; +import { ClippingGroup } from "../../objects/ClippingGroup.js"; +import { Scene } from "../../scenes/Scene.js"; +/** + * Represents the state that is used to perform clipping via clipping planes. + * There is a default clipping context for each render context. When the + * scene holds instances of `ClippingGroup`, there will be a context for each + * group. + * + * @private + */ +declare class ClippingContext { + version: number; + clipIntersection: boolean | null; + cacheKey: string; + intersectionPlanes?: Plane[]; + unionPlanes?: Plane[]; + viewNormalMatrix: Matrix3; + clippingGroupContexts: WeakMap; + shadowPass: boolean; + viewMatrix?: Matrix4; + parentVersion: number | null; + /** + * Constructs a new clipping context. + * + * @param {?ClippingContext} [parentContext=null] - A reference to the parent clipping context. + */ + constructor(parentContext?: ClippingContext | null); + /** + * Projects the given source clipping planes and writes the result into the + * destination array. + * + * @param {Array} source - The source clipping planes. + * @param {Array} destination - The destination. + * @param {number} offset - The offset. + */ + projectPlanes(source: readonly Plane[], destination: readonly Vector4[], offset: number): void; + /** + * Updates the root clipping context of a scene. + * + * @param {Scene} scene - The scene. + * @param {Camera} camera - The camera that is used to render the scene. + */ + updateGlobal(scene: Scene, camera: Camera): void; + /** + * Updates the clipping context. + * + * @param {ClippingContext} parentContext - The parent context. + * @param {ClippingGroup} clippingGroup - The clipping group this context belongs to. + */ + update(parentContext: ClippingContext, clippingGroup: ClippingGroup): void; + /** + * Returns a clipping context for the given clipping group. + * + * @param {ClippingGroup} clippingGroup - The clipping group. + * @return {ClippingContext} The clipping context. + */ + getGroupContext(clippingGroup: ClippingGroup): ClippingContext; + /** + * The count of union clipping planes. + * + * @type {number} + * @readonly + */ + get unionClippingCount(): number; +} +export default ClippingContext; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Color4.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Color4.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3bad626ec74085c153d93979e7b47f3e2b33dd5a --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Color4.d.ts @@ -0,0 +1,50 @@ +import { Color, ColorRepresentation } from "../../math/Color.js"; +/** + * A four-component version of {@link Color} which is internally + * used by the renderer to represents clear color with alpha as + * one object. + * + * @private + * @augments Color + */ +declare class Color4 extends Color { + a: number; + /** + * Constructs a new four-component color. + * You can also pass a single THREE.Color, hex or + * string argument to this constructor. + * + * @param {number|string} [r=1] - The red value. + * @param {number} [g=1] - The green value. + * @param {number} [b=1] - The blue value. + * @param {number} [a=1] - The alpha value. + */ + constructor(color?: ColorRepresentation); + constructor(r: number, g: number, b: number, a?: number); + /** + * Overwrites the default to honor alpha. + * You can also pass a single THREE.Color, hex or + * string argument to this method. + * + * @param {number|string|Color} r - The red value. + * @param {number} [g] - The green value. + * @param {number} [b] - The blue value. + * @param {number} [a=1] - The alpha value. + * @return {Color4} A reference to this object. + */ + set(...args: [color: ColorRepresentation] | [r: number, g: number, b: number, a?: number]): this; + /** + * Overwrites the default to honor alpha. + * + * @param {Color4} color - The color to copy. + * @return {Color4} A reference to this object. + */ + copy(color: Color): this; + /** + * Overwrites the default to honor alpha. + * + * @return {Color4} The cloned color. + */ + clone(): this; +} +export default Color4; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/ComputePipeline.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/ComputePipeline.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..acb14a531edfc1670c18f9236b86b08eb9486526 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/ComputePipeline.d.ts @@ -0,0 +1,20 @@ +import Pipeline from "./Pipeline.js"; +import ProgrammableStage from "./ProgrammableStage.js"; +/** + * Class for representing compute pipelines. + * + * @private + * @augments Pipeline + */ +declare class ComputePipeline extends Pipeline { + computeProgram: ProgrammableStage; + readonly isComputePipeline: true; + /** + * Constructs a new render pipeline. + * + * @param {string} cacheKey - The pipeline's cache key. + * @param {ProgrammableStage} computeProgram - The pipeline's compute shader. + */ + constructor(cacheKey: string, computeProgram: ProgrammableStage); +} +export default ComputePipeline; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Constants.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Constants.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8e036f2eaa027a4d404b1e5b1ed0c3221d275a3c --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Constants.d.ts @@ -0,0 +1,10 @@ +export declare const AttributeType: { + readonly VERTEX: 1; + readonly INDEX: 2; + readonly STORAGE: 3; + readonly INDIRECT: 4; +}; +export type AttributeType = (typeof AttributeType)[keyof typeof AttributeType]; +export declare const GPU_CHUNK_BYTES = 16; +export declare const BlendColorFactor = 211; +export declare const OneMinusBlendColorFactor = 212; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/CubeRenderTarget.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/CubeRenderTarget.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9bca1fa54a2b2eae6958804a485e317d636f01ed --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/CubeRenderTarget.d.ts @@ -0,0 +1,29 @@ +import { RenderTargetOptions } from "../../core/RenderTarget.js"; +import { WebGLCubeRenderTarget } from "../../renderers/WebGLCubeRenderTarget.js"; +import { Texture } from "../../textures/Texture.js"; +import { WebGLRenderer } from "../WebGLRenderer.js"; +/** + * This class represents a cube render target. It is a special version + * of `WebGLCubeRenderTarget` which is compatible with `WebGPURenderer`. + * + * @augments WebGLCubeRenderTarget + */ +declare class CubeRenderTarget extends WebGLCubeRenderTarget { + readonly isCubeRenderTarget: true; + /** + * Constructs a new cube render target. + * + * @param {number} [size=1] - The size of the render target. + * @param {RenderTarget~Options} [options] - The configuration object. + */ + constructor(size?: number, options?: RenderTargetOptions); + /** + * Converts the given equirectangular texture to a cube map. + * + * @param {Renderer} renderer - The renderer. + * @param {Texture} texture - The equirectangular texture. + * @return {CubeRenderTarget} A reference to this cube render target. + */ + fromEquirectangularTexture(renderer: WebGLRenderer, texture: Texture): this; +} +export default CubeRenderTarget; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/DataMap.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/DataMap.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..18f4539ab803935ae25431e799d7c0a844e55641 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/DataMap.d.ts @@ -0,0 +1,50 @@ +/** + * Data structure for the renderer. It is intended to manage + * data of objects in dictionaries. + * + * @private + */ +declare class DataMap< + M extends { + [key: string]: { + key: object; + value: unknown; + }; + }, +> { + data: WeakMap; + /** + * Constructs a new data map. + */ + constructor(); + /** + * Returns the dictionary for the given object. + * + * @param {Object} object - The object. + * @return {Object} The dictionary. + */ + get(object: K): Extract["value"]; + /** + * Deletes the dictionary for the given object. + * + * @param {Object} object - The object. + * @return {?Object} The deleted dictionary. + */ + delete(object: K): Extract["value"]; + /** + * Returns `true` if the given object has a dictionary defined. + * + * @param {Object} object - The object to test. + * @return {boolean} Whether a dictionary is defined or not. + */ + has(object: M[keyof M]["key"]): boolean; + /** + * Frees internal resources. + */ + dispose(): void; +} +export default DataMap; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Geometries.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Geometries.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9776a26f21a8d68bd5c7da1a3a9badd44aa4027a --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Geometries.d.ts @@ -0,0 +1,84 @@ +import { BufferAttribute } from "../../core/BufferAttribute.js"; +import { BufferGeometry } from "../../core/BufferGeometry.js"; +import { InterleavedBuffer } from "../../core/InterleavedBuffer.js"; +import { InterleavedBufferAttribute } from "../../core/InterleavedBufferAttribute.js"; +import Attributes from "./Attributes.js"; +import { AttributeType } from "./Constants.js"; +import DataMap from "./DataMap.js"; +import Info from "./Info.js"; +import RenderObject from "./RenderObject.js"; +interface GeometryData { + initialized?: boolean | undefined; +} +/** + * This renderer module manages geometries. + * + * @private + * @augments DataMap + */ +declare class Geometries extends DataMap<{ + geometry: { + key: BufferGeometry; + value: GeometryData; + }; +}> { + attributes: Attributes; + info: Info; + wireframes: WeakMap; + attributeCall: WeakMap; + /** + * Constructs a new geometry management component. + * + * @param {Attributes} attributes - Renderer component for managing attributes. + * @param {Info} info - Renderer component for managing metrics and monitoring data. + */ + constructor(attributes: Attributes, info: Info); + /** + * Returns `true` if the given render object has an initialized geometry. + * + * @param {RenderObject} renderObject - The render object. + * @return {boolean} Whether if the given render object has an initialized geometry or not. + */ + has(renderObject: RenderObject | BufferGeometry): boolean; + /** + * Prepares the geometry of the given render object for rendering. + * + * @param {RenderObject} renderObject - The render object. + */ + updateForRender(renderObject: RenderObject): void; + /** + * Initializes the geometry of the given render object. + * + * @param {RenderObject} renderObject - The render object. + */ + initGeometry(renderObject: RenderObject): void; + /** + * Updates the geometry attributes of the given render object. + * + * @param {RenderObject} renderObject - The render object. + */ + updateAttributes(renderObject: RenderObject): void; + /** + * Updates the given attribute. + * + * @param {BufferAttribute} attribute - The attribute to update. + * @param {number} type - The attribute type. + */ + updateAttribute(attribute: BufferAttribute | InterleavedBufferAttribute, type: AttributeType): void; + /** + * Returns the indirect buffer attribute of the given render object. + * + * @param {RenderObject} renderObject - The render object. + * @return {?BufferAttribute} The indirect attribute. `null` if no indirect drawing is used. + */ + getIndirect(renderObject: RenderObject): import("./IndirectStorageBufferAttribute.js").default | null; + /** + * Returns the index of the given render object's geometry. This is implemented + * in a method to return a wireframe index if necessary. + * + * @param {RenderObject} renderObject - The render object. + * @return {?BufferAttribute} The index. Returns `null` for non-indexed geometries. + */ + getIndex(renderObject: RenderObject): BufferAttribute | null; +} +export default Geometries; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/IndirectStorageBufferAttribute.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/IndirectStorageBufferAttribute.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..925294395a2c07c8c5ac12e5d20f9d04b0dedb8c --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/IndirectStorageBufferAttribute.d.ts @@ -0,0 +1,10 @@ +import { TypedArray } from "../../core/BufferAttribute.js"; +import StorageBufferAttribute from "./StorageBufferAttribute.js"; + +declare class IndirectStorageBufferAttribute extends StorageBufferAttribute { + readonly isIndirectStorageBufferAttribute: true; + + constructor(array: TypedArray, itemSize: number); +} + +export default IndirectStorageBufferAttribute; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Info.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Info.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..aa0621cdc0a6e35e4d3e0f446adf78d34dfb9e2b --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Info.d.ts @@ -0,0 +1,50 @@ +import { Object3D } from "../../core/Object3D.js"; +/** + * This renderer module provides a series of statistical information + * about the GPU memory and the rendering process. Useful for debugging + * and monitoring. + */ +declare class Info { + autoReset: boolean; + frame: number; + calls: number; + render: { + calls: number; + frameCalls: number; + drawCalls: number; + triangles: number; + points: number; + lines: number; + timestamp: number; + }; + compute: { + calls: number; + frameCalls: number; + timestamp: number; + }; + memory: { + geometries: number; + textures: number; + }; + /** + * Constructs a new info component. + */ + constructor(); + /** + * This method should be executed per draw call and updates the corresponding metrics. + * + * @param {Object3D} object - The 3D object that is going to be rendered. + * @param {number} count - The vertex or index count. + * @param {number} instanceCount - The instance count. + */ + update(object: Object3D, count: number, instanceCount: number): void; + /** + * Resets frame related metrics. + */ + reset(): void; + /** + * Performs a complete reset of the object. + */ + dispose(): void; +} +export default Info; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Lighting.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Lighting.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..72842e6e7a3c6a201c64f42db4578f8be20d3cf3 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Lighting.d.ts @@ -0,0 +1,15 @@ +import { Camera } from "../../cameras/Camera.js"; +import { Object3D } from "../../core/Object3D.js"; +import { Light } from "../../lights/Light.js"; +import LightsNode from "../../nodes/lighting/LightsNode.js"; +import ChainMap from "./ChainMap.js"; + +declare class Lighting extends ChainMap<[Object3D, Camera], LightsNode> { + constructor(); + + createNode(lights?: Light[]): LightsNode; + + getNode(scene: Object3D, camera: Camera): LightsNode; +} + +export default Lighting; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Pipeline.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Pipeline.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6e7fae7b1b4a01ddd6cb05a69dab1632b84a38ea --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Pipeline.d.ts @@ -0,0 +1,17 @@ +/** + * Abstract class for representing pipelines. + * + * @private + * @abstract + */ +declare class Pipeline { + cacheKey: string; + usedTimes: number; + /** + * Constructs a new pipeline. + * + * @param {string} cacheKey - The pipeline's cache key. + */ + constructor(cacheKey: string); +} +export default Pipeline; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Pipelines.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Pipelines.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6203e6ab84ce9fe5647e763bc4dabdfb56ae386d --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Pipelines.d.ts @@ -0,0 +1,172 @@ +import ComputeNode from "../../nodes/gpgpu/ComputeNode.js"; +import Backend from "./Backend.js"; +import Binding from "./Binding.js"; +import Bindings from "./Bindings.js"; +import ComputePipeline from "./ComputePipeline.js"; +import DataMap from "./DataMap.js"; +import Nodes from "./nodes/Nodes.js"; +import Pipeline from "./Pipeline.js"; +import ProgrammableStage from "./ProgrammableStage.js"; +import RenderObject from "./RenderObject.js"; +import RenderPipeline from "./RenderPipeline.js"; +interface ComputeNodeData { + version: number; + pipeline: ComputePipeline; +} +interface RenderObjectData { + pipeline: RenderPipeline; +} +/** + * This renderer module manages the pipelines of the renderer. + * + * @private + * @augments DataMap + */ +declare class Pipelines extends DataMap<{ + computeNode: { + key: ComputeNode; + value: ComputeNodeData; + }; + renderObject: { + key: RenderObject; + value: RenderObjectData; + }; +}> { + backend: Backend; + nodes: Nodes; + bindings: Bindings | null; + caches: Map; + programs: { + vertex: Map; + fragment: Map; + compute: Map; + }; + /** + * Constructs a new pipeline management component. + * + * @param {Backend} backend - The renderer's backend. + * @param {Nodes} nodes - Renderer component for managing nodes related logic. + */ + constructor(backend: Backend, nodes: Nodes); + /** + * Returns a compute pipeline for the given compute node. + * + * @param {Node} computeNode - The compute node. + * @param {Array} bindings - The bindings. + * @return {ComputePipeline} The compute pipeline. + */ + getForCompute(computeNode: ComputeNode, bindings: Binding[]): ComputePipeline; + /** + * Returns a render pipeline for the given render object. + * + * @param {RenderObject} renderObject - The render object. + * @param {?Array} [promises=null] - An array of compilation promises which is only relevant in context of `Renderer.compileAsync()`. + * @return {RenderPipeline} The render pipeline. + */ + getForRender(renderObject: RenderObject, promises?: Promise[] | null): RenderPipeline; + /** + * Deletes the pipeline for the given render object. + * + * @param {RenderObject} object - The render object. + * @return {?Object} The deleted dictionary. + */ + delete(object: ComputeNode | RenderObject): never; + /** + * Frees internal resources. + */ + dispose(): void; + /** + * Updates the pipeline for the given render object. + * + * @param {RenderObject} renderObject - The render object. + */ + updateForRender(renderObject: RenderObject): void; + /** + * Returns a compute pipeline for the given parameters. + * + * @private + * @param {Node} computeNode - The compute node. + * @param {ProgrammableStage} stageCompute - The programmable stage representing the compute shader. + * @param {string} cacheKey - The cache key. + * @param {Array} bindings - The bindings. + * @return {ComputePipeline} The compute pipeline. + */ + _getComputePipeline( + computeNode: ComputeNode, + stageCompute: ProgrammableStage, + cacheKey: string, + bindings: Binding[], + ): ComputePipeline; + /** + * Returns a render pipeline for the given parameters. + * + * @private + * @param {RenderObject} renderObject - The render object. + * @param {ProgrammableStage} stageVertex - The programmable stage representing the vertex shader. + * @param {ProgrammableStage} stageFragment - The programmable stage representing the fragment shader. + * @param {string} cacheKey - The cache key. + * @param {?Array} promises - An array of compilation promises which is only relevant in context of `Renderer.compileAsync()`. + * @return {ComputePipeline} The compute pipeline. + */ + _getRenderPipeline( + renderObject: RenderObject, + stageVertex: ProgrammableStage, + stageFragment: ProgrammableStage, + cacheKey: string, + promises: Promise[] | null, + ): RenderPipeline; + /** + * Computes a cache key representing a compute pipeline. + * + * @private + * @param {Node} computeNode - The compute node. + * @param {ProgrammableStage} stageCompute - The programmable stage representing the compute shader. + * @return {string} The cache key. + */ + _getComputeCacheKey(computeNode: ComputeNode, stageCompute: ProgrammableStage): string; + /** + * Computes a cache key representing a render pipeline. + * + * @private + * @param {RenderObject} renderObject - The render object. + * @param {ProgrammableStage} stageVertex - The programmable stage representing the vertex shader. + * @param {ProgrammableStage} stageFragment - The programmable stage representing the fragment shader. + * @return {string} The cache key. + */ + _getRenderCacheKey( + renderObject: RenderObject, + stageVertex: ProgrammableStage, + stageFragment: ProgrammableStage, + ): string; + /** + * Releases the given pipeline. + * + * @private + * @param {Pipeline} pipeline - The pipeline to release. + */ + _releasePipeline(pipeline: Pipeline): void; + /** + * Releases the shader program. + * + * @private + * @param {Object} program - The shader program to release. + */ + _releaseProgram(program: ProgrammableStage): void; + /** + * Returns `true` if the compute pipeline for the given compute node requires an update. + * + * @private + * @param {Node} computeNode - The compute node. + * @return {boolean} Whether the compute pipeline for the given compute node requires an update or not. + */ + _needsComputeUpdate(computeNode: ComputeNode): boolean; + /** + * Returns `true` if the render pipeline for the given render object requires an update. + * + * @private + * @param {RenderObject} renderObject - The render object. + * @return {boolean} Whether the render object for the given render object requires an update or not. + */ + _needsRenderUpdate(renderObject: RenderObject): true | void; +} +export default Pipelines; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/PostProcessing.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/PostProcessing.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..65d5cc93bcf4e1196aec836caacc73e7af5c47cc --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/PostProcessing.d.ts @@ -0,0 +1,21 @@ +import { Node } from "../../nodes/Nodes.js"; +import Renderer from "./Renderer.js"; + +declare class PostProcessing { + renderer: Renderer; + outputNode: Node; + + outputColorTransform: boolean; + + needsUpdate: boolean; + + constructor(renderer: Renderer, outputNode?: Node); + + render(): void; + + dispose(): void; + + renderAsync(): Promise; +} + +export default PostProcessing; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/ProgrammableStage.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/ProgrammableStage.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9c54ca9658d6d296c532844413fadf52a60e7dc6 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/ProgrammableStage.d.ts @@ -0,0 +1,33 @@ +import NodeAttribute from "../../nodes/core/NodeAttribute.js"; +/** + * Class for representing programmable stages which are vertex, + * fragment or compute shaders. Unlike fixed-function states (like blending), + * they represent the programmable part of a pipeline. + * + * @private + */ +declare class ProgrammableStage { + id: number; + code: string; + stage: "compute" | "vertex" | "fragment"; + name: string; + attributes: NodeAttribute[] | null; + usedTimes: number; + /** + * Constructs a new programmable stage. + * + * @param {string} code - The shader code. + * @param {('vertex'|'fragment'|'compute')} stage - The type of stage. + * @param {string} name - The name of the shader. + * @param {?Array} [transforms=null] - The transforms (only relevant for compute stages with WebGL 2 which uses Transform Feedback). + * @param {?Array} [attributes=null] - The attributes (only relevant for compute stages with WebGL 2 which uses Transform Feedback). + */ + constructor( + code: string, + stage: "compute" | "vertex" | "fragment", + name: string, + transforms?: null, + attributes?: NodeAttribute[] | null, + ); +} +export default ProgrammableStage; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/QuadMesh.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/QuadMesh.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ee2bb93bae6bbeafe88b62c20a2e945519bd753b --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/QuadMesh.d.ts @@ -0,0 +1,16 @@ +import { OrthographicCamera } from "../../cameras/OrthographicCamera.js"; +import { Material } from "../../materials/Material.js"; +import { Mesh } from "../../objects/Mesh.js"; +import Renderer from "./Renderer.js"; + +export default class QuadMesh extends Mesh { + camera: OrthographicCamera; + + readonly isQuadMesh: true; + + constructor(material?: Material | null); + + renderAsync(renderer: Renderer): Promise; + + render(renderer: Renderer): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/RenderBundle.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/RenderBundle.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f0ed002dd4ac5d1f7bdb258d127c06d56154a880 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/RenderBundle.d.ts @@ -0,0 +1,20 @@ +import { Camera } from "../../cameras/Camera.js"; +import BundleGroup from "./BundleGroup.js"; +/** + * This module is used to represent render bundles inside the renderer + * for further processing. + * + * @private + */ +declare class RenderBundle { + bundleGroup: BundleGroup; + camera: Camera; + /** + * Constructs a new bundle group. + * + * @param {BundleGroup} bundleGroup - The bundle group. + * @param {Camera} camera - The camera the bundle group is rendered with. + */ + constructor(bundleGroup: BundleGroup, camera: Camera); +} +export default RenderBundle; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/RenderBundles.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/RenderBundles.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8ad36964b33b5216e8be6707c1bd889a38b6d165 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/RenderBundles.d.ts @@ -0,0 +1,29 @@ +import { Camera } from "../../cameras/Camera.js"; +import BundleGroup from "./BundleGroup.js"; +import ChainMap from "./ChainMap.js"; +import RenderBundle from "./RenderBundle.js"; +/** + * This renderer module manages render bundles. + * + * @private + */ +declare class RenderBundles { + bundles: ChainMap; + /** + * Constructs a new render bundle management component. + */ + constructor(); + /** + * Returns a render bundle for the given bundle group and camera. + * + * @param {BundleGroup} bundleGroup - The bundle group. + * @param {Camera} camera - The camera the bundle group is rendered with. + * @return {RenderBundle} The render bundle. + */ + get(bundleGroup: BundleGroup, camera: Camera): RenderBundle; + /** + * Frees all internal resources. + */ + dispose(): void; +} +export default RenderBundles; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/RenderContext.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/RenderContext.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..79f93fd96420c6f07a513724890a7d610f8f27da --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/RenderContext.d.ts @@ -0,0 +1,67 @@ +import { RenderTarget } from "../../core/RenderTarget.js"; +import { Vector4 } from "../../math/Vector4.js"; +import { DepthTexture } from "../../textures/DepthTexture.js"; +import { Texture } from "../../textures/Texture.js"; +import ClippingContext from "./ClippingContext.js"; +/** + * Any render or compute command is executed in a specific context that defines + * the state of the renderer and its backend. Typical examples for such context + * data are the current clear values or data from the active framebuffer. This + * module is used to represent these contexts as objects. + * + * @private + */ +declare class RenderContext { + id: number; + color: boolean; + clearColor: boolean; + clearColorValue: { + r: number; + g: number; + b: number; + a: number; + }; + depth: boolean; + clearDepth: boolean; + clearDepthValue: number; + stencil: boolean; + clearStencil: boolean; + clearStencilValue: number; + viewport: boolean; + viewportValue: Vector4; + scissor: boolean; + scissorValue: Vector4; + renderTarget: RenderTarget | null; + textures: Texture[] | null; + depthTexture: DepthTexture | null; + activeCubeFace: number; + sampleCount: number; + width: number; + height: number; + occlusionQueryCount: number; + clippingContext: ClippingContext | null; + readonly isRenderContext: true; + depthClearValue?: number | undefined; + stencilClearValue?: number | undefined; + activeMipmapLevel?: number | undefined; + /** + * Constructs a new render context. + */ + constructor(); + /** + * Returns the cache key of this render context. + * + * @return {number} The cache key. + */ + getCacheKey(): number; +} +/** + * Computes a cache key for the given render context. This key + * should identify the render target state so it is possible to + * configure the correct attachments in the respective backend. + * + * @param {RenderContext} renderContext - The render context. + * @return {number} The cache key. + */ +export declare function getCacheKey(renderContext: RenderContext): number; +export default RenderContext; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/RenderContexts.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/RenderContexts.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1be5d0d59b88e2599a84dc0d58f30b5d1cf53a83 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/RenderContexts.d.ts @@ -0,0 +1,48 @@ +import { Camera } from "../../cameras/Camera.js"; +import { RenderTarget } from "../../core/RenderTarget.js"; +import { Scene } from "../../scenes/Scene.js"; +import ChainMap from "./ChainMap.js"; +import RenderContext from "./RenderContext.js"; +/** + * This module manages the render contexts of the renderer. + * + * @private + */ +declare class RenderContexts { + chainMaps: { + [attachmentState: string]: ChainMap | undefined; + }; + /** + * Constructs a new render context management component. + */ + constructor(); + /** + * Returns a render context for the given scene, camera and render target. + * + * @param {Scene} scene - The scene. + * @param {Camera} camera - The camera that is used to render the scene. + * @param {?RenderTarget} [renderTarget=null] - The active render target. + * @return {RenderContext} The render context. + */ + get(scene: Scene, camera: Camera, renderTarget?: RenderTarget | null): RenderContext; + /** + * Returns a render context intended for clear operations. + * + * @param {?RenderTarget} [renderTarget=null] - The active render target. + * @return {RenderContext} The render context. + */ + getForClear(renderTarget?: RenderTarget | null): RenderContext; + /** + * Returns a chain map for the given attachment state. + * + * @private + * @param {string} attachmentState - The attachment state. + * @return {ChainMap} The chain map. + */ + _getChainMap(attachmentState: string): ChainMap; + /** + * Frees internal resources. + */ + dispose(): void; +} +export default RenderContexts; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/RenderList.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/RenderList.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..aefd9da09913f8d00eada4b1a7d8f7036f9c15e8 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/RenderList.d.ts @@ -0,0 +1,160 @@ +import { Camera } from "../../cameras/Camera.js"; +import { BufferGeometry, GeometryGroup } from "../../core/BufferGeometry.js"; +import { Object3D } from "../../core/Object3D.js"; +import { Light } from "../../lights/Light.js"; +import { Material } from "../../materials/Material.js"; +import { LightsNode } from "../../nodes/Nodes.js"; +import BundleGroup from "./BundleGroup.js"; +import ClippingContext from "./ClippingContext.js"; +import Lighting from "./Lighting.js"; +export interface Bundle { + bundleGroup: BundleGroup; + camera: Camera; + renderList: RenderList; +} +export interface RenderItem { + id: number | null; + object: Object3D | null; + geometry: BufferGeometry | null; + material: Material | null; + groupOrder: number | null; + renderOrder: number | null; + z: number | null; + group: GeometryGroup | null; + clippingContext: ClippingContext | null; +} +/** + * When the renderer analyzes the scene at the beginning of a render call, + * it stores 3D object for further processing in render lists. Depending on the + * properties of a 3D objects (like their transformation or material state), the + * objects are maintained in ordered lists for the actual rendering. + * + * Render lists are unique per scene and camera combination. + * + * @private + * @augments Pipeline + */ +declare class RenderList { + renderItems: RenderItem[]; + renderItemsIndex: number; + opaque: RenderItem[]; + transparentDoublePass: RenderItem[]; + transparent: RenderItem[]; + bundles: Bundle[]; + lightsNode: LightsNode; + lightsArray: Light[]; + scene: Object3D; + camera: Camera; + occlusionQueryCount: number; + /** + * Constructs a render list. + * + * @param {Lighting} lighting - The lighting management component. + * @param {Scene} scene - The scene. + * @param {Camera} camera - The camera the scene is rendered with. + */ + constructor(lighting: Lighting, scene: Object3D, camera: Camera); + /** + * This method is called right at the beginning of a render call + * before the scene is analyzed. It prepares the internal data + * structures for the upcoming render lists generation. + * + * @return {RenderList} A reference to this render list. + */ + begin(): this; + /** + * Returns a render item for the giving render item state. The state is defined + * by a series of object-related parameters. + * + * The method avoids object creation by holding render items and reusing them in + * subsequent render calls (just with different property values). + * + * @param {Object3D} object - The 3D object. + * @param {BufferGeometry} geometry - The 3D object's geometry. + * @param {Material} material - The 3D object's material. + * @param {number} groupOrder - The current group order. + * @param {number} z - Th 3D object's depth value (z value in clip space). + * @param {?number} group - {?Object} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. + * @param {ClippingContext} clippingContext - The current clipping context. + * @return {Object} The render item. + */ + getNextRenderItem( + object: Object3D, + geometry: BufferGeometry, + material: Material, + groupOrder: number, + z: number, + group: GeometryGroup | null, + clippingContext: ClippingContext | null, + ): RenderItem; + /** + * Pushes the given object as a render item to the internal render lists. + * The selected lists depend on the object properties. + * + * @param {Object3D} object - The 3D object. + * @param {BufferGeometry} geometry - The 3D object's geometry. + * @param {Material} material - The 3D object's material. + * @param {number} groupOrder - The current group order. + * @param {number} z - Th 3D object's depth value (z value in clip space). + * @param {?number} group - {?Object} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. + * @param {ClippingContext} clippingContext - The current clipping context. + */ + push( + object: Object3D, + geometry: BufferGeometry, + material: Material, + groupOrder: number, + z: number, + group: GeometryGroup | null, + clippingContext: ClippingContext | null, + ): void; + /** + * Inserts the given object as a render item at the start of the internal render lists. + * The selected lists depend on the object properties. + * + * @param {Object3D} object - The 3D object. + * @param {BufferGeometry} geometry - The 3D object's geometry. + * @param {Material} material - The 3D object's material. + * @param {number} groupOrder - The current group order. + * @param {number} z - Th 3D object's depth value (z value in clip space). + * @param {?number} group - {?Object} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. + * @param {ClippingContext} clippingContext - The current clipping context. + */ + unshift( + object: Object3D, + geometry: BufferGeometry, + material: Material, + groupOrder: number, + z: number, + group: GeometryGroup | null, + clippingContext: ClippingContext | null, + ): void; + /** + * Pushes render bundle group data into the render list. + * + * @param {Object} group - Bundle group data. + */ + pushBundle(group: Bundle): void; + /** + * Pushes a light into the render list. + * + * @param {Light} light - The light. + */ + pushLight(light: Light): void; + /** + * Sorts the internal render lists. + * + * @param {?function(any, any): number} customOpaqueSort - A custom sort function for opaque objects. + * @param {?function(any, any): number} customTransparentSort - A custom sort function for transparent objects. + */ + sort( + customOpaqueSort: ((a: RenderItem, b: RenderItem) => number) | null, + customTransparentSort: ((a: RenderItem, b: RenderItem) => number) | null, + ): void; + /** + * This method performs finalizing tasks right after the render lists + * have been generated. + */ + finish(): void; +} +export default RenderList; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/RenderLists.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/RenderLists.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fce404a7f71da541ae655e099e0b5193d1e43c4d --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/RenderLists.d.ts @@ -0,0 +1,34 @@ +import { Camera } from "../../cameras/Camera.js"; +import { Object3D } from "../../core/Object3D.js"; +import ChainMap from "./ChainMap.js"; +import Lighting from "./Lighting.js"; +import RenderList from "./RenderList.js"; +/** + * This renderer module manages the render lists which are unique + * per scene and camera combination. + * + * @private + */ +declare class RenderLists { + lighting: Lighting; + lists: ChainMap; + /** + * Constructs a render lists management component. + * + * @param {Lighting} lighting - The lighting management component. + */ + constructor(lighting: Lighting); + /** + * Returns a render list for the given scene and camera. + * + * @param {Scene} scene - The scene. + * @param {Camera} camera - The camera. + * @return {RenderList} The render list. + */ + get(scene: Object3D, camera: Camera): RenderList; + /** + * Frees all internal resources. + */ + dispose(): void; +} +export default RenderLists; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/RenderObject.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/RenderObject.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b41528e4b189db919b8bfbd533a7ed7ddbad7d2b --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/RenderObject.d.ts @@ -0,0 +1,266 @@ +import { Camera } from "../../cameras/Camera.js"; +import { BufferAttribute } from "../../core/BufferAttribute.js"; +import { BufferGeometry } from "../../core/BufferGeometry.js"; +import { InterleavedBuffer } from "../../core/InterleavedBuffer.js"; +import { InterleavedBufferAttribute } from "../../core/InterleavedBufferAttribute.js"; +import { Object3D } from "../../core/Object3D.js"; +import { Material } from "../../materials/Material.js"; +import NodeMaterialObserver from "../../materials/nodes/manager/NodeMaterialObserver.js"; +import { LightsNode } from "../../nodes/Nodes.js"; +import { Scene } from "../../scenes/Scene.js"; +import BindGroup from "./BindGroup.js"; +import BundleGroup from "./BundleGroup.js"; +import ClippingContext from "./ClippingContext.js"; +import Geometries from "./Geometries.js"; +import NodeBuilderState from "./nodes/NodeBuilderState.js"; +import Nodes from "./nodes/Nodes.js"; +import RenderContext from "./RenderContext.js"; +import Renderer from "./Renderer.js"; +import RenderPipeline from "./RenderPipeline.js"; +/** + * A render object is the renderer's representation of single entity that gets drawn + * with a draw command. There is no unique mapping of render objects to 3D objects in the + * scene since render objects also depend from the used material, the current render context + * and the current scene's lighting. + * + * In general, the basic process of the renderer is: + * + * - Analyze the 3D objects in the scene and generate render lists containing render items. + * - Process the render lists by calling one or more render commands for each render item. + * - For each render command, request a render object and perform the draw. + * + * The module provides an interface to get data required for the draw command like the actual + * draw parameters or vertex buffers. It also holds a series of caching related methods since + * creating render objects should only be done when necessary. + * + * @private + */ +declare class RenderObject { + _nodes: Nodes; + _geometries: Geometries; + id: number; + renderer: Renderer; + object: Object3D; + material: Material; + scene: Scene; + camera: Camera; + lightsNode: LightsNode; + context: RenderContext; + geometry: BufferGeometry; + version: number; + drawRange: { + start: number; + count: number; + } | null; + attributes: Array | null; + attributesId: { + [attributeName: string]: number; + } | null; + pipeline: RenderPipeline | null; + group: { + start: number; + count: number; + } | null; + vertexBuffers: Array | null; + drawParams: { + vertexCount: number; + firstVertex: number; + instanceCount: number; + firstInstance: number; + } | null; + bundle: BundleGroup | null; + clippingContext: ClippingContext | null; + clippingContextCacheKey: string; + initialNodesCacheKey: number; + initialCacheKey: number; + _nodeBuilderState: NodeBuilderState | null; + _bindings: BindGroup[] | null; + _monitor: NodeMaterialObserver | null; + onDispose: (() => void) | null; + readonly isRenderObject: true; + onMaterialDispose: () => void; + onGeometryDispose: () => void; + /** + * Constructs a new render object. + * + * @param {Nodes} nodes - Renderer component for managing nodes related logic. + * @param {Geometries} geometries - Renderer component for managing geometries. + * @param {Renderer} renderer - The renderer. + * @param {Object3D} object - The 3D object. + * @param {Material} material - The 3D object's material. + * @param {Scene} scene - The scene the 3D object belongs to. + * @param {Camera} camera - The camera the object should be rendered with. + * @param {LightsNode} lightsNode - The lights node. + * @param {RenderContext} renderContext - The render context. + * @param {ClippingContext} clippingContext - The clipping context. + */ + constructor( + nodes: Nodes, + geometries: Geometries, + renderer: Renderer, + object: Object3D, + material: Material, + scene: Scene, + camera: Camera, + lightsNode: LightsNode, + renderContext: RenderContext, + clippingContext: ClippingContext | null, + ); + /** + * Updates the clipping context. + * + * @param {ClippingContext} context - The clipping context to set. + */ + updateClipping(context: ClippingContext): void; + /** + * Whether the clipping requires an update or not. + * + * @type {boolean} + * @readonly + */ + get clippingNeedsUpdate(): boolean; + /** + * The number of clipping planes defined in context of hardware clipping. + * + * @type {number} + * @readonly + */ + get hardwareClippingPlanes(): number; + /** + * Returns the node builder state of this render object. + * + * @return {NodeBuilderState} The node builder state. + */ + getNodeBuilderState(): NodeBuilderState; + /** + * Returns the node material observer of this render object. + * + * @return {NodeMaterialObserver} The node material observer. + */ + getMonitor(): NodeMaterialObserver; + /** + * Returns an array of bind groups of this render object. + * + * @return {Array} The bindings. + */ + getBindings(): BindGroup[]; + /** + * Returns a binding group by group name of this render object. + * + * @param {string} name - The name of the binding group. + * @return {?BindGroup} The bindings. + */ + getBindingGroup(name: string): BindGroup | undefined; + /** + * Returns the index of the render object's geometry. + * + * @return {?BufferAttribute} The index. Returns `null` for non-indexed geometries. + */ + getIndex(): BufferAttribute | null; + /** + * Returns the indirect buffer attribute. + * + * @return {?BufferAttribute} The indirect attribute. `null` if no indirect drawing is used. + */ + getIndirect(): import("./IndirectStorageBufferAttribute.js").default | null; + /** + * Returns an array that acts as a key for identifying the render object in a chain map. + * + * @return {Array} An array with object references. + */ + getChainArray(): readonly [ + Object3D, + Material, + RenderContext, + LightsNode, + ]; + /** + * This method is used when the geometry of a 3D object has been exchanged and the + * respective render object now requires an update. + * + * @param {BufferGeometry} geometry - The geometry to set. + */ + setGeometry(geometry: BufferGeometry): void; + /** + * Returns the buffer attributes of the render object. The returned array holds + * attribute definitions on geometry and node level. + * + * @return {Array} An array with buffer attributes. + */ + getAttributes(): (BufferAttribute | InterleavedBufferAttribute)[]; + /** + * Returns the vertex buffers of the render object. + * + * @return {Array} An array with buffer attribute or interleaved buffers. + */ + getVertexBuffers(): (BufferAttribute | InterleavedBuffer)[] | null; + /** + * Returns the draw parameters for the render object. + * + * @return {?{vertexCount: number, firstVertex: number, instanceCount: number, firstInstance: number}} The draw parameters. + */ + getDrawParameters(): { + vertexCount: number; + firstVertex: number; + instanceCount: number; + firstInstance: number; + } | null; + /** + * Returns the render object's geometry cache key. + * + * The geometry cache key is part of the material cache key. + * + * @return {string} The geometry cache key. + */ + getGeometryCacheKey(): string; + /** + * Returns the render object's material cache key. + * + * The material cache key is part of the render object cache key. + * + * @return {number} The material cache key. + */ + getMaterialCacheKey(): number; + /** + * Whether the geometry requires an update or not. + * + * @type {boolean} + * @readonly + */ + get needsGeometryUpdate(): boolean; + /** + * Whether the render object requires an update or not. + * + * Note: There are two distinct places where render objects are checked for an update. + * + * 1. In `RenderObjects.get()` which is executed when the render object is request. This + * method checks the `needsUpdate` flag and recreates the render object if necessary. + * 2. In `Renderer._renderObjectDirect()` right after getting the render object via + * `RenderObjects.get()`. The render object's NodeMaterialObserver is then used to detect + * a need for a refresh due to material, geometry or object related value changes. + * + * TODO: Investigate if it's possible to merge both steps so there is only a single place + * that performs the 'needsUpdate' check. + * + * @type {boolean} + * @readonly + */ + get needsUpdate(): boolean; + /** + * Returns the dynamic cache key which represents a key that is computed per draw command. + * + * @return {number} The cache key. + */ + getDynamicCacheKey(): number; + /** + * Returns the render object's cache key. + * + * @return {number} The cache key. + */ + getCacheKey(): number; + /** + * Frees internal resources. + */ + dispose(): void; +} +export default RenderObject; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/RenderObjects.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/RenderObjects.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..84fa1ce8467ab80d06182f3e2caab018e61d93a6 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/RenderObjects.d.ts @@ -0,0 +1,118 @@ +import { Camera } from "../../cameras/Camera.js"; +import { Object3D } from "../../core/Object3D.js"; +import { Material } from "../../materials/Material.js"; +import LightsNode from "../../nodes/lighting/LightsNode.js"; +import { Scene } from "../../scenes/Scene.js"; +import Bindings from "./Bindings.js"; +import ChainMap from "./ChainMap.js"; +import ClippingContext from "./ClippingContext.js"; +import Geometries from "./Geometries.js"; +import Info from "./Info.js"; +import Nodes from "./nodes/Nodes.js"; +import Pipelines from "./Pipelines.js"; +import RenderContext from "./RenderContext.js"; +import Renderer from "./Renderer.js"; +import RenderObject from "./RenderObject.js"; +/** + * This module manages the render objects of the renderer. + * + * @private + */ +declare class RenderObjects { + renderer: Renderer; + nodes: Nodes; + geometries: Geometries; + pipelines: Pipelines; + bindings: Bindings; + info: Info; + chainMaps: { + [passId: string]: ChainMap; + }; + /** + * Constructs a new render object management component. + * + * @param {Renderer} renderer - The renderer. + * @param {Nodes} nodes - Renderer component for managing nodes related logic. + * @param {Geometries} geometries - Renderer component for managing geometries. + * @param {Pipelines} pipelines - Renderer component for managing pipelines. + * @param {Bindings} bindings - Renderer component for managing bindings. + * @param {Info} info - Renderer component for managing metrics and monitoring data. + */ + constructor( + renderer: Renderer, + nodes: Nodes, + geometries: Geometries, + pipelines: Pipelines, + bindings: Bindings, + info: Info, + ); + /** + * Returns a render object for the given object and state data. + * + * @param {Object3D} object - The 3D object. + * @param {Material} material - The 3D object's material. + * @param {Scene} scene - The scene the 3D object belongs to. + * @param {Camera} camera - The camera the 3D object should be rendered with. + * @param {LightsNode} lightsNode - The lights node. + * @param {RenderContext} renderContext - The render context. + * @param {ClippingContext} clippingContext - The clipping context. + * @param {string} [passId] - An optional ID for identifying the pass. + * @return {RenderObject} The render object. + */ + get( + object: Object3D, + material: Material, + scene: Scene, + camera: Camera, + lightsNode: LightsNode, + renderContext: RenderContext, + clippingContext: ClippingContext | null, + passId?: string | undefined, + ): RenderObject; + /** + * Returns a chain map for the given pass ID. + * + * @param {string} [passId='default'] - The pass ID. + * @return {ChainMap} The chain map. + */ + getChainMap( + passId?: string, + ): ChainMap< + readonly [Object3D, Material, RenderContext, LightsNode], + RenderObject + >; + /** + * Frees internal resources. + */ + dispose(): void; + /** + * Factory method for creating render objects with the given list of parameters. + * + * @param {Nodes} nodes - Renderer component for managing nodes related logic. + * @param {Geometries} geometries - Renderer component for managing geometries. + * @param {Renderer} renderer - The renderer. + * @param {Object3D} object - The 3D object. + * @param {Material} material - The object's material. + * @param {Scene} scene - The scene the 3D object belongs to. + * @param {Camera} camera - The camera the object should be rendered with. + * @param {LightsNode} lightsNode - The lights node. + * @param {RenderContext} renderContext - The render context. + * @param {ClippingContext} clippingContext - The clipping context. + * @param {string} [passId] - An optional ID for identifying the pass. + * @return {RenderObject} The render object. + */ + createRenderObject( + nodes: Nodes, + geometries: Geometries, + renderer: Renderer, + object: Object3D, + material: Material, + scene: Scene, + camera: Camera, + lightsNode: LightsNode, + renderContext: RenderContext, + clippingContext: ClippingContext | null, + passId: string | undefined, + ): RenderObject; +} +export default RenderObjects; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/RenderPipeline.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/RenderPipeline.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bd9ec21c2f2c45243dadcf9f79cf9ee7f0452c83 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/RenderPipeline.d.ts @@ -0,0 +1,21 @@ +import Pipeline from "./Pipeline.js"; +import ProgrammableStage from "./ProgrammableStage.js"; +/** + * Class for representing render pipelines. + * + * @private + * @augments Pipeline + */ +declare class RenderPipeline extends Pipeline { + vertexProgram: ProgrammableStage; + fragmentProgram: ProgrammableStage; + /** + * Constructs a new render pipeline. + * + * @param {string} cacheKey - The pipeline's cache key. + * @param {ProgrammableStage} vertexProgram - The pipeline's vertex shader. + * @param {ProgrammableStage} fragmentProgram - The pipeline's fragment shader. + */ + constructor(cacheKey: string, vertexProgram: ProgrammableStage, fragmentProgram: ProgrammableStage); +} +export default RenderPipeline; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Renderer.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Renderer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5e8c139c2a92ede954d97b298419d54a768aed5b --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Renderer.d.ts @@ -0,0 +1,996 @@ +import { Camera } from "../../cameras/Camera.js"; +import { ShadowMapType, TextureDataType, TimestampQuery, ToneMapping } from "../../constants.js"; +import { BufferAttribute } from "../../core/BufferAttribute.js"; +import { BufferGeometry, GeometryGroup } from "../../core/BufferGeometry.js"; +import { Object3D } from "../../core/Object3D.js"; +import { RenderTarget } from "../../core/RenderTarget.js"; +import { Material } from "../../materials/Material.js"; +import { Box2 } from "../../math/Box2.js"; +import { Box3 } from "../../math/Box3.js"; +import { ColorRepresentation } from "../../math/Color.js"; +import { Vector2 } from "../../math/Vector2.js"; +import { Vector3 } from "../../math/Vector3.js"; +import { Vector4 } from "../../math/Vector4.js"; +import MRTNode from "../../nodes/core/MRTNode.js"; +import ComputeNode from "../../nodes/gpgpu/ComputeNode.js"; +import LightsNode from "../../nodes/lighting/LightsNode.js"; +import { Group } from "../../objects/Group.js"; +import { Scene } from "../../scenes/Scene.js"; +import { FramebufferTexture } from "../../textures/FramebufferTexture.js"; +import { Texture } from "../../textures/Texture.js"; +import Animation from "./Animation.js"; +import Attributes from "./Attributes.js"; +import Backend from "./Backend.js"; +import Background from "./Background.js"; +import Bindings from "./Bindings.js"; +import ClippingContext from "./ClippingContext.js"; +import Color4 from "./Color4.js"; +import Geometries from "./Geometries.js"; +import Info from "./Info.js"; +import Lighting from "./Lighting.js"; +import NodeLibrary from "./nodes/NodeLibrary.js"; +import Nodes from "./nodes/Nodes.js"; +import Pipelines from "./Pipelines.js"; +import QuadMesh from "./QuadMesh.js"; +import RenderBundle from "./RenderBundle.js"; +import RenderBundles from "./RenderBundles.js"; +import RenderContext from "./RenderContext.js"; +import RenderContexts from "./RenderContexts.js"; +import RenderList, { Bundle, RenderItem } from "./RenderList.js"; +import RenderLists from "./RenderLists.js"; +import RenderObjects from "./RenderObjects.js"; +import Textures from "./Textures.js"; +import XRManager from "./XRManager.js"; +interface Rectangle { + x: number; + y: number; + z: number; + w: number; +} +interface DeviceLostInfo { + api: "WebGL" | "WebGPU"; + message: string; + reason: string | null; + originalEvent: unknown; +} +export interface RendererParameters { + logarithmicDepthBuffer?: boolean | undefined; + alpha?: boolean | undefined; + depth?: boolean | undefined; + stencil?: boolean | undefined; + antialias?: boolean | undefined; + samples?: number | undefined; + getFallback?: ((error: unknown) => Backend) | null | undefined; + colorBufferType?: TextureDataType | undefined; + multiview?: boolean | undefined; +} +/** + * Base class for renderers. + */ +declare class Renderer { + readonly isRenderer: true; + domElement: HTMLCanvasElement; + backend: Backend; + samples: number; + autoClear: boolean; + autoClearColor: boolean; + autoClearDepth: boolean; + autoClearStencil: boolean; + alpha: boolean; + logarithmicDepthBuffer: boolean; + outputColorSpace: string; + toneMapping: ToneMapping; + toneMappingExposure: number; + sortObjects: boolean; + depth: boolean; + stencil: boolean; + info: Info; + library: NodeLibrary; + lighting: Lighting; + _getFallback: ((error: unknown) => Backend) | null; + _pixelRatio: number; + _width: number; + _height: number; + _viewport: Vector4; + _scissor: Vector4; + _scissorTest: boolean; + _attributes: Attributes | null; + _geometries: Geometries | null; + _nodes: Nodes | null; + _animation: Animation | null; + _bindings: Bindings | null; + _objects: RenderObjects | null; + _pipelines: Pipelines | null; + _bundles: RenderBundles | null; + _renderLists: RenderLists | null; + _renderContexts: RenderContexts | null; + _textures: Textures | null; + _background: Background | null; + _quad: QuadMesh; + _currentRenderContext: RenderContext | null; + _opaqueSort: ((a: RenderItem, b: RenderItem) => number) | null; + _transparentSort: ((a: RenderItem, b: RenderItem) => number) | null; + _frameBufferTarget: RenderTarget | null; + _clearColor: Color4; + _clearDepth: number; + _clearStencil: number; + _renderTarget: RenderTarget | null; + _activeCubeFace: number; + _activeMipmapLevel: number; + _outputRenderTarget: RenderTarget | null; + _mrt: MRTNode | null; + _renderObjectFunction: + | (( + object: Object3D, + scene: Scene, + camera: Camera, + geometry: BufferGeometry, + material: Material, + group: GeometryGroup, + lightsNode: LightsNode, + clippingContext: ClippingContext | null, + passId: string | null, + ) => void) + | null; + _currentRenderObjectFunction: + | (( + object: Object3D, + scene: Scene, + camera: Camera, + geometry: BufferGeometry, + material: Material, + group: GeometryGroup, + lightsNode: LightsNode, + clippingContext: ClippingContext | null, + passId: string | null, + ) => void) + | null; + _currentRenderBundle: RenderBundle | null; + _handleObjectFunction: ( + object: Object3D, + material: Material, + scene: Scene, + camera: Camera, + lightsNode: LightsNode, + group: GeometryGroup, + clippingContext: ClippingContext | null, + passId?: string, + ) => void; + _isDeviceLost: boolean; + onDeviceLost: (info: DeviceLostInfo) => void; + _colorBufferType: TextureDataType; + _initialized: boolean; + _initPromise: Promise | null; + _compilationPromises: Promise[] | null; + transparent: boolean; + opaque: boolean; + shadowMap: { + enabled: boolean; + type: ShadowMapType | null; + }; + xr: XRManager; + debug: { + checkShaderErrors: boolean; + onShaderError: + | (( + gl: WebGL2RenderingContext, + programGPU: WebGLProgram, + glVertexShader: WebGLShader, + glFragmentShader: WebGLShader, + ) => void) + | null; + getShaderAsync: (scene: Scene, camera: Camera, object: Object3D) => Promise<{ + fragmentShader: string | null; + vertexShader: string | null; + }>; + }; + localClippingEnabled?: boolean | undefined; + /** + * Renderer options. + * + * @typedef {Object} Renderer~Options + * @property {boolean} [logarithmicDepthBuffer=false] - Whether logarithmic depth buffer is enabled or not. + * @property {boolean} [alpha=true] - Whether the default framebuffer (which represents the final contents of the canvas) should be transparent or opaque. + * @property {boolean} [depth=true] - Whether the default framebuffer should have a depth buffer or not. + * @property {boolean} [stencil=false] - Whether the default framebuffer should have a stencil buffer or not. + * @property {boolean} [antialias=false] - Whether MSAA as the default anti-aliasing should be enabled or not. + * @property {number} [samples=0] - When `antialias` is `true`, `4` samples are used by default. This parameter can set to any other integer value than 0 + * to overwrite the default. + * @property {?Function} [getFallback=null] - This callback function can be used to provide a fallback backend, if the primary backend can't be targeted. + * @property {number} [colorBufferType=HalfFloatType] - Defines the type of color buffers. The default `HalfFloatType` is recommend for best + * quality. To save memory and bandwidth, `UnsignedByteType` might be used. This will reduce rendering quality though. + * @property {boolean} [multiview=false] - If set to `true`, the renderer will use multiview during WebXR rendering if supported. + */ + /** + * Constructs a new renderer. + * + * @param {Backend} backend - The backend the renderer is targeting (e.g. WebGPU or WebGL 2). + * @param {Renderer~Options} [parameters] - The configuration parameter. + */ + constructor(backend: Backend, parameters?: RendererParameters); + /** + * Initializes the renderer so it is ready for usage. + * + * @async + * @return {Promise} A Promise that resolves when the renderer has been initialized. + */ + init(): Promise; + /** + * The coordinate system of the renderer. The value of this property + * depends on the selected backend. Either `THREE.WebGLCoordinateSystem` or + * `THREE.WebGPUCoordinateSystem`. + * + * @readonly + * @type {number} + */ + get coordinateSystem(): import("../../constants.js").CoordinateSystem; + /** + * Compiles all materials in the given scene. This can be useful to avoid a + * phenomenon which is called "shader compilation stutter", which occurs when + * rendering an object with a new shader for the first time. + * + * If you want to add a 3D object to an existing scene, use the third optional + * parameter for applying the target scene. Note that the (target) scene's lighting + * and environment must be configured before calling this method. + * + * @async + * @param {Object3D} scene - The scene or 3D object to precompile. + * @param {Camera} camera - The camera that is used to render the scene. + * @param {?Scene} targetScene - If the first argument is a 3D object, this parameter must represent the scene the 3D object is going to be added. + * @return {Promise} A Promise that resolves when the compile has been finished. + */ + compileAsync(scene: Object3D, camera: Camera, targetScene?: Scene | null): Promise; + /** + * Renders the scene in an async fashion. + * + * @async + * @param {Object3D} scene - The scene or 3D object to render. + * @param {Camera} camera - The camera. + * @return {Promise} A Promise that resolves when the render has been finished. + */ + renderAsync(scene: Object3D, camera: Camera): Promise; + /** + * Can be used to synchronize CPU operations with GPU tasks. So when this method is called, + * the CPU waits for the GPU to complete its operation (e.g. a compute task). + * + * @async + * @return {Promise} A Promise that resolves when synchronization has been finished. + */ + waitForGPU(): Promise; + /** + * Enables or disables high precision for model-view and normal-view matrices. + * When enabled, will use CPU 64-bit precision for higher precision instead of GPU 32-bit for higher performance. + * + * NOTE: 64-bit precision is not compatible with `InstancedMesh` and `SkinnedMesh`. + * + * @param {boolean} value - Whether to enable or disable high precision. + * @type {boolean} + */ + set highPrecision(value: boolean); + /** + * Returns whether high precision is enabled or not. + * + * @return {boolean} Whether high precision is enabled or not. + * @type {boolean} + */ + get highPrecision(): boolean; + /** + * Sets the given MRT configuration. + * + * @param {MRTNode} mrt - The MRT node to set. + * @return {Renderer} A reference to this renderer. + */ + setMRT(mrt: MRTNode | null): this; + /** + * Returns the MRT configuration. + * + * @return {MRTNode} The MRT configuration. + */ + getMRT(): MRTNode | null; + /** + * Returns the color buffer type. + * + * @return {number} The color buffer type. + */ + getColorBufferType(): TextureDataType; + /** + * Default implementation of the device lost callback. + * + * @private + * @param {Object} info - Information about the context lost. + */ + _onDeviceLost(info: DeviceLostInfo): void; + /** + * Renders the given render bundle. + * + * @private + * @param {Object} bundle - Render bundle data. + * @param {Scene} sceneRef - The scene the render bundle belongs to. + * @param {LightsNode} lightsNode - The lights node. + */ + _renderBundle(bundle: Bundle, sceneRef: Scene, lightsNode: LightsNode): void; + /** + * Renders the scene or 3D object with the given camera. This method can only be called + * if the renderer has been initialized. + * + * The target of the method is the default framebuffer (meaning the canvas) + * or alternatively a render target when specified via `setRenderTarget()`. + * + * @param {Object3D} scene - The scene or 3D object to render. + * @param {Camera} camera - The camera to render the scene with. + * @return {?Promise} A Promise that resolve when the scene has been rendered. + * Only returned when the renderer has not been initialized. + */ + render(scene: Object3D, camera: Camera): Promise | undefined; + /** + * Returns an internal render target which is used when computing the output tone mapping + * and color space conversion. Unlike in `WebGLRenderer`, this is done in a separate render + * pass and not inline to achieve more correct results. + * + * @private + * @return {?RenderTarget} The render target. The method returns `null` if no output conversion should be applied. + */ + _getFrameBufferTarget(): RenderTarget | null; + /** + * Renders the scene or 3D object with the given camera. + * + * @private + * @param {Object3D} scene - The scene or 3D object to render. + * @param {Camera} camera - The camera to render the scene with. + * @param {boolean} [useFrameBufferTarget=true] - Whether to use a framebuffer target or not. + * @return {RenderContext} The current render context. + */ + _renderScene(scene: Object3D, camera: Camera, useFrameBufferTarget?: boolean): RenderContext | undefined; + _setXRLayerSize(width: number, height: number): void; + /** + * The output pass performs tone mapping and color space conversion. + * + * @private + * @param {RenderTarget} renderTarget - The current render target. + */ + _renderOutput(renderTarget: RenderTarget): void; + /** + * Returns the maximum available anisotropy for texture filtering. + * + * @return {number} The maximum available anisotropy. + */ + getMaxAnisotropy(): number; + /** + * Returns the active cube face. + * + * @return {number} The active cube face. + */ + getActiveCubeFace(): number; + /** + * Returns the active mipmap level. + * + * @return {number} The active mipmap level. + */ + getActiveMipmapLevel(): number; + /** + * Applications are advised to always define the animation loop + * with this method and not manually with `requestAnimationFrame()` + * for best compatibility. + * + * @async + * @param {?Function} callback - The application's animation loop. + * @return {Promise} A Promise that resolves when the set has been executed. + */ + setAnimationLoop(callback: ((time: DOMHighResTimeStamp, frame?: XRFrame) => void) | null): Promise; + /** + * Can be used to transfer buffer data from a storage buffer attribute + * from the GPU to the CPU in context of compute shaders. + * + * @async + * @param {StorageBufferAttribute} attribute - The storage buffer attribute. + * @return {Promise} A promise that resolves with the buffer data when the data are ready. + */ + getArrayBufferAsync(attribute: BufferAttribute): Promise; + /** + * Returns the rendering context. + * + * @return {GPUCanvasContext|WebGL2RenderingContext} The rendering context. + */ + getContext(): void; + /** + * Returns the pixel ratio. + * + * @return {number} The pixel ratio. + */ + getPixelRatio(): number; + /** + * Returns the drawing buffer size in physical pixels. This method honors the pixel ratio. + * + * @param {Vector2} target - The method writes the result in this target object. + * @return {Vector2} The drawing buffer size. + */ + getDrawingBufferSize(target: Vector2): Vector2; + /** + * Returns the renderer's size in logical pixels. This method does not honor the pixel ratio. + * + * @param {Vector2} target - The method writes the result in this target object. + * @return {Vector2} The renderer's size in logical pixels. + */ + getSize(target: Vector2): Vector2; + /** + * Sets the given pixel ratio and resizes the canvas if necessary. + * + * @param {number} [value=1] - The pixel ratio. + */ + setPixelRatio(value?: number): void; + /** + * This method allows to define the drawing buffer size by specifying + * width, height and pixel ratio all at once. The size of the drawing + * buffer is computed with this formula: + * ```js + * size.x = width * pixelRatio; + * size.y = height * pixelRatio; + * ``` + * + * @param {number} width - The width in logical pixels. + * @param {number} height - The height in logical pixels. + * @param {number} pixelRatio - The pixel ratio. + */ + setDrawingBufferSize(width: number, height: number, pixelRatio: number): void; + /** + * Sets the size of the renderer. + * + * @param {number} width - The width in logical pixels. + * @param {number} height - The height in logical pixels. + * @param {boolean} [updateStyle=true] - Whether to update the `style` attribute of the canvas or not. + */ + setSize(width: number, height: number, updateStyle?: boolean): void; + /** + * Defines a manual sort function for the opaque render list. + * Pass `null` to use the default sort. + * + * @param {Function} method - The sort function. + */ + setOpaqueSort(method: ((a: RenderItem, b: RenderItem) => number) | null): void; + /** + * Defines a manual sort function for the transparent render list. + * Pass `null` to use the default sort. + * + * @param {Function} method - The sort function. + */ + setTransparentSort(method: ((a: RenderItem, b: RenderItem) => number) | null): void; + /** + * Returns the scissor rectangle. + * + * @param {Vector4} target - The method writes the result in this target object. + * @return {Vector4} The scissor rectangle. + */ + getScissor(target: Vector4): Vector4; + /** + * Defines the scissor rectangle. + * + * @param {number | Vector4} x - The horizontal coordinate for the lower left corner of the box in logical pixel unit. + * Instead of passing four arguments, the method also works with a single four-dimensional vector. + * @param {number} y - The vertical coordinate for the lower left corner of the box in logical pixel unit. + * @param {number} width - The width of the scissor box in logical pixel unit. + * @param {number} height - The height of the scissor box in logical pixel unit. + */ + setScissor(x: Vector4): void; + setScissor(x: number, y: number, width: number, height: number): void; + /** + * Returns the scissor test value. + * + * @return {boolean} Whether the scissor test should be enabled or not. + */ + getScissorTest(): boolean; + /** + * Defines the scissor test. + * + * @param {boolean} boolean - Whether the scissor test should be enabled or not. + */ + setScissorTest(boolean: boolean): void; + /** + * Returns the viewport definition. + * + * @param {Vector4} target - The method writes the result in this target object. + * @return {Vector4} The viewport definition. + */ + getViewport(target: Vector4): Vector4; + /** + * Defines the viewport. + * + * @param {number | Vector4} x - The horizontal coordinate for the lower left corner of the viewport origin in logical pixel unit. + * @param {number} y - The vertical coordinate for the lower left corner of the viewport origin in logical pixel unit. + * @param {number} width - The width of the viewport in logical pixel unit. + * @param {number} height - The height of the viewport in logical pixel unit. + * @param {number} minDepth - The minimum depth value of the viewport. WebGPU only. + * @param {number} maxDepth - The maximum depth value of the viewport. WebGPU only. + */ + setViewport(x: Vector4): void; + setViewport(x: number, y: number, width: number, height: number, minDepth?: number, maxDepth?: number): void; + /** + * Returns the clear color. + * + * @param {Color} target - The method writes the result in this target object. + * @return {Color} The clear color. + */ + getClearColor(target: Color4): Color4; + /** + * Defines the clear color and optionally the clear alpha. + * + * @param {Color} color - The clear color. + * @param {number} [alpha=1] - The clear alpha. + */ + setClearColor(color: ColorRepresentation, alpha?: number): void; + /** + * Returns the clear alpha. + * + * @return {number} The clear alpha. + */ + getClearAlpha(): number; + /** + * Defines the clear alpha. + * + * @param {number} alpha - The clear alpha. + */ + setClearAlpha(alpha: number): void; + /** + * Returns the clear depth. + * + * @return {number} The clear depth. + */ + getClearDepth(): number; + /** + * Defines the clear depth. + * + * @param {number} depth - The clear depth. + */ + setClearDepth(depth: number): void; + /** + * Returns the clear stencil. + * + * @return {number} The clear stencil. + */ + getClearStencil(): number; + /** + * Defines the clear stencil. + * + * @param {number} stencil - The clear stencil. + */ + setClearStencil(stencil: number): void; + /** + * This method performs an occlusion query for the given 3D object. + * It returns `true` if the given 3D object is fully occluded by other + * 3D objects in the scene. + * + * @param {Object3D} object - The 3D object to test. + * @return {boolean} Whether the 3D object is fully occluded or not. + */ + isOccluded(object: Object3D): boolean | null; + /** + * Performs a manual clear operation. This method ignores `autoClear` properties. + * + * @param {boolean} [color=true] - Whether the color buffer should be cleared or not. + * @param {boolean} [depth=true] - Whether the depth buffer should be cleared or not. + * @param {boolean} [stencil=true] - Whether the stencil buffer should be cleared or not. + * @return {Promise} A Promise that resolves when the clear operation has been executed. + * Only returned when the renderer has not been initialized. + */ + clear(color?: boolean, depth?: boolean, stencil?: boolean): Promise | undefined; + /** + * Performs a manual clear operation of the color buffer. This method ignores `autoClear` properties. + * + * @return {Promise} A Promise that resolves when the clear operation has been executed. + * Only returned when the renderer has not been initialized. + */ + clearColor(): Promise | undefined; + /** + * Performs a manual clear operation of the depth buffer. This method ignores `autoClear` properties. + * + * @return {Promise} A Promise that resolves when the clear operation has been executed. + * Only returned when the renderer has not been initialized. + */ + clearDepth(): Promise | undefined; + /** + * Performs a manual clear operation of the stencil buffer. This method ignores `autoClear` properties. + * + * @return {Promise} A Promise that resolves when the clear operation has been executed. + * Only returned when the renderer has not been initialized. + */ + clearStencil(): Promise | undefined; + /** + * Async version of {@link Renderer#clear}. + * + * @async + * @param {boolean} [color=true] - Whether the color buffer should be cleared or not. + * @param {boolean} [depth=true] - Whether the depth buffer should be cleared or not. + * @param {boolean} [stencil=true] - Whether the stencil buffer should be cleared or not. + * @return {Promise} A Promise that resolves when the clear operation has been executed. + */ + clearAsync(color?: boolean, depth?: boolean, stencil?: boolean): Promise; + /** + * Async version of {@link Renderer#clearColor}. + * + * @async + * @return {Promise} A Promise that resolves when the clear operation has been executed. + */ + clearColorAsync(): Promise; + /** + * Async version of {@link Renderer#clearDepth}. + * + * @async + * @return {Promise} A Promise that resolves when the clear operation has been executed. + */ + clearDepthAsync(): Promise; + /** + * Async version of {@link Renderer#clearStencil}. + * + * @async + * @return {Promise} A Promise that resolves when the clear operation has been executed. + */ + clearStencilAsync(): Promise; + /** + * The current tone mapping of the renderer. When not producing screen output, + * the tone mapping is always `NoToneMapping`. + * + * @type {number} + */ + get currentToneMapping(): ToneMapping; + /** + * The current color space of the renderer. When not producing screen output, + * the color space is always the working color space. + * + * @type {string} + */ + get currentColorSpace(): string; + /** + * Returns `true` if the rendering settings are set to screen output. + * + * @returns {boolean} True if the current render target is the same of output render target or `null`, otherwise false. + */ + get isOutputTarget(): boolean; + /** + * Frees all internal resources of the renderer. Call this method if the renderer + * is no longer in use by your app. + */ + dispose(): void; + /** + * Sets the given render target. Calling this method means the renderer does not + * target the default framebuffer (meaning the canvas) anymore but a custom framebuffer. + * Use `null` as the first argument to reset the state. + * + * @param {?RenderTarget} renderTarget - The render target to set. + * @param {number} [activeCubeFace=0] - The active cube face. + * @param {number} [activeMipmapLevel=0] - The active mipmap level. + */ + setRenderTarget(renderTarget: RenderTarget | null, activeCubeFace?: number, activeMipmapLevel?: number): void; + /** + * Returns the current render target. + * + * @return {?RenderTarget} The render target. Returns `null` if no render target is set. + */ + getRenderTarget(): RenderTarget | null; + /** + * Sets the output render target for the renderer. + * + * @param {Object} renderTarget - The render target to set as the output target. + */ + setOutputRenderTarget(renderTarget: RenderTarget | null): void; + /** + * Returns the current output target. + * + * @return {?RenderTarget} The current output render target. Returns `null` if no output target is set. + */ + getOutputRenderTarget(): RenderTarget | null; + /** + * Resets the renderer to the initial state before WebXR started. + */ + _resetXRState(): void; + /** + * Callback for {@link Renderer#setRenderObjectFunction}. + * + * @callback renderObjectFunction + * @param {Object3D} object - The 3D object. + * @param {Scene} scene - The scene the 3D object belongs to. + * @param {Camera} camera - The camera the object should be rendered with. + * @param {BufferGeometry} geometry - The object's geometry. + * @param {Material} material - The object's material. + * @param {?Object} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. + * @param {LightsNode} lightsNode - The current lights node. + * @param {ClippingContext} clippingContext - The clipping context. + * @param {?string} [passId=null] - An optional ID for identifying the pass. + */ + /** + * Sets the given render object function. Calling this method overwrites the default implementation + * which is {@link Renderer#renderObject}. Defining a custom function can be useful + * if you want to modify the way objects are rendered. For example you can define things like "every + * object that has material of a certain type should perform a pre-pass with a special overwrite material". + * The custom function must always call `renderObject()` in its implementation. + * + * Use `null` as the first argument to reset the state. + * + * @param {?renderObjectFunction} renderObjectFunction - The render object function. + */ + setRenderObjectFunction( + renderObjectFunction: + | (( + object: Object3D, + scene: Scene, + camera: Camera, + geometry: BufferGeometry, + material: Material, + group: GeometryGroup, + lightsNode: LightsNode, + ) => void) + | null, + ): void; + /** + * Returns the current render object function. + * + * @return {?Function} The current render object function. Returns `null` if no function is set. + */ + getRenderObjectFunction(): + | (( + object: Object3D, + scene: Scene, + camera: Camera, + geometry: BufferGeometry, + material: Material, + group: GeometryGroup, + lightsNode: LightsNode, + clippingContext: ClippingContext | null, + passId: string | null, + ) => void) + | null; + /** + * Execute a single or an array of compute nodes. This method can only be called + * if the renderer has been initialized. + * + * @param {Node|Array} computeNodes - The compute node(s). + * @param {?(Array|number)} [dispatchSizeOrCount=null] - Array with [ x, y, z ] values for dispatch or a single number for the count. + * @return {Promise|undefined} A Promise that resolve when the compute has finished. Only returned when the renderer has not been initialized. + */ + compute( + computeNodes: ComputeNode | ComputeNode[], + dispatchSizeOrCount?: number[] | number | null, + ): Promise | undefined; + /** + * Execute a single or an array of compute nodes. + * + * @async + * @param {Node|Array} computeNodes - The compute node(s). + * @param {?(Array|number)} [dispatchSizeOrCount=null] - Array with [ x, y, z ] values for dispatch or a single number for the count. + * @return {Promise} A Promise that resolve when the compute has finished. + */ + computeAsync( + computeNodes: ComputeNode | ComputeNode[], + dispatchSizeOrCount?: number[] | number | null, + ): Promise; + /** + * Checks if the given feature is supported by the selected backend. + * + * @async + * @param {string} name - The feature's name. + * @return {Promise} A Promise that resolves with a bool that indicates whether the feature is supported or not. + */ + hasFeatureAsync(name: string): Promise; + resolveTimestampsAsync(type?: TimestampQuery): Promise; + /** + * Checks if the given feature is supported by the selected backend. If the + * renderer has not been initialized, this method always returns `false`. + * + * @param {string} name - The feature's name. + * @return {boolean} Whether the feature is supported or not. + */ + hasFeature(name: string): false | void; + /** + * Returns `true` when the renderer has been initialized. + * + * @return {boolean} Whether the renderer has been initialized or not. + */ + hasInitialized(): boolean; + /** + * Initializes the given textures. Useful for preloading a texture rather than waiting until first render + * (which can cause noticeable lags due to decode and GPU upload overhead). + * + * @async + * @param {Texture} texture - The texture. + * @return {Promise} A Promise that resolves when the texture has been initialized. + */ + initTextureAsync(texture: Texture): Promise; + /** + * Initializes the given texture. Useful for preloading a texture rather than waiting until first render + * (which can cause noticeable lags due to decode and GPU upload overhead). + * + * This method can only be used if the renderer has been initialized. + * + * @param {Texture} texture - The texture. + */ + initTexture(texture: Texture): void; + /** + * Copies the current bound framebuffer into the given texture. + * + * @param {FramebufferTexture} framebufferTexture - The texture. + * @param {?(Vector2|Vector4)} [rectangle=null] - A two or four dimensional vector that defines the rectangular portion of the framebuffer that should be copied. + */ + copyFramebufferToTexture(framebufferTexture: FramebufferTexture, rectangle?: Rectangle | null): void; + /** + * Copies data of the given source texture into a destination texture. + * + * @param {Texture} srcTexture - The source texture. + * @param {Texture} dstTexture - The destination texture. + * @param {Box2|Box3} [srcRegion=null] - A bounding box which describes the source region. Can be two or three-dimensional. + * @param {Vector2|Vector3} [dstPosition=null] - A vector that represents the origin of the destination region. Can be two or three-dimensional. + * @param {number} [srcLevel=0] - The source mip level to copy from. + * @param {number} [dstLevel=0] - The destination mip level to copy to. + */ + copyTextureToTexture( + srcTexture: Texture, + dstTexture: Texture, + srcRegion?: Box2 | Box3 | null, + dstPosition?: Vector2 | Vector3 | null, + srcLevel?: number, + dstLevel?: number, + ): void; + /** + * Reads pixel data from the given render target. + * + * @async + * @param {RenderTarget} renderTarget - The render target to read from. + * @param {number} x - The `x` coordinate of the copy region's origin. + * @param {number} y - The `y` coordinate of the copy region's origin. + * @param {number} width - The width of the copy region. + * @param {number} height - The height of the copy region. + * @param {number} [textureIndex=0] - The texture index of a MRT render target. + * @param {number} [faceIndex=0] - The active cube face index. + * @return {Promise} A Promise that resolves when the read has been finished. The resolve provides the read data as a typed array. + */ + readRenderTargetPixelsAsync( + renderTarget: RenderTarget, + x: number, + y: number, + width: number, + height: number, + textureIndex?: number, + faceIndex?: number, + ): Promise; + /** + * Analyzes the given 3D object's hierarchy and builds render lists from the + * processed hierarchy. + * + * @param {Object3D} object - The 3D object to process (usually a scene). + * @param {Camera} camera - The camera the object is rendered with. + * @param {number} groupOrder - The group order is derived from the `renderOrder` of groups and is used to group 3D objects within groups. + * @param {RenderList} renderList - The current render list. + * @param {ClippingContext} clippingContext - The current clipping context. + */ + _projectObject( + object: Object3D, + camera: Camera, + groupOrder: number, + renderList: RenderList, + clippingContext: ClippingContext | null, + ): void; + /** + * Renders the given render bundles. + * + * @private + * @param {Array} bundles - Array with render bundle data. + * @param {Scene} sceneRef - The scene the render bundles belong to. + * @param {LightsNode} lightsNode - The current lights node. + */ + _renderBundles(bundles: Bundle[], sceneRef: Scene, lightsNode: LightsNode): void; + /** + * Renders the transparent objects from the given render lists. + * + * @private + * @param {Array} renderList - The transparent render list. + * @param {Array} doublePassList - The list of transparent objects which require a double pass (e.g. because of transmission). + * @param {Camera} camera - The camera the render list should be rendered with. + * @param {Scene} scene - The scene the render list belongs to. + * @param {LightsNode} lightsNode - The current lights node. + */ + _renderTransparents( + renderList: RenderItem[], + doublePassList: RenderItem[], + camera: Camera, + scene: Scene, + lightsNode: LightsNode, + ): void; + /** + * Renders the objects from the given render list. + * + * @private + * @param {Array} renderList - The render list. + * @param {Camera} camera - The camera the render list should be rendered with. + * @param {Scene} scene - The scene the render list belongs to. + * @param {LightsNode} lightsNode - The current lights node. + * @param {?string} [passId=null] - An optional ID for identifying the pass. + */ + _renderObjects( + renderList: RenderItem[], + camera: Camera, + scene: Scene, + lightsNode: LightsNode, + passId?: string | null, + ): void; + /** + * This method represents the default render object function that manages the render lifecycle + * of the object. + * + * @param {Object3D} object - The 3D object. + * @param {Scene} scene - The scene the 3D object belongs to. + * @param {Camera} camera - The camera the object should be rendered with. + * @param {BufferGeometry} geometry - The object's geometry. + * @param {Material} material - The object's material. + * @param {?Object} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. + * @param {LightsNode} lightsNode - The current lights node. + * @param {?ClippingContext} clippingContext - The clipping context. + * @param {?string} [passId=null] - An optional ID for identifying the pass. + */ + renderObject( + object: Object3D, + scene: Scene, + camera: Camera, + geometry: BufferGeometry, + material: Material, + group: GeometryGroup, + lightsNode: LightsNode, + clippingContext?: ClippingContext | null, + passId?: string | null, + ): void; + /** + * This method represents the default `_handleObjectFunction` implementation which creates + * a render object from the given data and performs the draw command with the selected backend. + * + * @private + * @param {Object3D} object - The 3D object. + * @param {Material} material - The object's material. + * @param {Scene} scene - The scene the 3D object belongs to. + * @param {Camera} camera - The camera the object should be rendered with. + * @param {LightsNode} lightsNode - The current lights node. + * @param {?{start: number, count: number}} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. + * @param {ClippingContext} clippingContext - The clipping context. + * @param {string} [passId] - An optional ID for identifying the pass. + */ + _renderObjectDirect( + object: Object3D, + material: Material, + scene: Scene, + camera: Camera, + lightsNode: LightsNode, + group: GeometryGroup, + clippingContext: ClippingContext | null, + passId?: string, + ): void; + /** + * A different implementation for `_handleObjectFunction` which only makes sure the object is ready for rendering. + * Used in `compileAsync()`. + * + * @private + * @param {Object3D} object - The 3D object. + * @param {Material} material - The object's material. + * @param {Scene} scene - The scene the 3D object belongs to. + * @param {Camera} camera - The camera the object should be rendered with. + * @param {LightsNode} lightsNode - The current lights node. + * @param {?{start: number, count: number}} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. + * @param {ClippingContext} clippingContext - The clipping context. + * @param {string} [passId] - An optional ID for identifying the pass. + */ + _createObjectPipeline( + object: Object3D, + material: Material, + scene: Scene, + camera: Camera, + lightsNode: LightsNode, + group: Group, + clippingContext: ClippingContext | null, + passId?: string, + ): void; + /** + * Alias for `compileAsync()`. + * + * @method + * @param {Object3D} scene - The scene or 3D object to precompile. + * @param {Camera} camera - The camera that is used to render the scene. + * @param {Scene} targetScene - If the first argument is a 3D object, this parameter must represent the scene the 3D object is going to be added. + * @return {function(Object3D, Camera, ?Scene): Promise|undefined} A Promise that resolves when the compile has been finished. + */ + get compile(): (scene: Object3D, camera: Camera, targetScene?: Scene | null) => Promise; +} +export default Renderer; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/RendererUtils.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/RendererUtils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5a25a27894ac1291c0660b225675a1c98bf4f3fa --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/RendererUtils.d.ts @@ -0,0 +1,78 @@ +import { Camera } from "../../cameras/Camera.js"; +import { ToneMapping } from "../../constants.js"; +import { BufferGeometry, GeometryGroup } from "../../core/BufferGeometry.js"; +import { Object3D } from "../../core/Object3D.js"; +import { RenderTarget } from "../../core/RenderTarget.js"; +import { Material } from "../../materials/Material.js"; +import { Color } from "../../math/Color.js"; +import MRTNode from "../../nodes/core/MRTNode.js"; +import Node from "../../nodes/core/Node.js"; +import LightsNode from "../../nodes/lighting/LightsNode.js"; +import { Scene } from "../../scenes/Scene.js"; +import { CubeTexture } from "../../textures/CubeTexture.js"; +import { Texture } from "../../textures/Texture.js"; +import Color4 from "./Color4.js"; +import Renderer from "./Renderer.js"; + +// renderer state + +export interface RendererState { + toneMapping: ToneMapping; + toneMappingExposure: number; + outputColorSpace: string; + renderTarget: RenderTarget | null; + activeCubeFace: number; + activeMipmapLevel: number; + renderObjectFunction: + | (( + object: Object3D, + scene: Scene, + camera: Camera, + geometry: BufferGeometry, + material: Material, + group: GeometryGroup, + lightsNode: LightsNode, + ) => void) + | null; + pixelRatio: number; + mrt: MRTNode | null; + clearColor: Color4; + clearAlpha: number; + autoClear: boolean; + scissorTest: boolean; +} + +export function saveRendererState(renderer: Renderer, state?: RendererState): RendererState; + +export function resetRendererState(renderer: Renderer, state: RendererState): RendererState; + +export function restoreRendererState(renderer: Renderer, state: RendererState): void; + +// scene state + +export interface SceneState { + background: Color | Texture | CubeTexture | null; + backgroundNode: Node | null | undefined; + overrideMaterial: Material | null; +} + +export function saveSceneState(scene: Scene, state?: SceneState): SceneState; + +export function resetSceneState(scene: Scene, state: SceneState): SceneState; + +export function restoreSceneState(scene: Scene, state: SceneState): SceneState; + +// renderer and scene state + +export interface RendererAndSceneState extends RendererState, SceneState { +} + +export function saveRendererAndSceneState( + renderer: RendererState, + scene: Scene, + state?: RendererAndSceneState, +): RendererAndSceneState; + +export function resetRendererAndSceneState(renderer: Renderer, state: RendererAndSceneState): RendererAndSceneState; + +export function restoreRendererAndSceneState(renderer: Renderer, state: RendererAndSceneState): void; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/SampledTexture.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/SampledTexture.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1ad60f753cd40c872d98704a18634f0be1224bcd --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/SampledTexture.d.ts @@ -0,0 +1,26 @@ +import { Texture } from "../../textures/Texture.js"; +import Sampler from "./Sampler.js"; + +declare class SampledTexture extends Sampler { + id: number; + + store: boolean; + + readonly isSampledTexture: true; + + constructor(name: string, texture: Texture | null); +} + +declare class SampledArrayTexture extends SampledTexture { + readonly isSampledArrayTexture: true; +} + +declare class Sampled3DTexture extends SampledTexture { + readonly isSampled3DTexture: true; +} + +declare class SampledCubeTexture extends SampledTexture { + readonly isSampledCubeTexture: true; +} + +export { Sampled3DTexture, SampledArrayTexture, SampledCubeTexture, SampledTexture }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Sampler.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Sampler.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..89e9f0ccbdae1dbdfb8b0e81ccba04b449296cb2 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Sampler.d.ts @@ -0,0 +1,17 @@ +import { Texture } from "../../textures/Texture.js"; +import Binding from "./Binding.js"; + +declare class Sampler extends Binding { + version: number; + + generation: number | null; + + readonly isSampler: true; + + constructor(name: string, texture: Texture | null); + + set texture(value: Texture | null); + get texture(): Texture | null; +} + +export default Sampler; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Storage3DTexture.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Storage3DTexture.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..98eb736ce674687d0bad69af331107d3b23ea7db --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Storage3DTexture.d.ts @@ -0,0 +1,42 @@ +import { Wrapping } from "../../constants.js"; +import { Texture } from "../../textures/Texture.js"; + +/** + * This special type of texture is intended for compute shaders. + * It can be used to compute the data of a texture with a compute shader. + * + * Note: This type of texture can only be used with `WebGPURenderer` + * and a WebGPU backend. + */ +declare class Storage3DTexture extends Texture { + /** + * This defines how the texture is wrapped in the depth direction and corresponds to + * *W* in UVW mapping. + */ + wrapR: Wrapping; + + /** + * This flag can be used for type testing. + * + * @default true + */ + readonly isStorageTexture: true; + + /** + * Indicates whether this texture is a 3D texture. + */ + is3DTexture: boolean; + + /** + * Constructs a new storage texture. + * + * @param {number} [width=1] - The storage texture's width. + * @param {number} [height=1] - The storage texture's height. + * @param {number} [depth=1] - The storage texture's depth. + */ + constructor(width?: number, height?: number, depth?: number); + + setSize(width: number, height: number, depth: number): void; +} + +export default Storage3DTexture; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/StorageArrayTexture.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/StorageArrayTexture.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7da1ec8ab8073b0cc5f5c97576116247059c29e8 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/StorageArrayTexture.d.ts @@ -0,0 +1,31 @@ +import { Wrapping } from "../../constants.js"; +import { Texture } from "../../textures/Texture.js"; + +/** + * This special type of texture is intended for compute shaders. + * It can be used to compute the data of a texture with a compute shader. + * + * Note: This type of texture can only be used with `WebGPURenderer` + * and a WebGPU backend. + */ +declare class Storage3DTexture extends Texture { + /** + * This flag can be used for type testing. + * + * @default true + */ + readonly isStorageTexture: true; + + /** + * Constructs a new storage texture. + * + * @param {number} [width=1] - The storage texture's width. + * @param {number} [height=1] - The storage texture's height. + * @param {number} [depth=1] - The storage texture's depth. + */ + constructor(width?: number, height?: number, depth?: number); + + setSize(width: number, height: number, depth: number): void; +} + +export default Storage3DTexture; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/StorageBufferAttribute.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/StorageBufferAttribute.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0d2a586919f3cf914ba2ff43cf6098b7942996e6 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/StorageBufferAttribute.d.ts @@ -0,0 +1,7 @@ +import { BufferAttribute, TypedArray } from "../../core/BufferAttribute.js"; + +export default class StorageBufferAttribute extends BufferAttribute { + readonly isStorageBufferAttribute: true; + + constructor(array: TypedArray | number, itemSize: number); +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/StorageInstancedBufferAttribute.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/StorageInstancedBufferAttribute.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3f01891e8e644fad2646acd9b019e9cb80c51b35 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/StorageInstancedBufferAttribute.d.ts @@ -0,0 +1,8 @@ +import { TypedArray } from "../../core/BufferAttribute.js"; +import { InstancedBufferAttribute } from "../../core/InstancedBufferAttribute.js"; + +export default class StorageInstancedBufferAttribute extends InstancedBufferAttribute { + readonly isStorageInstancedBufferAttribute: true; + + constructor(array: TypedArray | number, itemSize: number); +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/StorageTexture.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/StorageTexture.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f036614f22a168c1ec6ffb710fe17eecebbb277d --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/StorageTexture.d.ts @@ -0,0 +1,7 @@ +import { Texture } from "../../textures/Texture.js"; + +export default class StorageTexture extends Texture { + constructor(width?: number, height?: number); + + setSize(width: number, height: number, depth: number): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Textures.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Textures.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ac4ac7f931c0a4ff80bf0f3dd0e2789f1b6aeac3 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Textures.d.ts @@ -0,0 +1,127 @@ +import { RenderTarget } from "../../core/RenderTarget.js"; +import { Vector3 } from "../../math/Vector3.js"; +import { DepthTexture } from "../../textures/DepthTexture.js"; +import { Texture } from "../../textures/Texture.js"; +import Backend from "./Backend.js"; +import DataMap from "./DataMap.js"; +import Info from "./Info.js"; +import Renderer from "./Renderer.js"; +type SizeVector3Uninitialized = Vector3 & { + width?: number; + height?: number; + depth?: number; +}; +type SizeVector3 = Vector3 & { + width: number; + height: number; + depth: number; +}; +interface RenderTargetData { + depthTextureMips?: { + [activeMipmapLevel: number]: DepthTexture; + }; + width?: number; + height?: number; + textures?: Texture[]; + depthTexture?: DepthTexture; + depth?: boolean; + stencil?: boolean; + renderTarget?: RenderTarget; + sampleCount?: number; + initialized?: boolean; +} +interface TextureData { + initialized?: boolean; + version?: number; + isDefaultTexture?: boolean; + generation?: number; +} +interface TextureOptions { + width?: number; + height?: number; + depth?: number; + needsMipmaps?: boolean; + levels?: number; +} +/** + * This module manages the textures of the renderer. + * + * @private + * @augments DataMap + */ +declare class Textures extends DataMap<{ + renderTarget: { + key: RenderTarget; + value: RenderTargetData; + }; + texture: { + key: Texture; + value: TextureData; + }; +}> { + renderer: Renderer; + backend: Backend; + info: Info; + /** + * Constructs a new texture management component. + * + * @param {Renderer} renderer - The renderer. + * @param {Backend} backend - The renderer's backend. + * @param {Info} info - Renderer component for managing metrics and monitoring data. + */ + constructor(renderer: Renderer, backend: Backend, info: Info); + /** + * Updates the given render target. Based on the given render target configuration, + * it updates the texture states representing the attachments of the framebuffer. + * + * @param {RenderTarget} renderTarget - The render target to update. + * @param {number} [activeMipmapLevel=0] - The active mipmap level. + */ + updateRenderTarget(renderTarget: RenderTarget, activeMipmapLevel?: number): void; + /** + * Updates the given texture. Depending on the texture state, this method + * triggers the upload of texture data to the GPU memory. If the texture data are + * not yet ready for the upload, it uses default texture data for as a placeholder. + * + * @param {Texture} texture - The texture to update. + * @param {Object} [options={}] - The options. + */ + updateTexture(texture: Texture, options?: TextureOptions): void; + /** + * Computes the size of the given texture and writes the result + * into the target vector. This vector is also returned by the + * method. + * + * If no texture data are available for the compute yet, the method + * returns default size values. + * + * @param {Texture} texture - The texture to compute the size for. + * @param {Vector3} target - The target vector. + * @return {Vector3} The target vector. + */ + getSize(texture: Texture, target?: SizeVector3Uninitialized): SizeVector3; + /** + * Computes the number of mipmap levels for the given texture. + * + * @param {Texture} texture - The texture. + * @param {number} width - The texture's width. + * @param {number} height - The texture's height. + * @return {number} The number of mipmap levels. + */ + getMipLevels(texture: Texture, width: number, height: number): number; + /** + * Returns `true` if the given texture makes use of mipmapping. + * + * @param {Texture} texture - The texture. + * @return {boolean} Whether mipmaps are required or not. + */ + needsMipmaps(texture: Texture): boolean; + /** + * Frees internal resource when the given texture isn't + * required anymore. + * + * @param {Texture} texture - The texture to destroy. + */ + _destroyTexture(texture: Texture): void; +} +export default Textures; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/TimestampQueryPool.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/TimestampQueryPool.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8fe992eef8b89202fcf3ccf90751bdde544215c9 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/TimestampQueryPool.d.ts @@ -0,0 +1,43 @@ +/** + * Abstract base class of a timestamp query pool. + * + * @abstract + */ +declare abstract class TimestampQueryPool { + trackTimestamp: boolean; + maxQueries: number; + currentQueryIndex: number; + queryOffsets: Map; + isDisposed: boolean; + lastValue: number; + pendingResolve: boolean; + /** + * Creates a new timestamp query pool. + * + * @param {number} [maxQueries=256] - Maximum number of queries this pool can hold. + */ + constructor(maxQueries?: number); + /** + * Allocate queries for a specific uid. + * + * @abstract + * @param {string} uid - A unique identifier for the render context. + * @returns {?number} + */ + abstract allocateQueriesForContext(uid: string): number | null; + /** + * Resolve all timestamps and return data (or process them). + * + * @abstract + * @async + * @returns {Promise|number} The resolved timestamp value. + */ + abstract resolveQueriesAsync(): Promise; + /** + * Dispose of the query pool. + * + * @abstract + */ + abstract dispose(): void; +} +export default TimestampQueryPool; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Uniform.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Uniform.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9d3bddc4762800ed538ff278d7277ad5f8de7217 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/Uniform.d.ts @@ -0,0 +1,177 @@ +import { Color } from "../../math/Color.js"; +import { Matrix2 } from "../../math/Matrix2.js"; +import { Matrix3 } from "../../math/Matrix3.js"; +import { Matrix4 } from "../../math/Matrix4.js"; +import { Vector2 } from "../../math/Vector2.js"; +import { Vector3 } from "../../math/Vector3.js"; +import { Vector4 } from "../../math/Vector4.js"; +/** + * Abstract base class for uniforms. + * + * @abstract + * @private + */ +declare class Uniform { + name: string; + value: TValue; + boundary: number; + itemSize: number; + offset: number; + /** + * Constructs a new uniform. + * + * @param {string} name - The uniform's name. + * @param {any} value - The uniform's value. + */ + constructor(name: string, value: TValue); + /** + * Sets the uniform's value. + * + * @param {any} value - The value to set. + */ + setValue(value: TValue): void; + /** + * Returns the uniform's value. + * + * @return {any} The value. + */ + getValue(): TValue; +} +/** + * Represents a Number uniform. + * + * @private + * @augments Uniform + */ +declare class NumberUniform extends Uniform { + readonly isNumberUniform: true; + /** + * Constructs a new Number uniform. + * + * @param {string} name - The uniform's name. + * @param {number} value - The uniform's value. + */ + constructor(name: string, value?: number); +} +/** + * Represents a Vector2 uniform. + * + * @private + * @augments Uniform + */ +declare class Vector2Uniform extends Uniform { + readonly isVector2Uniform: true; + /** + * Constructs a new Number uniform. + * + * @param {string} name - The uniform's name. + * @param {Vector2} value - The uniform's value. + */ + constructor(name: string, value?: Vector2); +} +/** + * Represents a Vector3 uniform. + * + * @private + * @augments Uniform + */ +declare class Vector3Uniform extends Uniform { + readonly isVector3Uniform: true; + /** + * Constructs a new Number uniform. + * + * @param {string} name - The uniform's name. + * @param {Vector3} value - The uniform's value. + */ + constructor(name: string, value?: Vector3); +} +/** + * Represents a Vector4 uniform. + * + * @private + * @augments Uniform + */ +declare class Vector4Uniform extends Uniform { + readonly isVector4Uniform: true; + /** + * Constructs a new Number uniform. + * + * @param {string} name - The uniform's name. + * @param {Vector4} value - The uniform's value. + */ + constructor(name: string, value?: Vector4); +} +/** + * Represents a Color uniform. + * + * @private + * @augments Uniform + */ +declare class ColorUniform extends Uniform { + readonly isColorUniform: true; + /** + * Constructs a new Number uniform. + * + * @param {string} name - The uniform's name. + * @param {Color} value - The uniform's value. + */ + constructor(name: string, value?: Color); +} +/** + * Represents a Matrix2 uniform. + * + * @private + * @augments Uniform + */ +declare class Matrix2Uniform extends Uniform { + readonly isMatrix2Uniform: true; + /** + * Constructs a new Number uniform. + * + * @param {string} name - The uniform's name. + * @param {Matrix2} value - The uniform's value. + */ + constructor(name: string, value?: Matrix2); +} +/** + * Represents a Matrix3 uniform. + * + * @private + * @augments Uniform + */ +declare class Matrix3Uniform extends Uniform { + readonly isMatrix3Uniform: true; + /** + * Constructs a new Number uniform. + * + * @param {string} name - The uniform's name. + * @param {Matrix3} value - The uniform's value. + */ + constructor(name: string, value?: Matrix3); +} +/** + * Represents a Matrix4 uniform. + * + * @private + * @augments Uniform + */ +declare class Matrix4Uniform extends Uniform { + readonly isMatrix4Uniform: true; + /** + * Constructs a new Number uniform. + * + * @param {string} name - The uniform's name. + * @param {Matrix4} value - The uniform's value. + */ + constructor(name: string, value?: Matrix4); +} +export { + ColorUniform, + Matrix2Uniform, + Matrix3Uniform, + Matrix4Uniform, + NumberUniform, + Vector2Uniform, + Vector3Uniform, + Vector4Uniform, +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/UniformBuffer.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/UniformBuffer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..808ecbaebc5afcd68dfa4ac7e73f38515b937765 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/UniformBuffer.d.ts @@ -0,0 +1,18 @@ +import Buffer from "./Buffer.js"; +/** + * Represents a uniform buffer binding type. + * + * @private + * @augments Buffer + */ +declare class UniformBuffer extends Buffer { + readonly isUniformBuffer: true; + /** + * Constructs a new uniform buffer. + * + * @param {string} name - The buffer's name. + * @param {TypedArray} [buffer=null] - The buffer. + */ + constructor(name?: string, buffer?: null); +} +export default UniformBuffer; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/UniformsGroup.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/UniformsGroup.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..16205f596a8eeb4d90dcdc292556f8e8fb3fe90e --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/UniformsGroup.d.ts @@ -0,0 +1,136 @@ +import { + ColorNodeUniform, + Matrix3NodeUniform, + Matrix4NodeUniform, + NodeUniformGPU, + NumberNodeUniform, + Vector2NodeUniform, + Vector3NodeUniform, + Vector4NodeUniform, +} from "./nodes/NodeUniform.js"; +import UniformBuffer from "./UniformBuffer.js"; +/** + * This class represents a uniform buffer binding but with + * an API that allows to maintain individual uniform objects. + * + * @private + * @augments UniformBuffer + */ +declare class UniformsGroup extends UniformBuffer { + readonly isUniformsGroup: true; + _values: number[] | null; + uniforms: NodeUniformGPU[]; + /** + * Constructs a new uniforms group. + * + * @param {string} name - The group's name. + */ + constructor(name?: string); + /** + * Adds a uniform to this group. + * + * @param {Uniform} uniform - The uniform to add. + * @return {UniformsGroup} A reference to this group. + */ + addUniform(uniform: NodeUniformGPU): this; + /** + * Removes a uniform from this group. + * + * @param {Uniform} uniform - The uniform to remove. + * @return {UniformsGroup} A reference to this group. + */ + removeUniform(uniform: NodeUniformGPU): this; + /** + * An array with the raw uniform values. + * + * @type {Array} + */ + get values(): number[]; + /** + * A Float32 array buffer with the uniform values. + * + * @type {Float32Array} + */ + get buffer(): Float32Array; + /** + * The byte length of the buffer with correct buffer alignment. + * + * @type {number} + */ + get byteLength(): number; + /** + * Updates this group by updating each uniform object of + * the internal uniform list. The uniform objects check if their + * values has actually changed so this method only returns + * `true` if there is a real value change. + * + * @return {boolean} Whether the uniforms have been updated and + * must be uploaded to the GPU. + */ + update(): boolean; + /** + * Updates a given uniform by calling an update method matching + * the uniforms type. + * + * @param {Uniform} uniform - The uniform to update. + * @return {boolean} Whether the uniform has been updated or not. + */ + updateByType(uniform: NodeUniformGPU): boolean | undefined; + /** + * Updates a given Number uniform. + * + * @param {NumberUniform} uniform - The Number uniform. + * @return {boolean} Whether the uniform has been updated or not. + */ + updateNumber(uniform: NumberNodeUniform): boolean; + /** + * Updates a given Vector2 uniform. + * + * @param {Vector2Uniform} uniform - The Vector2 uniform. + * @return {boolean} Whether the uniform has been updated or not. + */ + updateVector2(uniform: Vector2NodeUniform): boolean; + /** + * Updates a given Vector3 uniform. + * + * @param {Vector3Uniform} uniform - The Vector3 uniform. + * @return {boolean} Whether the uniform has been updated or not. + */ + updateVector3(uniform: Vector3NodeUniform): boolean; + /** + * Updates a given Vector4 uniform. + * + * @param {Vector4Uniform} uniform - The Vector4 uniform. + * @return {boolean} Whether the uniform has been updated or not. + */ + updateVector4(uniform: Vector4NodeUniform): boolean; + /** + * Updates a given Color uniform. + * + * @param {ColorUniform} uniform - The Color uniform. + * @return {boolean} Whether the uniform has been updated or not. + */ + updateColor(uniform: ColorNodeUniform): boolean; + /** + * Updates a given Matrix3 uniform. + * + * @param {Matrix3Uniform} uniform - The Matrix3 uniform. + * @return {boolean} Whether the uniform has been updated or not. + */ + updateMatrix3(uniform: Matrix3NodeUniform): boolean; + /** + * Updates a given Matrix4 uniform. + * + * @param {Matrix4Uniform} uniform - The Matrix4 uniform. + * @return {boolean} Whether the uniform has been updated or not. + */ + updateMatrix4(uniform: Matrix4NodeUniform): boolean; + /** + * Returns a typed array that matches the given data type. + * + * @param {string} type - The data type. + * @return {TypedArray} The typed array. + */ + _getBufferForType(type: string | null): Int32Array | Uint32Array | Float32Array; +} +export default UniformsGroup; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/XRManager.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/XRManager.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ed12c0d97337eaba57f02daec2a5fdea00f27165 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/XRManager.d.ts @@ -0,0 +1,325 @@ +import { ArrayCamera } from "../../cameras/ArrayCamera.js"; +import { PerspectiveCamera } from "../../cameras/PerspectiveCamera.js"; +import { EventDispatcher } from "../../core/EventDispatcher.js"; +import { RenderTarget } from "../../core/RenderTarget.js"; +import { CylinderGeometry } from "../../geometries/CylinderGeometry.js"; +import { PlaneGeometry } from "../../geometries/PlaneGeometry.js"; +import { Material } from "../../materials/Material.js"; +import { MeshBasicMaterial } from "../../materials/MeshBasicMaterial.js"; +import { Quaternion } from "../../math/Quaternion.js"; +import { Vector2 } from "../../math/Vector2.js"; +import { Vector3 } from "../../math/Vector3.js"; +import { Mesh } from "../../objects/Mesh.js"; +import { WebXRController } from "../webxr/WebXRController.js"; +import { AnimationContext } from "./Animation.js"; +import QuadMesh from "./QuadMesh.js"; +import Renderer from "./Renderer.js"; +import { XRRenderTarget } from "./XRRenderTarget.js"; +export interface XRManagerEventMap { + sessionstart: {}; + sessionend: {}; + planesdetected: { + data: XRFrame; + }; +} +export interface XRQuadLayerObject { + type: "quad"; + width: number; + height: number; + translation: Vector3; + quaternion: Quaternion; + pixelwidth: number; + pixelheight: number; + plane: Mesh; + material: Material; + rendercall: () => void; + renderTarget: XRRenderTarget; + xrlayer?: XRLayer; +} +export interface XRCylinderLayerObject { + type: "cylinder"; + radius: number; + centralAngle: number; + aspectratio: number; + translation: Vector3; + quaternion: Quaternion; + pixelwidth: number; + pixelheight: number; + plane: Mesh; + material: Material; + rendercall: () => void; + renderTarget: XRRenderTarget; + xrlayer?: XRLayer; +} +export type XRLayerObject = XRQuadLayerObject | XRCylinderLayerObject; +export interface LayerAttributes { + stencil?: boolean | undefined; +} +/** + * The XR manager is built on top of the WebXR Device API to + * manage XR sessions with `WebGPURenderer`. + * + * XR is currently only supported with a WebGL 2 backend. + * + * @augments EventDispatcher + */ +declare class XRManager extends EventDispatcher { + enabled: boolean; + isPresenting: boolean; + cameraAutoUpdate: boolean; + _renderer: Renderer; + _cameraL: PerspectiveCamera; + _cameraR: PerspectiveCamera; + _cameras: PerspectiveCamera[]; + _cameraXR: ArrayCamera; + _currentDepthNear: number | null; + _currentDepthFar: number | null; + _controllers: WebXRController[]; + _controllerInputSources: (XRInputSource | null)[]; + _xrRenderTarget: XRRenderTarget | null; + _layers: XRLayerObject[]; + _sessionUsesLayers: boolean; + _supportsLayers: boolean; + _supportsGlBinding: boolean; + _frameBufferTargets: + | WeakMap + | null; + _createXRLayer: (layer: XRLayerObject) => XRLayer; + _gl: WebGL2RenderingContext | null; + _currentAnimationContext: AnimationContext | null; + _currentAnimationLoop: ((time: DOMHighResTimeStamp, frame?: XRFrame) => void) | null; + _currentPixelRatio: number | null; + _currentSize: Vector2; + _onSessionEvent: (event: XRInputSourceEvent) => void; + _onSessionEnd: () => void; + _onInputSourcesChange: (event: XRInputSourcesChangeEvent) => void; + _onAnimationFrame: (time: DOMHighResTimeStamp, frame?: XRFrame) => void; + _referenceSpace: XRReferenceSpace | null; + _referenceSpaceType: XRReferenceSpaceType; + _customReferenceSpace: XRReferenceSpace | null; + _framebufferScaleFactor: number; + _foveation: number; + _session: XRSession | null; + _glBaseLayer: XRWebGLLayer | null; + _glBinding: XRWebGLBinding | null; + _glProjLayer: XRProjectionLayer | null; + _xrFrame: XRFrame | null; + _useLayers: boolean; + _useMultiviewIfPossible: boolean; + _useMultiview: boolean; + /** + * Constructs a new XR manager. + * + * @param {Renderer} renderer - The renderer. + * @param {boolean} [multiview=false] - Enables multiview if the device supports it. + */ + constructor(renderer: Renderer, multiview?: boolean); + /** + * Returns an instance of `THREE.Group` that represents the transformation + * of a XR controller in target ray space. The requested controller is defined + * by the given index. + * + * @param {number} index - The index of the XR controller. + * @return {Group} A group that represents the controller's transformation. + */ + getController(index: number): import("../webxr/WebXRController.js").XRTargetRaySpace; + /** + * Returns an instance of `THREE.Group` that represents the transformation + * of a XR controller in grip space. The requested controller is defined + * by the given index. + * + * @param {number} index - The index of the XR controller. + * @return {Group} A group that represents the controller's transformation. + */ + getControllerGrip(index: number): import("../webxr/WebXRController.js").XRGripSpace; + /** + * Returns an instance of `THREE.Group` that represents the transformation + * of a XR controller in hand space. The requested controller is defined + * by the given index. + * + * @param {number} index - The index of the XR controller. + * @return {Group} A group that represents the controller's transformation. + */ + getHand(index: number): import("../webxr/WebXRController.js").XRHandSpace; + /** + * Returns the foveation value. + * + * @return {number|undefined} The foveation value. Returns `undefined` if no base or projection layer is defined. + */ + getFoveation(): number | undefined; + /** + * Sets the foveation value. + * + * @param {number} foveation - A number in the range `[0,1]` where `0` means no foveation (full resolution) + * and `1` means maximum foveation (the edges render at lower resolution). + */ + setFoveation(foveation: number): void; + /** + * Returns the framebuffer scale factor. + * + * @return {number} The framebuffer scale factor. + */ + getFramebufferScaleFactor(): number; + /** + * Sets the framebuffer scale factor. + * + * This method can not be used during a XR session. + * + * @param {number} factor - The framebuffer scale factor. + */ + setFramebufferScaleFactor(factor: number): void; + /** + * Returns the reference space type. + * + * @return {XRReferenceSpaceType} The reference space type. + */ + getReferenceSpaceType(): XRReferenceSpaceType; + /** + * Sets the reference space type. + * + * This method can not be used during a XR session. + * + * @param {XRReferenceSpaceType} type - The reference space type. + */ + setReferenceSpaceType(type: XRReferenceSpaceType): void; + /** + * Returns the XR reference space. + * + * @return {XRReferenceSpace} The XR reference space. + */ + getReferenceSpace(): XRReferenceSpace | null; + /** + * Sets a custom XR reference space. + * + * @param {XRReferenceSpace} space - The XR reference space. + */ + setReferenceSpace(space: XRReferenceSpace): void; + /** + * Returns the XR camera. + * + * @return {ArrayCamera} The XR camera. + */ + getCamera(): ArrayCamera; + /** + * Returns the environment blend mode from the current XR session. + * + * @return {'opaque'|'additive'|'alpha-blend'|undefined} The environment blend mode. Returns `undefined` when used outside of a XR session. + */ + getEnvironmentBlendMode(): XREnvironmentBlendMode | undefined; + /** + * Returns the current XR binding. + * + * Creates a new binding if needed and the browser is + * capable of doing so. + * + * @return {?XRWebGLBinding} The XR binding. Returns `null` if one cannot be created. + */ + getBinding(): XRWebGLBinding | null; + /** + * Returns the current XR frame. + * + * @return {?XRFrame} The XR frame. Returns `null` when used outside a XR session. + */ + getFrame(): XRFrame | null; + /** + * Returns `true` if the engine renders to a multiview target. + * + * @return {boolean} Whether the engine renders to a multiview render target or not. + */ + useMultiview(): boolean; + /** + * This method can be used in XR applications to create a quadratic layer that presents a separate + * rendered scene. + * + * @param {number} width - The width of the layer plane in world units. + * @param {number} height - The height of the layer plane in world units. + * @param {Vector3} translation - The position/translation of the layer plane in world units. + * @param {Quaternion} quaternion - The orientation of the layer plane expressed as a quaternion. + * @param {number} pixelwidth - The width of the layer's render target in pixels. + * @param {number} pixelheight - The height of the layer's render target in pixels. + * @param {Function} rendercall - A callback function that renders the layer. Similar to code in + * the default animation loop, this method can be used to update/transform 3D object in the layer's scene. + * @param {Object} [attributes={}] - Allows to configure the layer's render target. + * @return {Mesh} A mesh representing the quadratic XR layer. This mesh should be added to the XR scene. + */ + createQuadLayer( + width: number, + height: number, + translation: Vector3, + quaternion: Quaternion, + pixelwidth: number, + pixelheight: number, + rendercall: () => void, + attributes?: LayerAttributes, + ): Mesh; + /** + * This method can be used in XR applications to create a cylindrical layer that presents a separate + * rendered scene. + * + * @param {number} radius - The radius of the cylinder in world units. + * @param {number} centralAngle - The central angle of the cylinder in radians. + * @param {number} aspectratio - The aspect ratio. + * @param {Vector3} translation - The position/translation of the layer plane in world units. + * @param {Quaternion} quaternion - The orientation of the layer plane expressed as a quaternion. + * @param {number} pixelwidth - The width of the layer's render target in pixels. + * @param {number} pixelheight - The height of the layer's render target in pixels. + * @param {Function} rendercall - A callback function that renders the layer. Similar to code in + * the default animation loop, this method can be used to update/transform 3D object in the layer's scene. + * @param {Object} [attributes={}] - Allows to configure the layer's render target. + * @return {Mesh} A mesh representing the cylindrical XR layer. This mesh should be added to the XR scene. + */ + createCylinderLayer( + radius: number, + centralAngle: number, + aspectratio: number, + translation: Vector3, + quaternion: Quaternion, + pixelwidth: number, + pixelheight: number, + rendercall: () => void, + attributes?: LayerAttributes, + ): Mesh; + /** + * Renders the XR layers that have been previously added to the scene. + * + * This method is usually called in your animation loop before rendering + * the actual scene via `renderer.render( scene, camera );`. + */ + renderLayers(): void; + /** + * Returns the current XR session. + * + * @return {?XRSession} The XR session. Returns `null` when used outside a XR session. + */ + getSession(): XRSession | null; + /** + * After a XR session has been requested usually with one of the `*Button` modules, it + * is injected into the renderer with this method. This method triggers the start of + * the actual XR rendering. + * + * @async + * @param {XRSession} session - The XR session to set. + * @return {Promise} A Promise that resolves when the session has been set. + */ + setSession(session: XRSession): Promise; + /** + * This method is called by the renderer per frame and updates the XR camera + * and it sub cameras based on the given camera. The given camera is the "user" + * camera created on application level and used for non-XR rendering. + * + * @param {PerspectiveCamera} camera - The camera. + */ + updateCamera(camera: PerspectiveCamera): void; + /** + * Returns a WebXR controller for the given controller index. + * + * @private + * @param {number} index - The controller index. + * @return {WebXRController} The XR controller. + */ + _getController(index: number): WebXRController; +} +export default XRManager; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/XRRenderTarget.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/XRRenderTarget.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ae73f84f80298a92a36aa706c8884ca35db0fa51 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/XRRenderTarget.d.ts @@ -0,0 +1,24 @@ +import { RenderTarget, RenderTargetOptions } from "../../core/RenderTarget.js"; +/** + * A special type of render target that is used when rendering + * with the WebXR Device API. + * + * @private + * @augments RenderTarget + */ +declare class XRRenderTarget extends RenderTarget { + readonly isXRRenderTarget: true; + _hasExternalTextures: boolean; + _autoAllocateDepthBuffer: boolean; + _isOpaqueFramebuffer: boolean; + /** + * Constructs a new XR render target. + * + * @param {number} [width=1] - The width of the render target. + * @param {number} [height=1] - The height of the render target. + * @param {Object} [options={}] - The configuration options. + */ + constructor(width?: number, height?: number, options?: RenderTargetOptions); + copy(source: XRRenderTarget): this; +} +export { XRRenderTarget }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/extras/PMREMGenerator.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/extras/PMREMGenerator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..28719bd2b61638ea5bca50b2fccd96913c695cef --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/extras/PMREMGenerator.d.ts @@ -0,0 +1,34 @@ +import { RenderTarget } from "../../../core/RenderTarget.js"; +import { Vector3 } from "../../../math/Vector3.js"; +import { Scene } from "../../../scenes/Scene.js"; +import Renderer from "../Renderer.js"; + +export interface PMREMGeneratorOptions { + size?: number | undefined; + position?: Vector3 | undefined; + renderTarget?: RenderTarget | null | undefined; +} + +declare class PMREMGenerator { + constructor(renderer: Renderer); + + fromScene( + scene: Scene, + sigma?: number, + near?: number, + far?: number, + options?: PMREMGeneratorOptions, + ): RenderTarget; + + fromSceneAsync( + scene: Scene, + sigma?: number, + near?: number, + far?: number, + options?: PMREMGeneratorOptions, + ): Promise; + + dispose(): void; +} + +export default PMREMGenerator; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/nodes/NodeBuilderState.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/nodes/NodeBuilderState.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a166ca35acb65ebf64d3755aedc5fc2f0eff601d --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/nodes/NodeBuilderState.d.ts @@ -0,0 +1,61 @@ +import NodeMaterialObserver from "../../../materials/nodes/manager/NodeMaterialObserver.js"; +import Node from "../../../nodes/core/Node.js"; +import NodeAttribute from "../../../nodes/core/NodeAttribute.js"; +import BindGroup from "../BindGroup.js"; +/** + * This module represents the state of a node builder after it was + * used to build the nodes for a render object. The state holds the + * results of the build for further processing in the renderer. + * + * Render objects with identical cache keys share the same node builder state. + * + * @private + */ +declare class NodeBuilderState { + vertexShader: string | null; + fragmentShader: string | null; + computeShader: string | null; + transforms: never[]; + nodeAttributes: NodeAttribute[]; + bindings: BindGroup[]; + updateNodes: Node[]; + updateBeforeNodes: Node[]; + updateAfterNodes: Node[]; + observer: NodeMaterialObserver; + usedTimes: number; + /** + * Constructs a new node builder state. + * + * @param {string} vertexShader - The native vertex shader code. + * @param {string} fragmentShader - The native fragment shader code. + * @param {string} computeShader - The native compute shader code. + * @param {Array} nodeAttributes - An array of node attributes. + * @param {Array} bindings - An array of bind groups. + * @param {Array} updateNodes - An array of nodes that implement their `update()` method. + * @param {Array} updateBeforeNodes - An array of nodes that implement their `updateBefore()` method. + * @param {Array} updateAfterNodes - An array of nodes that implement their `updateAfter()` method. + * @param {NodeMaterialObserver} observer - A node material observer. + * @param {Array} transforms - An array with transform attribute objects. Only relevant when using compute shaders with WebGL 2. + */ + constructor( + vertexShader: string | null, + fragmentShader: string | null, + computeShader: string | null, + nodeAttributes: NodeAttribute[], + bindings: BindGroup[], + updateNodes: Node[], + updateBeforeNodes: Node[], + updateAfterNodes: Node[], + observer: NodeMaterialObserver, + transforms?: never[], + ); + /** + * This method is used to create a array of bind groups based + * on the existing bind groups of this state. Shared groups are + * not cloned. + * + * @return {Array} A array of bind groups. + */ + createBindings(): BindGroup[]; +} +export default NodeBuilderState; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/nodes/NodeLibrary.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/nodes/NodeLibrary.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5fd9eabbec30d52d0cc438e8bdbcf0adf0b877a2 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/nodes/NodeLibrary.d.ts @@ -0,0 +1,113 @@ +import { ToneMapping } from "../../../constants.js"; +import { Light } from "../../../lights/Light.js"; +import { Material } from "../../../materials/Material.js"; +import NodeMaterial from "../../../materials/nodes/NodeMaterial.js"; +import Node from "../../../nodes/core/Node.js"; +import AnalyticLightNode from "../../../nodes/lighting/AnalyticLightNode.js"; +import { ShaderNodeObject } from "../../../nodes/tsl/TSLCore.js"; +/** + * The purpose of a node library is to assign node implementations + * to existing library features. In `WebGPURenderer` lights, materials + * which are not based on `NodeMaterial` as well as tone mapping techniques + * are implemented with node-based modules. + * + * @private + */ +declare class NodeLibrary { + lightNodes: WeakMap<{ + new(): Light; + }, { + new(light: Light): AnalyticLightNode; + }>; + materialNodes: Map; + toneMappingNodes: Map ShaderNodeObject>; + /** + * Constructs a new node library. + */ + constructor(); + /** + * Returns a matching node material instance for the given material object. + * + * This method also assigns/copies the properties of the given material object + * to the node material. This is done to make sure the current material + * configuration carries over to the node version. + * + * @param {Material} material - A material. + * @return {NodeMaterial} The corresponding node material. + */ + fromMaterial(material: Material): Material | NodeMaterial | null; + /** + * Adds a tone mapping node function for a tone mapping technique (constant). + * + * @param {Function} toneMappingNode - The tone mapping node function. + * @param {number} toneMapping - The tone mapping. + */ + addToneMapping( + toneMappingNode: (color: Node, exposure: Node) => ShaderNodeObject, + toneMapping: ToneMapping, + ): void; + /** + * Returns a tone mapping node function for a tone mapping technique (constant). + * + * @param {number} toneMapping - The tone mapping. + * @return {?Function} The tone mapping node function. Returns `null` if no node function is found. + */ + getToneMappingFunction(toneMapping: ToneMapping): ((color: Node, exposure: Node) => ShaderNodeObject) | null; + /** + * Returns a node material class definition for a material type. + * + * @param {string} materialType - The material type. + * @return {?NodeMaterial.constructor} The node material class definition. Returns `null` if no node material is found. + */ + getMaterialNodeClass(materialType: string): (new() => NodeMaterial) | null; + /** + * Adds a node material class definition for a given material type. + * + * @param {NodeMaterial.constructor} materialNodeClass - The node material class definition. + * @param {string} materialClassType - The material type. + */ + addMaterial(materialNodeClass: { + new(): NodeMaterial; + }, materialClassType: string): void; + /** + * Returns a light node class definition for a light class definition. + * + * @param {Light.constructor} light - The light class definition. + * @return {?AnalyticLightNode.constructor} The light node class definition. Returns `null` if no light node is found. + */ + getLightNodeClass(light: Light): (new(light: Light) => AnalyticLightNode) | null; + /** + * Adds a light node class definition for a given light class definition. + * + * @param {AnalyticLightNode.constructor} lightNodeClass - The light node class definition. + * @param {Light.constructor} lightClass - The light class definition. + */ + addLight(lightNodeClass: { + new(light: TLight): AnalyticLightNode; + }, lightClass: { + new(): TLight; + }): void; + /** + * Adds a node class definition for the given type to the provided type library. + * + * @param {Node.constructor} nodeClass - The node class definition. + * @param {number|string} type - The object type. + * @param {Map} library - The type library. + */ + addType(nodeClass: TNodeClass, type: TType, library: Map): void; + /** + * Adds a node class definition for the given class definition to the provided type library. + * + * @param {Node.constructor} nodeClass - The node class definition. + * @param {Node.constructor} baseClass - The class definition. + * @param {WeakMap} library - The type library. + */ + addClass( + nodeClass: TNodeClass, + baseClass: TBaseClass, + library: WeakMap, + ): void; +} +export default NodeLibrary; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/nodes/NodeSampledTexture.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/nodes/NodeSampledTexture.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..881eb9c6a18b9e5da2555bc79725d1d0f29b074a --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/nodes/NodeSampledTexture.d.ts @@ -0,0 +1,29 @@ +import TextureNode from "../../../nodes/accessors/TextureNode.js"; +import UniformGroupNode from "../../../nodes/core/UniformGroupNode.js"; +import { SampledTexture } from "../SampledTexture.js"; + +type GPUStorageTextureAccess = "read-only" | "read-write" | "write-only"; + +declare class NodeSampledTexture extends SampledTexture { + textureNode: TextureNode | undefined; + groupNode: UniformGroupNode; + + access: "read-write" | "read-only" | "write-only"; + + constructor( + name: string, + textureNode: TextureNode | undefined, + groupNode: UniformGroupNode, + access?: GPUStorageTextureAccess | null, + ); +} + +declare class NodeSampledCubeTexture extends NodeSampledTexture { + readonly isSampledCubeTexture: true; +} + +declare class NodeSampledTexture3D extends NodeSampledTexture { + readonly isSampledTexture3D: true; +} + +export { NodeSampledCubeTexture, NodeSampledTexture, NodeSampledTexture3D }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/nodes/NodeSampler.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/nodes/NodeSampler.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..60db177d5887fc5e5de3e9a2554b4262d45af10a --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/nodes/NodeSampler.d.ts @@ -0,0 +1,12 @@ +import TextureNode from "../../../nodes/accessors/TextureNode.js"; +import UniformGroupNode from "../../../nodes/core/UniformGroupNode.js"; +import Sampler from "../Sampler.js"; + +declare class NodeSampler extends Sampler { + textureNode: TextureNode | undefined; + groupNode: UniformGroupNode; + constructor(name: string, textureNode: TextureNode | undefined, groupNode: UniformGroupNode); + update(): void; +} + +export default NodeSampler; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/nodes/NodeUniform.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/nodes/NodeUniform.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b5d6209e23f21f36d1300e02b0013113901639f4 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/nodes/NodeUniform.d.ts @@ -0,0 +1,260 @@ +import { Color } from "../../../math/Color.js"; +import { Matrix2 } from "../../../math/Matrix2.js"; +import { Matrix3 } from "../../../math/Matrix3.js"; +import { Matrix4 } from "../../../math/Matrix4.js"; +import { Vector2 } from "../../../math/Vector2.js"; +import { Vector3 } from "../../../math/Vector3.js"; +import { Vector4 } from "../../../math/Vector4.js"; +import NodeUniform from "../../../nodes/core/NodeUniform.js"; +import { + ColorUniform, + Matrix2Uniform, + Matrix3Uniform, + Matrix4Uniform, + NumberUniform, + Vector2Uniform, + Vector3Uniform, + Vector4Uniform, +} from "../Uniform.js"; +/** + * A special form of Number uniform binding type. + * It's value is managed by a node object. + * + * @private + * @augments NumberUniform + */ +declare class NumberNodeUniform extends NumberUniform { + nodeUniform: NodeUniform; + /** + * Constructs a new node-based Number uniform. + * + * @param {NodeUniform} nodeUniform - The node uniform. + */ + constructor(nodeUniform: NodeUniform); + /** + * Overwritten to return the value of the node uniform. + * + * @return {number} The value. + */ + getValue(): number; + /** + * Returns the node uniform data type. + * + * @return {string} The data type. + */ + getType(): string | null; +} +/** + * A special form of Vector2 uniform binding type. + * It's value is managed by a node object. + * + * @private + * @augments Vector2Uniform + */ +declare class Vector2NodeUniform extends Vector2Uniform { + nodeUniform: NodeUniform; + /** + * Constructs a new node-based Vector2 uniform. + * + * @param {NodeUniform} nodeUniform - The node uniform. + */ + constructor(nodeUniform: NodeUniform); + /** + * Overwritten to return the value of the node uniform. + * + * @return {Vector2} The value. + */ + getValue(): Vector2; + /** + * Returns the node uniform data type. + * + * @return {string} The data type. + */ + getType(): string | null; +} +/** + * A special form of Vector3 uniform binding type. + * It's value is managed by a node object. + * + * @private + * @augments Vector3Uniform + */ +declare class Vector3NodeUniform extends Vector3Uniform { + nodeUniform: NodeUniform; + /** + * Constructs a new node-based Vector3 uniform. + * + * @param {NodeUniform} nodeUniform - The node uniform. + */ + constructor(nodeUniform: NodeUniform); + /** + * Overwritten to return the value of the node uniform. + * + * @return {Vector3} The value. + */ + getValue(): Vector3; + /** + * Returns the node uniform data type. + * + * @return {string} The data type. + */ + getType(): string | null; +} +/** + * A special form of Vector4 uniform binding type. + * It's value is managed by a node object. + * + * @private + * @augments Vector4Uniform + */ +declare class Vector4NodeUniform extends Vector4Uniform { + nodeUniform: NodeUniform; + /** + * Constructs a new node-based Vector4 uniform. + * + * @param {NodeUniform} nodeUniform - The node uniform. + */ + constructor(nodeUniform: NodeUniform); + /** + * Overwritten to return the value of the node uniform. + * + * @return {Vector4} The value. + */ + getValue(): Vector4; + /** + * Returns the node uniform data type. + * + * @return {string} The data type. + */ + getType(): string | null; +} +/** + * A special form of Color uniform binding type. + * It's value is managed by a node object. + * + * @private + * @augments ColorUniform + */ +declare class ColorNodeUniform extends ColorUniform { + nodeUniform: NodeUniform; + /** + * Constructs a new node-based Color uniform. + * + * @param {NodeUniform} nodeUniform - The node uniform. + */ + constructor(nodeUniform: NodeUniform); + /** + * Overwritten to return the value of the node uniform. + * + * @return {Color} The value. + */ + getValue(): Color; + /** + * Returns the node uniform data type. + * + * @return {string} The data type. + */ + getType(): string | null; +} +/** + * A special form of Matrix2 uniform binding type. + * It's value is managed by a node object. + * + * @private + * @augments Matrix2Uniform + */ +declare class Matrix2NodeUniform extends Matrix2Uniform { + nodeUniform: NodeUniform; + /** + * Constructs a new node-based Matrix2 uniform. + * + * @param {NodeUniform} nodeUniform - The node uniform. + */ + constructor(nodeUniform: NodeUniform); + /** + * Overwritten to return the value of the node uniform. + * + * @return {Matrix2} The value. + */ + getValue(): Matrix2; + /** + * Returns the node uniform data type. + * + * @return {string} The data type. + */ + getType(): string | null; +} +/** + * A special form of Matrix3 uniform binding type. + * It's value is managed by a node object. + * + * @private + * @augments Matrix3Uniform + */ +declare class Matrix3NodeUniform extends Matrix3Uniform { + nodeUniform: NodeUniform; + /** + * Constructs a new node-based Matrix3 uniform. + * + * @param {NodeUniform} nodeUniform - The node uniform. + */ + constructor(nodeUniform: NodeUniform); + /** + * Overwritten to return the value of the node uniform. + * + * @return {Matrix3} The value. + */ + getValue(): Matrix3; + /** + * Returns the node uniform data type. + * + * @return {string} The data type. + */ + getType(): string | null; +} +/** + * A special form of Matrix4 uniform binding type. + * It's value is managed by a node object. + * + * @private + * @augments Matrix4Uniform + */ +declare class Matrix4NodeUniform extends Matrix4Uniform { + nodeUniform: NodeUniform; + /** + * Constructs a new node-based Matrix4 uniform. + * + * @param {NodeUniform} nodeUniform - The node uniform. + */ + constructor(nodeUniform: NodeUniform); + /** + * Overwritten to return the value of the node uniform. + * + * @return {Matrix4} The value. + */ + getValue(): Matrix4; + /** + * Returns the node uniform data type. + * + * @return {string} The data type. + */ + getType(): string | null; +} +export { + ColorNodeUniform, + Matrix2NodeUniform, + Matrix3NodeUniform, + Matrix4NodeUniform, + NumberNodeUniform, + Vector2NodeUniform, + Vector3NodeUniform, + Vector4NodeUniform, +}; +export type NodeUniformGPU = + | NumberNodeUniform + | Vector2NodeUniform + | Vector3NodeUniform + | Vector4NodeUniform + | ColorNodeUniform + | Matrix3NodeUniform + | Matrix4NodeUniform; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/nodes/NodeUniformsGroup.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/nodes/NodeUniformsGroup.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..abb6775714b1c2793b211e876b01dd03e12dfe1c --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/nodes/NodeUniformsGroup.d.ts @@ -0,0 +1,22 @@ +import { UniformGroupNode } from "../../../nodes/Nodes.js"; +import UniformsGroup from "../UniformsGroup.js"; +/** + * A special form of uniforms group that represents + * the individual uniforms as node-based uniforms. + * + * @private + * @augments UniformsGroup + */ +declare class NodeUniformsGroup extends UniformsGroup { + id: number; + groupNode: UniformGroupNode; + readonly isNodeUniformsGroup: true; + /** + * Constructs a new node-based uniforms group. + * + * @param {string} name - The group's name. + * @param {UniformGroupNode} groupNode - The uniform group node. + */ + constructor(name: string, groupNode: UniformGroupNode); +} +export default NodeUniformsGroup; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/nodes/Nodes.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/nodes/Nodes.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1016f7c67cc7dd76f2fbad80703d2c8d72d03ce5 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/common/nodes/Nodes.d.ts @@ -0,0 +1,289 @@ +import { Camera } from "../../../cameras/Camera.js"; +import { Object3D } from "../../../core/Object3D.js"; +import { Material } from "../../../materials/Material.js"; +import { Color } from "../../../math/Color.js"; +import Node from "../../../nodes/core/Node.js"; +import NodeBuilder from "../../../nodes/core/NodeBuilder.js"; +import UniformGroupNode from "../../../nodes/core/UniformGroupNode.js"; +import ComputeNode from "../../../nodes/gpgpu/ComputeNode.js"; +import LightsNode from "../../../nodes/lighting/LightsNode.js"; +import { NodeFrame } from "../../../nodes/Nodes.js"; +import { ShaderNodeObject } from "../../../nodes/TSL.js"; +import { Fog } from "../../../scenes/Fog.js"; +import { FogExp2 } from "../../../scenes/FogExp2.js"; +import { Scene } from "../../../scenes/Scene.js"; +import { CubeTexture } from "../../../textures/CubeTexture.js"; +import { Texture } from "../../../textures/Texture.js"; +import Backend from "../Backend.js"; +import ChainMap from "../ChainMap.js"; +import DataMap from "../DataMap.js"; +import Renderer from "../Renderer.js"; +import RenderObject from "../RenderObject.js"; +import NodeBuilderState from "./NodeBuilderState.js"; +import NodeUniformsGroup from "./NodeUniformsGroup.js"; +interface NodeUniformsGroupData { + renderId?: number | undefined; + frameId?: number | undefined; +} +interface RenderObjectData { + nodeBuilderState?: NodeBuilderState | undefined; +} +interface ComputeNodeData { + nodeBuilderState?: NodeBuilderState | undefined; +} +interface SceneData { + background?: Color | Texture | CubeTexture | undefined; + backgroundNode?: ShaderNodeObject | undefined; + fog?: Fog | FogExp2 | undefined; + fogNode?: ShaderNodeObject | undefined; + environment?: Texture | undefined; + environmentNode?: ShaderNodeObject | undefined; +} +interface CacheKeyData { + callId: number; + cacheKey: number; +} +declare module "../../../scenes/Scene.js" { + interface Scene { + environmentNode?: ShaderNodeObject | null | undefined; + backgroundNode?: ShaderNodeObject | null | undefined; + fogNode?: ShaderNodeObject | null | undefined; + } +} +/** + * This renderer module manages node-related objects and is the + * primary interface between the renderer and the node system. + * + * @private + * @augments DataMap + */ +declare class Nodes extends DataMap<{ + /** + * Constructs a new nodes management component. + * + * @param {Renderer} renderer - The renderer. + * @param {Backend} backend - The renderer's backend. + */ + nodeUniformsGroup: { + key: NodeUniformsGroup; + value: NodeUniformsGroupData; + }; + renderObject: { + key: RenderObject; + value: RenderObjectData; + }; + computeNode: { + key: ComputeNode; + value: ComputeNodeData; + }; + scene: { + key: Scene; + value: SceneData; + }; +}> { + renderer: Renderer; + backend: Backend; + nodeFrame: NodeFrame; + nodeBuilderCache: Map; + callHashCache: ChainMap; + groupsData: ChainMap; + cacheLib: { + [type: string]: WeakMap | undefined>; + }; + constructor(renderer: Renderer, backend: Backend); + /** + * Returns `true` if the given node uniforms group must be updated or not. + * + * @param {NodeUniformsGroup} nodeUniformsGroup - The node uniforms group. + * @return {boolean} Whether the node uniforms group requires an update or not. + */ + updateGroup(nodeUniformsGroup: NodeUniformsGroup): boolean; + /** + * Returns the cache key for the given render object. + * + * @param {RenderObject} renderObject - The render object. + * @return {number} The cache key. + */ + getForRenderCacheKey(renderObject: RenderObject): number; + /** + * Returns a node builder state for the given render object. + * + * @param {RenderObject} renderObject - The render object. + * @return {NodeBuilderState} The node builder state. + */ + getForRender(renderObject: RenderObject): NodeBuilderState; + /** + * Deletes the given object from the internal data map + * + * @param {any} object - The object to delete. + * @return {?Object} The deleted dictionary. + */ + delete( + object: NodeUniformsGroup | RenderObject | ComputeNode | Scene, + ): RenderObjectData | NodeUniformsGroupData | ComputeNodeData | SceneData; + /** + * Returns a node builder state for the given compute node. + * + * @param {Node} computeNode - The compute node. + * @return {NodeBuilderState} The node builder state. + */ + getForCompute(computeNode: ComputeNode): NodeBuilderState; + /** + * Creates a node builder state for the given node builder. + * + * @private + * @param {NodeBuilder} nodeBuilder - The node builder. + * @return {NodeBuilderState} The node builder state. + */ + _createNodeBuilderState(nodeBuilder: NodeBuilder): NodeBuilderState; + /** + * Returns an environment node for the current configured + * scene environment. + * + * @param {Scene} scene - The scene. + * @return {Node} A node representing the current scene environment. + */ + getEnvironmentNode(scene: Scene): ShaderNodeObject | null; + /** + * Returns a background node for the current configured + * scene background. + * + * @param {Scene} scene - The scene. + * @return {Node} A node representing the current scene background. + */ + getBackgroundNode(scene: Scene): ShaderNodeObject | null; + /** + * Returns a fog node for the current configured scene fog. + * + * @param {Scene} scene - The scene. + * @return {Node} A node representing the current scene fog. + */ + getFogNode(scene: Scene): ShaderNodeObject | null; + /** + * Returns a cache key for the given scene and lights node. + * This key is used by `RenderObject` as a part of the dynamic + * cache key (a key that must be checked every time the render + * objects is drawn). + * + * @param {Scene} scene - The scene. + * @param {LightsNode} lightsNode - The lights node. + * @return {number} The cache key. + */ + getCacheKey(scene: Scene, lightsNode: LightsNode): number; + /** + * A boolean that indicates whether tone mapping should be enabled + * or not. + * + * @type {boolean} + */ + get isToneMappingState(): boolean; + /** + * If a scene background is configured, this method makes sure to + * represent the background with a corresponding node-based implementation. + * + * @param {Scene} scene - The scene. + */ + updateBackground(scene: Scene): void; + /** + * This method is part of the caching of nodes which are used to represents the + * scene's background, fog or environment. + * + * @param {string} type - The type of object to cache. + * @param {Object} object - The object. + * @param {Function} callback - A callback that produces a node representation for the given object. + * @param {boolean} [forceUpdate=false] - Whether an update should be enforced or not. + * @return {Node} The node representation. + */ + getCacheNode( + type: string, + object: object, + callback: () => ShaderNodeObject | undefined, + forceUpdate?: boolean, + ): ShaderNodeObject | undefined; + /** + * If a scene fog is configured, this method makes sure to + * represent the fog with a corresponding node-based implementation. + * + * @param {Scene} scene - The scene. + */ + updateFog(scene: Scene): void; + /** + * If a scene environment is configured, this method makes sure to + * represent the environment with a corresponding node-based implementation. + * + * @param {Scene} scene - The scene. + */ + updateEnvironment(scene: Scene): void; + getNodeFrame( + renderer?: Renderer, + scene?: Scene | null, + object?: Object3D | null, + camera?: Camera | null, + material?: Material | null, + ): NodeFrame; + getNodeFrameForRender(renderObject: RenderObject): NodeFrame; + /** + * Returns the current output cache key. + * + * @return {string} The output cache key. + */ + getOutputCacheKey(): string; + /** + * Checks if the output configuration (tone mapping and color space) for + * the given target has changed. + * + * @param {Texture} outputTarget - The output target. + * @return {boolean} Whether the output configuration has changed or not. + */ + hasOutputChange(outputTarget: Texture): boolean; + /** + * Returns a node that represents the output configuration (tone mapping and + * color space) for the current target. + * + * @param {Texture} outputTarget - The output target. + * @return {Node} The output node. + */ + getOutputNode(outputTarget: Texture): ShaderNodeObject; + /** + * Triggers the call of `updateBefore()` methods + * for all nodes of the given render object. + * + * @param {RenderObject} renderObject - The render object. + */ + updateBefore(renderObject: RenderObject): void; + /** + * Triggers the call of `updateAfter()` methods + * for all nodes of the given render object. + * + * @param {RenderObject} renderObject - The render object. + */ + updateAfter(renderObject: RenderObject): void; + /** + * Triggers the call of `update()` methods + * for all nodes of the given compute node. + * + * @param {Node} computeNode - The compute node. + */ + updateForCompute(computeNode: ComputeNode): void; + /** + * Triggers the call of `update()` methods + * for all nodes of the given compute node. + * + * @param {RenderObject} renderObject - The render object. + */ + updateForRender(renderObject: RenderObject): void; + /** + * Returns `true` if the given render object requires a refresh. + * + * @param {RenderObject} renderObject - The render object. + * @return {boolean} Whether the given render object requires a refresh or not. + */ + needsRefresh(renderObject: RenderObject): boolean; + /** + * Frees the internal resources. + */ + dispose(): void; +} +export default Nodes; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/shaders/ShaderChunk.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/shaders/ShaderChunk.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..caf4e39bb6fdb494160d284cb36ca3d39ecd9a29 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/shaders/ShaderChunk.d.ts @@ -0,0 +1,143 @@ +// Renderers / Shaders ///////////////////////////////////////////////////////////////////// +export const ShaderChunk: { + alphahash_fragment: string; + alphahash_pars_fragment: string; + alphamap_fragment: string; + alphamap_pars_fragment: string; + alphatest_fragment: string; + alphatest_pars_fragment: string; + aomap_fragment: string; + aomap_pars_fragment: string; + batching_pars_vertex: string; + begin_vertex: string; + beginnormal_vertex: string; + bsdfs: string; + iridescence_fragment: string; + bumpmap_pars_fragment: string; + clipping_planes_fragment: string; + clipping_planes_pars_fragment: string; + clipping_planes_pars_vertex: string; + clipping_planes_vertex: string; + color_fragment: string; + color_pars_fragment: string; + color_pars_vertex: string; + color_vertex: string; + common: string; + cube_uv_reflection_fragment: string; + defaultnormal_vertex: string; + displacementmap_pars_vertex: string; + displacementmap_vertex: string; + emissivemap_fragment: string; + emissivemap_pars_fragment: string; + colorspace_fragment: string; + colorspace_pars_fragment: string; + envmap_fragment: string; + envmap_common_pars_fragment: string; + envmap_pars_fragment: string; + envmap_pars_vertex: string; + envmap_physical_pars_fragment: string; + envmap_vertex: string; + fog_vertex: string; + fog_pars_vertex: string; + fog_fragment: string; + fog_pars_fragment: string; + gradientmap_pars_fragment: string; + lightmap_pars_fragment: string; + lights_lambert_fragment: string; + lights_lambert_pars_fragment: string; + lights_pars_begin: string; + lights_toon_fragment: string; + lights_toon_pars_fragment: string; + lights_phong_fragment: string; + lights_phong_pars_fragment: string; + lights_physical_fragment: string; + lights_physical_pars_fragment: string; + lights_fragment_begin: string; + lights_fragment_maps: string; + lights_fragment_end: string; + logdepthbuf_fragment: string; + logdepthbuf_pars_fragment: string; + logdepthbuf_pars_vertex: string; + logdepthbuf_vertex: string; + map_fragment: string; + map_pars_fragment: string; + map_particle_fragment: string; + map_particle_pars_fragment: string; + metalnessmap_fragment: string; + metalnessmap_pars_fragment: string; + morphcolor_vertex: string; + morphnormal_vertex: string; + morphtarget_pars_vertex: string; + morphtarget_vertex: string; + normal_fragment_begin: string; + normal_fragment_maps: string; + normal_pars_fragment: string; + normal_pars_vertex: string; + normal_vertex: string; + normalmap_pars_fragment: string; + clearcoat_normal_fragment_begin: string; + clearcoat_normal_fragment_maps: string; + clearcoat_pars_fragment: string; + iridescence_pars_fragment: string; + opaque_fragment: string; + packing: string; + premultiplied_alpha_fragment: string; + project_vertex: string; + dithering_fragment: string; + dithering_pars_fragment: string; + roughnessmap_fragment: string; + roughnessmap_pars_fragment: string; + shadowmap_pars_fragment: string; + shadowmap_pars_vertex: string; + shadowmap_vertex: string; + shadowmask_pars_fragment: string; + skinbase_vertex: string; + skinning_pars_vertex: string; + skinning_vertex: string; + skinnormal_vertex: string; + specularmap_fragment: string; + specularmap_pars_fragment: string; + tonemapping_fragment: string; + tonemapping_pars_fragment: string; + transmission_fragment: string; + transmission_pars_fragment: string; + uv_pars_fragment: string; + uv_pars_vertex: string; + uv_vertex: string; + worldpos_vertex: string; + + background_vert: string; + background_frag: string; + backgroundCube_vert: string; + backgroundCube_frag: string; + cube_vert: string; + cube_frag: string; + depth_vert: string; + depth_frag: string; + distanceRGBA_vert: string; + distanceRGBA_frag: string; + equirect_vert: string; + equirect_frag: string; + linedashed_vert: string; + linedashed_frag: string; + meshbasic_vert: string; + meshbasic_frag: string; + meshlambert_vert: string; + meshlambert_frag: string; + meshmatcap_vert: string; + meshmatcap_frag: string; + meshnormal_vert: string; + meshnormal_frag: string; + meshphong_vert: string; + meshphong_frag: string; + meshphysical_vert: string; + meshphysical_frag: string; + meshtoon_vert: string; + meshtoon_frag: string; + points_vert: string; + points_frag: string; + shadow_vert: string; + shadow_frag: string; + sprite_vert: string; + sprite_frag: string; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/shaders/ShaderLib.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/shaders/ShaderLib.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9a52c4dcd6488c1b4f0e2656a8945dc6b3a7f2b6 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/shaders/ShaderLib.d.ts @@ -0,0 +1,29 @@ +import { IUniform } from "./UniformsLib.js"; + +export interface ShaderLibShader { + uniforms: { [uniform: string]: IUniform }; + vertexShader: string; + fragmentShader: string; +} + +declare const ShaderLib: { + [name: string]: ShaderLibShader; + basic: ShaderLibShader; + lambert: ShaderLibShader; + phong: ShaderLibShader; + standard: ShaderLibShader; + matcap: ShaderLibShader; + points: ShaderLibShader; + dashed: ShaderLibShader; + depth: ShaderLibShader; + normal: ShaderLibShader; + sprite: ShaderLibShader; + background: ShaderLibShader; + cube: ShaderLibShader; + equirect: ShaderLibShader; + distanceRGBA: ShaderLibShader; + shadow: ShaderLibShader; + physical: ShaderLibShader; +}; + +export { ShaderLib }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/shaders/UniformsLib.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/shaders/UniformsLib.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cb0d808bdc7c133bb34912a015e8b4bd14266074 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/shaders/UniformsLib.d.ts @@ -0,0 +1,189 @@ +import { Color } from "../../math/Color.js"; +import { Matrix3 } from "../../math/Matrix3.js"; +import { Vector2 } from "../../math/Vector2.js"; + +// eslint-disable-next-line @typescript-eslint/naming-convention +export interface IUniform { + value: TValue; +} + +export const UniformsLib: { + common: { + diffuse: IUniform; + opacity: IUniform; + map: IUniform; + mapTransform: IUniform; + alphaMap: IUniform; + alphaMapTransform: IUniform; + alphaTest: IUniform; + }; + specularmap: { + specularMap: IUniform; + specularMapTransform: IUniform; + }; + envmap: { + envMap: IUniform; + envMapRotation: IUniform; + flipEnvMap: IUniform; + reflectivity: IUniform; + ior: IUniform; + refractRatio: IUniform; + }; + aomap: { + aoMap: IUniform; + aoMapIntensity: IUniform; + aoMapTransform: IUniform; + }; + lightmap: { + lightMap: IUniform; + lightMapIntensity: IUniform; + lightMapTransform: IUniform; + }; + bumpmap: { + bumpMap: IUniform; + bumpMapTransform: IUniform; + bumpScale: IUniform; + }; + normalmap: { + normalMap: IUniform; + normalMapTransform: IUniform; + normalScale: IUniform; + }; + displacementmap: { + displacementMap: IUniform; + displacementMapTransform: IUniform; + displacementScale: IUniform; + displacementBias: IUniform; + }; + emissivemap: { + emissiveMap: IUniform; + emissiveMapTransform: IUniform; + }; + metalnessmap: { + metalnessMap: IUniform; + metalnessMapTransform: IUniform; + }; + roughnessmap: { + roughnessMap: IUniform; + roughnessMapTransform: IUniform; + }; + gradientmap: { + gradientMap: IUniform; + }; + fog: { + fogDensity: IUniform; + fogNear: IUniform; + fogFar: IUniform; + fogColor: IUniform; + }; + lights: { + ambientLightColor: IUniform; + lightProbe: IUniform; + directionalLights: { + value: unknown[]; + properties: { + direction: {}; + color: {}; + }; + }; + directionalLightShadows: { + value: unknown[]; + properties: { + shadowIntensity: number; + shadowBias: {}; + shadowNormalBias: {}; + shadowRadius: {}; + shadowMapSize: {}; + }; + }; + directionalShadowMap: IUniform; + directionalShadowMatrix: IUniform; + spotLights: { + value: unknown[]; + properties: { + color: {}; + position: {}; + direction: {}; + distance: {}; + coneCos: {}; + penumbraCos: {}; + decay: {}; + }; + }; + spotLightShadows: { + value: unknown[]; + properties: { + shadowIntensity: number; + shadowBias: {}; + shadowNormalBias: {}; + shadowRadius: {}; + shadowMapSize: {}; + }; + }; + spotLightMap: IUniform; + spotShadowMap: IUniform; + spotLightMatrix: IUniform; + pointLights: { + value: unknown[]; + properties: { + color: {}; + position: {}; + decay: {}; + distance: {}; + }; + }; + pointLightShadows: { + value: unknown[]; + properties: { + shadowIntensity: number; + shadowBias: {}; + shadowNormalBias: {}; + shadowRadius: {}; + shadowMapSize: {}; + shadowCameraNear: {}; + shadowCameraFar: {}; + }; + }; + pointShadowMap: IUniform; + pointShadowMatrix: IUniform; + hemisphereLights: { + value: unknown[]; + properties: { + direction: {}; + skycolor: {}; + groundColor: {}; + }; + }; + rectAreaLights: { + value: unknown[]; + properties: { + color: {}; + position: {}; + width: {}; + height: {}; + }; + }; + ltc_1: IUniform; + ltc_2: IUniform; + }; + points: { + diffuse: IUniform; + opacity: IUniform; + size: IUniform; + scale: IUniform; + map: IUniform; + alphaMap: IUniform; + alphaTest: IUniform; + uvTransform: IUniform; + }; + sprite: { + diffuse: IUniform; + opacity: IUniform; + center: IUniform; + rotation: IUniform; + map: IUniform; + mapTransform: IUniform; + alphaMap: IUniform; + alphaTest: IUniform; + }; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/shaders/UniformsUtils.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/shaders/UniformsUtils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fe5178d559709c2ba57a6b2417cbb1fb90e11c23 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/shaders/UniformsUtils.d.ts @@ -0,0 +1,14 @@ +import { UniformsGroup } from "../../core/UniformsGroup.js"; +import { IUniform } from "./UniformsLib.js"; + +export function cloneUniforms(uniformsSrc: T): T; +export function mergeUniforms(uniforms: Array<{ [uniform: string]: IUniform }>): { [uniform: string]: IUniform }; + +export function cloneUniformsGroups(src: UniformsGroup[]): UniformsGroup[]; + +declare const UniformsUtils: { + clone: typeof cloneUniforms; + merge: typeof mergeUniforms; +}; + +export { UniformsUtils }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl-fallback/WebGLBackend.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl-fallback/WebGLBackend.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d17bfdc6ab412a83539356affb94e9f439af43ad --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl-fallback/WebGLBackend.d.ts @@ -0,0 +1,14 @@ +import { CoordinateSystem } from "../../constants.js"; +import Backend, { BackendParameters } from "../common/Backend.js"; + +export interface WebGLBackendParameters extends BackendParameters { + trackTimestamp?: boolean | undefined; +} + +export default class WebGLBackend extends Backend { + constructor(parameters?: BackendParameters); + + get coordinateSystem(): CoordinateSystem; + + getMaxAnisotropy(): number; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLAttributes.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLAttributes.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8f4a9757b9d1b779d4b16779a941e501634464b2 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLAttributes.d.ts @@ -0,0 +1,21 @@ +import { BufferAttribute } from "../../core/BufferAttribute.js"; +import { GLBufferAttribute } from "../../core/GLBufferAttribute.js"; +import { InterleavedBufferAttribute } from "../../core/InterleavedBufferAttribute.js"; + +export class WebGLAttributes { + constructor(gl: WebGLRenderingContext | WebGL2RenderingContext); + + get(attribute: BufferAttribute | InterleavedBufferAttribute | GLBufferAttribute): + | { + buffer: WebGLBuffer; + type: number; + bytesPerElement: number; + version: number; + size: number; + } + | undefined; + + remove(attribute: BufferAttribute | InterleavedBufferAttribute | GLBufferAttribute): void; + + update(attribute: BufferAttribute | InterleavedBufferAttribute | GLBufferAttribute, bufferType: number): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLBindingStates.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLBindingStates.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0b96de7706b4f841d10aa225156c302707c808c5 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLBindingStates.d.ts @@ -0,0 +1,26 @@ +import { BufferAttribute } from "../../core/BufferAttribute.js"; +import { BufferGeometry } from "../../core/BufferGeometry.js"; +import { Object3D } from "../../core/Object3D.js"; +import { Material } from "../../materials/Material.js"; +import { WebGLAttributes } from "./WebGLAttributes.js"; +import { WebGLProgram } from "./WebGLProgram.js"; + +export class WebGLBindingStates { + constructor(gl: WebGLRenderingContext, attributes: WebGLAttributes); + + setup( + object: Object3D, + material: Material, + program: WebGLProgram, + geometry: BufferGeometry, + index: BufferAttribute, + ): void; + reset(): void; + resetDefaultState(): void; + dispose(): void; + releaseStatesOfGeometry(): void; + releaseStatesOfProgram(): void; + initAttributes(): void; + enableAttribute(attribute: number): void; + disableUnusedAttributes(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLBufferRenderer.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLBufferRenderer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c75f747459695c68617b97865c64698b94f673f9 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLBufferRenderer.d.ts @@ -0,0 +1,21 @@ +import { WebGLExtensions } from "./WebGLExtensions.js"; +import { WebGLInfo } from "./WebGLInfo.js"; + +export class WebGLBufferRenderer { + constructor( + gl: WebGLRenderingContext, + extensions: WebGLExtensions, + info: WebGLInfo, + ); + + setMode: (value: any) => void; + render: (start: any, count: number) => void; + renderInstances: (start: any, count: number, primcount: number) => void; + renderMultiDraw: (starts: Int32Array, counts: Int32Array, drawCount: number) => void; + renderMultiDrawInstances: ( + starts: Int32Array, + counts: Int32Array, + drawCount: number, + primcount: Int32Array, + ) => void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLCapabilities.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLCapabilities.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5abf5600f233b90353ab6cce1989218f169ee827 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLCapabilities.d.ts @@ -0,0 +1,48 @@ +import { PixelFormat, TextureDataType } from "../../constants.js"; + +export interface WebGLCapabilitiesParameters { + /** + * shader precision. Can be "highp", "mediump" or "lowp". + */ + precision?: string | undefined; + + /** + * default is false. + */ + logarithmicDepthBuffer?: boolean | undefined; + + /** + * default is false. + */ + reversedDepthBuffer?: boolean | undefined; +} + +export class WebGLCapabilities { + constructor(gl: WebGLRenderingContext, extensions: any, parameters: WebGLCapabilitiesParameters); + + readonly isWebGL2: boolean; + + getMaxAnisotropy: () => number; + getMaxPrecision: (precision: string) => string; + + textureFormatReadable: (textureFormat: PixelFormat) => boolean; + textureTypeReadable: (textureType: TextureDataType) => boolean; + + precision: string; + logarithmicDepthBuffer: boolean; + reversedDepthBuffer: boolean; + + maxTextures: number; + maxVertexTextures: number; + maxTextureSize: number; + maxCubemapSize: number; + + maxAttributes: number; + maxVertexUniforms: number; + maxVaryings: number; + maxFragmentUniforms: number; + + vertexTextures: boolean; + + maxSamples: number; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLClipping.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLClipping.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..167a16b35fc5e498c57c236e68785e462b386283 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLClipping.d.ts @@ -0,0 +1,26 @@ +import { Camera } from "../../cameras/Camera.js"; +import { Material } from "../../materials/Material.js"; +import { Plane } from "../../math/Plane.js"; +import { WebGLProperties } from "./WebGLProperties.js"; + +export class WebGLClipping { + constructor(properties: WebGLProperties); + + uniform: { value: any; needsUpdate: boolean }; + + /** + * @default 0 + */ + numPlanes: number; + + /** + * @default 0 + */ + numIntersection: number; + + init(planes: any[], enableLocalClipping: boolean): boolean; + beginShadows(): void; + endShadows(): void; + setGlobalState(planes: Plane[], camera: Camera): void; + setState(material: Material, camera: Camera, useCache: boolean): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLCubeMaps.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLCubeMaps.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..32cda3f61203f4bb6175d43e6d01981d2038fde0 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLCubeMaps.d.ts @@ -0,0 +1,8 @@ +import { WebGLRenderer } from "../WebGLRenderer.js"; + +export class WebGLCubeMaps { + constructor(renderer: WebGLRenderer); + + get(texture: any): any; + dispose(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLCubeUVMaps.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLCubeUVMaps.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e942463258a362a349a673a24f2677b140820e92 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLCubeUVMaps.d.ts @@ -0,0 +1,9 @@ +import { Texture } from "../../textures/Texture.js"; +import { WebGLRenderer } from "../WebGLRenderer.js"; + +export class WebGLCubeUVMaps { + constructor(renderer: WebGLRenderer); + + get(texture: T): T extends Texture ? Texture : T; + dispose(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLExtensions.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLExtensions.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0f0c0bf4b8103b0f8fcc2256ee2b69266ab333e1 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLExtensions.d.ts @@ -0,0 +1,7 @@ +export class WebGLExtensions { + constructor(gl: WebGLRenderingContext); + + has(name: string): boolean; + init(): void; + get(name: string): any; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLGeometries.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLGeometries.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..422249f37a0c45567b19a25f4cceb87083ff1388 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLGeometries.d.ts @@ -0,0 +1,13 @@ +import { BufferAttribute } from "../../core/BufferAttribute.js"; +import { BufferGeometry } from "../../core/BufferGeometry.js"; +import { Object3D } from "../../core/Object3D.js"; +import { WebGLAttributes } from "./WebGLAttributes.js"; +import { WebGLInfo } from "./WebGLInfo.js"; + +export class WebGLGeometries { + constructor(gl: WebGLRenderingContext, attributes: WebGLAttributes, info: WebGLInfo); + + get(object: Object3D, geometry: BufferGeometry): BufferGeometry; + update(geometry: BufferGeometry): void; + getWireframeAttribute(geometry: BufferGeometry): BufferAttribute; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLIndexedBufferRenderer.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLIndexedBufferRenderer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8e016e847cb61e920b8d285bf7c1abe8ea225611 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLIndexedBufferRenderer.d.ts @@ -0,0 +1,15 @@ +export class WebGLIndexedBufferRenderer { + constructor(gl: WebGLRenderingContext, extensions: any, info: any); + + setMode: (value: any) => void; + setIndex: (index: any) => void; + render: (start: any, count: number) => void; + renderInstances: (start: any, count: number, primcount: number) => void; + renderMultiDraw: (starts: Int32Array, counts: Int32Array, drawCount: number) => void; + renderMultiDrawInstances: ( + starts: Int32Array, + counts: Int32Array, + drawCount: number, + primcount: Int32Array, + ) => void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLInfo.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLInfo.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..952ff6f9fea5b38575312053b27919f1ed00a13f --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLInfo.d.ts @@ -0,0 +1,39 @@ +import { WebGLProgram } from "./WebGLProgram.js"; + +/** + * An object with a series of statistical information about the graphics board memory and the rendering process. + */ +export class WebGLInfo { + constructor(gl: WebGLRenderingContext); + + /** + * @default true + */ + autoReset: boolean; + + /** + * @default { geometries: 0, textures: 0 } + */ + memory: { + geometries: number; + textures: number; + }; + + /** + * @default null + */ + programs: WebGLProgram[] | null; + + /** + * @default { frame: 0, calls: 0, triangles: 0, points: 0, lines: 0 } + */ + render: { + calls: number; + frame: number; + lines: number; + points: number; + triangles: number; + }; + update(count: number, mode: number, instanceCount: number): void; + reset(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLLights.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLLights.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4c01422e809c0b1248beb95c503fdd41d4cee539 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLLights.d.ts @@ -0,0 +1,49 @@ +import { WebGLExtensions } from "./WebGLExtensions.js"; + +export interface WebGLLightsState { + version: number; + + hash: { + directionalLength: number; + pointLength: number; + spotLength: number; + rectAreaLength: number; + hemiLength: number; + + numDirectionalShadows: number; + numPointShadows: number; + numSpotShadows: number; + numSpotMaps: number; + + numLightProbes: number; + }; + + ambient: number[]; + probe: any[]; + directional: any[]; + directionalShadow: any[]; + directionalShadowMap: any[]; + directionalShadowMatrix: any[]; + spot: any[]; + spotShadow: any[]; + spotShadowMap: any[]; + spotShadowMatrix: any[]; + rectArea: any[]; + point: any[]; + pointShadow: any[]; + pointShadowMap: any[]; + pointShadowMatrix: any[]; + hemi: any[]; + numSpotLightShadowsWithMaps: number; + numLightProbes: number; +} + +export class WebGLLights { + constructor(extensions: WebGLExtensions); + + state: WebGLLightsState; + + get(light: any): any; + setup(lights: any): void; + setupView(lights: any, camera: any): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLObjects.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLObjects.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..aeb0356f7d024024d526df575ac10389cd5eb280 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLObjects.d.ts @@ -0,0 +1,6 @@ +export class WebGLObjects { + constructor(gl: WebGLRenderingContext, geometries: any, attributes: any, info: any); + + update(object: any): any; + dispose(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLProgram.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLProgram.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b3e5d6fd804ee4fd88ec15837018ab3bc4ac5eab --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLProgram.d.ts @@ -0,0 +1,30 @@ +import { WebGLRenderer } from "../WebGLRenderer.js"; +import { WebGLUniforms } from "./WebGLUniforms.js"; + +export class WebGLProgram { + constructor(renderer: WebGLRenderer, cacheKey: string, parameters: object); + + name: string; + id: number; + cacheKey: string; // unique identifier for this program, used for looking up compiled programs from cache. + + /** + * @default 1 + */ + usedTimes: number; + program: any; + vertexShader: WebGLShader; + fragmentShader: WebGLShader; + /** + * @deprecated Use {@link WebGLProgram#getUniforms getUniforms()} instead. + */ + uniforms: any; + /** + * @deprecated Use {@link WebGLProgram#getAttributes getAttributes()} instead. + */ + attributes: any; + + getUniforms(): WebGLUniforms; + getAttributes(): any; + destroy(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLPrograms.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLPrograms.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8f5999f06ee893ae535ce1a1eca2c75efddf01f4 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLPrograms.d.ts @@ -0,0 +1,233 @@ +import { Combine, DepthPackingStrategies, GLSLVersion, Mapping, ShadowMapType, ToneMapping } from "../../constants.js"; +import { Object3D } from "../../core/Object3D.js"; +import { Light } from "../../lights/Light.js"; +import { Material } from "../../materials/Material.js"; +import { Scene } from "../../scenes/Scene.js"; +import { IUniform } from "../shaders/UniformsLib.js"; +import { WebGLRenderer } from "../WebGLRenderer.js"; +import { WebGLBindingStates } from "./WebGLBindingStates.js"; +import { WebGLCapabilities } from "./WebGLCapabilities.js"; +import { WebGLClipping } from "./WebGLClipping.js"; +import { WebGLCubeMaps } from "./WebGLCubeMaps.js"; +import { WebGLExtensions } from "./WebGLExtensions.js"; +import { WebGLLightsState } from "./WebGLLights.js"; +import { WebGLProgram } from "./WebGLProgram.js"; + +export interface WebGLProgramParameters { + shaderID: string; + shaderType: string; + shaderName: string; + + vertexShader: string; + fragmentShader: string; + defines: { [define: string]: string | number | boolean } | undefined; + + customVertexShaderID: string | undefined; + customFragmentShaderID: string | undefined; + + isRawShaderMaterial: boolean; + glslVersion: GLSLVersion | null | undefined; + + precision: "lowp" | "mediump" | "highp"; + + batching: boolean; + batchingColor: boolean; + instancing: boolean; + instancingColor: boolean; + instancingMorph: boolean; + + supportsVertexTextures: boolean; + outputColorSpace: string; + alphaToCoverage: boolean; + + map: boolean; + matcap: boolean; + envMap: boolean; + envMapMode: Mapping | false; + envMapCubeUVHeight: number | null; + aoMap: boolean; + lightMap: boolean; + bumpMap: boolean; + normalMap: boolean; + displacementMap: boolean; + emissiveMap: boolean; + + normalMapObjectSpace: boolean; + normalMapTangentSpace: boolean; + + metalnessMap: boolean; + roughnessMap: boolean; + + anisotropy: boolean; + anisotropyMap: boolean; + + clearcoat: boolean; + clearcoatMap: boolean; + clearcoatNormalMap: boolean; + clearcoatRoughnessMap: boolean; + + dispersion: boolean; + + iridescence: boolean; + iridescenceMap: boolean; + iridescenceThicknessMap: boolean; + + sheen: boolean; + sheenColorMap: boolean; + sheenRoughnessMap: boolean; + + specularMap: boolean; + specularColorMap: boolean; + specularIntensityMap: boolean; + + transmission: boolean; + transmissionMap: boolean; + thicknessMap: boolean; + + gradientMap: boolean; + + opaque: boolean; + + alphaMap: boolean; + alphaTest: boolean; + alphaHash: boolean; + + combine: Combine | undefined; + + // + + mapUv: string | false; + aoMapUv: string | false; + lightMapUv: string | false; + bumpMapUv: string | false; + normalMapUv: string | false; + displacementMapUv: string | false; + emissiveMapUv: string | false; + + metalnessMapUv: string | false; + roughnessMapUv: string | false; + + anisotropyMapUv: string | false; + + clearcoatMapUv: string | false; + clearcoatNormalMapUv: string | false; + clearcoatRoughnessMapUv: string | false; + + iridescenceMapUv: string | false; + iridescenceThicknessMapUv: string | false; + + sheenColorMapUv: string | false; + sheenRoughnessMapUv: string | false; + + specularMapUv: string | false; + specularColorMapUv: string | false; + specularIntensityMapUv: string | false; + + transmissionMapUv: string | false; + thicknessMapUv: string | false; + + alphaMapUv: string | false; + + // + + vertexTangents: boolean; + vertexColors: boolean; + vertexAlphas: boolean; + vertexUv1s: boolean; + vertexUv2s: boolean; + vertexUv3s: boolean; + + pointsUvs: boolean; + + fog: boolean; + useFog: boolean; + fogExp2: boolean; + + flatShading: boolean; + + sizeAttenuation: boolean; + logarithmicDepthBuffer: boolean; + reverseDepthBuffer: boolean; + + skinning: boolean; + + morphTargets: boolean; + morphNormals: boolean; + morphColors: boolean; + morphTargetsCount: number; + morphTextureStride: number; + + numDirLights: number; + numPointLights: number; + numSpotLights: number; + numSpotLightMaps: number; + numRectAreaLights: number; + numHemiLights: number; + + numDirLightShadows: number; + numPointLightShadows: number; + numSpotLightShadows: number; + numSpotLightShadowsWithMaps: number; + + numLightProbes: number; + + numClippingPlanes: number; + numClipIntersection: number; + + dithering: boolean; + + shadowMapEnabled: boolean; + shadowMapType: ShadowMapType; + + toneMapping: ToneMapping; + + decodeVideoTexture: boolean; + decodeVideoTextureEmissive: boolean; + + premultipliedAlpha: boolean; + + doubleSided: boolean; + flipSided: boolean; + + useDepthPacking: boolean; + depthPacking: DepthPackingStrategies | 0; + + index0AttributeName: string | undefined; + + extensionClipCullDistance: boolean; + extensionMultiDraw: boolean; + + rendererExtensionParallelShaderCompile: boolean; + + customProgramCacheKey: string; +} + +export interface WebGLProgramParametersWithUniforms extends WebGLProgramParameters { + uniforms: { [uniform: string]: IUniform }; +} + +export class WebGLPrograms { + constructor( + renderer: WebGLRenderer, + cubemaps: WebGLCubeMaps, + extensions: WebGLExtensions, + capabilities: WebGLCapabilities, + bindingStates: WebGLBindingStates, + clipping: WebGLClipping, + ); + + programs: WebGLProgram[]; + + getParameters( + material: Material, + lights: WebGLLightsState, + shadows: Light[], + scene: Scene, + object: Object3D, + ): WebGLProgramParameters; + + getProgramCacheKey(parameters: WebGLProgramParameters): string; + getUniforms(material: Material): { [uniform: string]: IUniform }; + acquireProgram(parameters: WebGLProgramParametersWithUniforms, cacheKey: string): WebGLProgram; + releaseProgram(program: WebGLProgram): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLProperties.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLProperties.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..adcf01ec9cc31ac2d657ab3d55797844c727a458 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLProperties.d.ts @@ -0,0 +1,9 @@ +export class WebGLProperties { + constructor(); + + has: (object: unknown) => boolean; + get: (object: unknown) => unknown; + remove: (object: unknown) => void; + update: (object: unknown, key: unknown, value: unknown) => unknown; + dispose: () => void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLRenderLists.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLRenderLists.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0f16a42873f978721b6362e819b346546c3277bf --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLRenderLists.d.ts @@ -0,0 +1,66 @@ +import { Camera } from "../../cameras/Camera.js"; +import { BufferGeometry } from "../../core/BufferGeometry.js"; +import { Object3D } from "../../core/Object3D.js"; +import { Material } from "../../materials/Material.js"; +import { Group } from "../../objects/Group.js"; +import { Scene } from "../../scenes/Scene.js"; +import { WebGLProgram } from "./WebGLProgram.js"; +import { WebGLProperties } from "./WebGLProperties.js"; + +export interface RenderItem { + id: number; + object: Object3D; + geometry: BufferGeometry | null; + material: Material; + program: WebGLProgram; + groupOrder: number; + renderOrder: number; + z: number; + group: Group | null; +} + +export class WebGLRenderList { + constructor(properties: WebGLProperties); + + /** + * @default [] + */ + opaque: RenderItem[]; + + /** + * @default [] + */ + transparent: RenderItem[]; + + /** + * @default [] + */ + transmissive: RenderItem[]; + + init(): void; + push( + object: Object3D, + geometry: BufferGeometry | null, + material: Material, + groupOrder: number, + z: number, + group: Group | null, + ): void; + unshift( + object: Object3D, + geometry: BufferGeometry | null, + material: Material, + groupOrder: number, + z: number, + group: Group | null, + ): void; + sort(opaqueSort: (a: any, b: any) => number, transparentSort: (a: any, b: any) => number): void; + finish(): void; +} + +export class WebGLRenderLists { + constructor(properties: WebGLProperties); + + dispose(): void; + get(scene: Scene, renderCallDepth: number): WebGLRenderList; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLShader.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLShader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5704fb88e353d5e727a3b4f105d62eaeef471614 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLShader.d.ts @@ -0,0 +1 @@ +export function WebGLShader(gl: WebGLRenderingContext, type: string, string: string): WebGLShader; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLShadowMap.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLShadowMap.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8368fdee76c0220a7cc3159a9fec5df35cbbf600 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLShadowMap.d.ts @@ -0,0 +1,38 @@ +import { Camera } from "../../cameras/Camera.js"; +import { ShadowMapType } from "../../constants.js"; +import { Light } from "../../lights/Light.js"; +import { Scene } from "../../scenes/Scene.js"; +import { WebGLRenderer } from "../WebGLRenderer.js"; +import { WebGLCapabilities } from "./WebGLCapabilities.js"; +import { WebGLObjects } from "./WebGLObjects.js"; + +export class WebGLShadowMap { + constructor(_renderer: WebGLRenderer, _objects: WebGLObjects, _capabilities: WebGLCapabilities); + + /** + * @default false + */ + enabled: boolean; + + /** + * @default true + */ + autoUpdate: boolean; + + /** + * @default false + */ + needsUpdate: boolean; + + /** + * @default THREE.PCFShadowMap + */ + type: ShadowMapType; + + render(shadowsArray: Light[], scene: Scene, camera: Camera): void; + + /** + * @deprecated Use {@link Material#shadowSide} instead. + */ + cullFace: any; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLState.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLState.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..42c55bceeda48cadd9a0ce4d73bee3d5af7b3ec9 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLState.d.ts @@ -0,0 +1,120 @@ +import { + Blending, + BlendingDstFactor, + BlendingEquation, + BlendingSrcFactor, + CullFace, + DepthModes, +} from "../../constants.js"; +import { Material } from "../../materials/Material.js"; +import { Vector4 } from "../../math/Vector4.js"; +import { WebGLRenderTarget } from "../WebGLRenderTarget.js"; +import { WebGLExtensions } from "./WebGLExtensions.js"; + +declare class WebGLColorBuffer { + setMask(colorMask: boolean): void; + setLocked(lock: boolean): void; + setClear(r: number, g: number, b: number, a: number, premultipliedAlpha: boolean): void; + reset(): void; +} + +declare class WebGLDepthBuffer { + constructor(); + + setReversed(value: boolean): void; + getReversed(): boolean; + setTest(depthTest: boolean): void; + setMask(depthMask: boolean): void; + setFunc(depthFunc: DepthModes): void; + setLocked(lock: boolean): void; + setClear(depth: number): void; + reset(): void; +} + +declare class WebGLStencilBuffer { + constructor(); + + setTest(stencilTest: boolean): void; + setMask(stencilMask: number): void; + setFunc(stencilFunc: number, stencilRef: number, stencilMask: number): void; + setOp(stencilFail: number, stencilZFail: number, stencilZPass: number): void; + setLocked(lock: boolean): void; + setClear(stencil: number): void; + reset(): void; +} + +declare class WebGLState { + constructor(gl: WebGLRenderingContext, extensions: WebGLExtensions); + + buffers: { + color: WebGLColorBuffer; + depth: WebGLDepthBuffer; + stencil: WebGLStencilBuffer; + }; + + enable(id: number): void; + disable(id: number): void; + bindFramebuffer(target: number, framebuffer: WebGLFramebuffer | null): void; + drawBuffers(renderTarget: WebGLRenderTarget | null, framebuffer: WebGLFramebuffer | null): void; + useProgram(program: any): boolean; + setBlending( + blending: Blending, + blendEquation?: BlendingEquation, + blendSrc?: BlendingSrcFactor, + blendDst?: BlendingDstFactor, + blendEquationAlpha?: BlendingEquation, + blendSrcAlpha?: BlendingSrcFactor, + blendDstAlpha?: BlendingDstFactor, + premultiplyAlpha?: boolean, + ): void; + setMaterial(material: Material, frontFaceCW: boolean, hardwareClippingPlanes: number): void; + setFlipSided(flipSided: boolean): void; + setCullFace(cullFace: CullFace): void; + setLineWidth(width: number): void; + setPolygonOffset(polygonoffset: boolean, factor?: number, units?: number): void; + setScissorTest(scissorTest: boolean): void; + activeTexture(webglSlot: number): void; + bindTexture(webglType: number, webglTexture: any): void; + unbindTexture(): void; + // Same interface as https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/compressedTexImage2D + compressedTexImage2D( + target: number, + level: number, + internalformat: number, + width: number, + height: number, + border: number, + data: ArrayBufferView, + ): void; + // Same interface as https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/texImage2D + texImage2D( + target: number, + level: number, + internalformat: number, + width: number, + height: number, + border: number, + format: number, + type: number, + pixels: ArrayBufferView | null, + ): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, source: any): void; + texImage3D( + target: number, + level: number, + internalformat: number, + width: number, + height: number, + depth: number, + border: number, + format: number, + type: number, + pixels: any, + ): void; + scissor(scissor: Vector4): void; + viewport(viewport: Vector4): void; + reset(): void; +} + +export { WebGLState }; +export type { WebGLColorBuffer, WebGLDepthBuffer, WebGLStencilBuffer }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLTextures.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLTextures.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..031866deeb0e61a88dbacdf22ec4cf3adc1dfa61 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLTextures.d.ts @@ -0,0 +1,30 @@ +import { WebGLCapabilities } from "./WebGLCapabilities.js"; +import { WebGLExtensions } from "./WebGLExtensions.js"; +import { WebGLInfo } from "./WebGLInfo.js"; +import { WebGLProperties } from "./WebGLProperties.js"; +import { WebGLState } from "./WebGLState.js"; +import { WebGLUtils } from "./WebGLUtils.js"; + +export class WebGLTextures { + constructor( + gl: WebGLRenderingContext, + extensions: WebGLExtensions, + state: WebGLState, + properties: WebGLProperties, + capabilities: WebGLCapabilities, + utils: WebGLUtils, + info: WebGLInfo, + ); + + allocateTextureUnit(): void; + resetTextureUnits(): void; + setTexture2D(texture: any, slot: number): void; + setTexture2DArray(texture: any, slot: number): void; + setTexture3D(texture: any, slot: number): void; + setTextureCube(texture: any, slot: number): void; + setupRenderTarget(renderTarget: any): void; + updateRenderTargetMipmap(renderTarget: any): void; + updateMultisampleRenderTarget(renderTarget: any): void; + safeSetTexture2D(texture: any, slot: number): void; + safeSetTextureCube(texture: any, slot: number): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLUniforms.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLUniforms.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..925b5e4bf0a17355a28a082bf90eeb85323fc0e1 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLUniforms.d.ts @@ -0,0 +1,12 @@ +import { WebGLProgram } from "./WebGLProgram.js"; +import { WebGLTextures } from "./WebGLTextures.js"; + +export class WebGLUniforms { + constructor(gl: WebGLRenderingContext, program: WebGLProgram); + + setValue(gl: WebGLRenderingContext, name: string, value: any, textures: WebGLTextures): void; + setOptional(gl: WebGLRenderingContext, object: any, name: string): void; + + static upload(gl: WebGLRenderingContext, seq: any, values: any[], textures: WebGLTextures): void; + static seqWithValue(seq: any, values: any[]): any[]; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLUniformsGroups.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLUniformsGroups.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a5e052c1f2eab6b9e6cb492bc6d6b3fceb0a9a5c --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLUniformsGroups.d.ts @@ -0,0 +1,17 @@ +import { UniformsGroup } from "../../core/UniformsGroup.js"; + +import { WebGLCapabilities } from "./WebGLCapabilities.js"; +import { WebGLInfo } from "./WebGLInfo.js"; +import { WebGLProgram } from "./WebGLProgram.js"; +import { WebGLState } from "./WebGLState.js"; + +export function WebGLUniformsGroups( + gl: WebGLRenderingContext, + info: WebGLInfo, + capabilities: WebGLCapabilities, + state: WebGLState, +): { + dispose: () => void; + update: (uniformsGroup: UniformsGroup, program: WebGLProgram) => void; + bind: (uniformsGroup: UniformsGroup, program: WebGLProgram) => void; +}; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLUtils.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLUtils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..53011bfe60da3ea693bee54785bcb280af15da38 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgl/WebGLUtils.d.ts @@ -0,0 +1,11 @@ +import { CompressedPixelFormat, PixelFormat, TextureDataType } from "../../constants.js"; +import { WebGLExtensions } from "./WebGLExtensions.js"; + +export class WebGLUtils { + constructor( + gl: WebGLRenderingContext | WebGL2RenderingContext, + extensions: WebGLExtensions, + ); + + convert(p: PixelFormat | CompressedPixelFormat | TextureDataType, colorSpace?: string): number | null; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgpu/WebGPUBackend.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgpu/WebGPUBackend.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4e407ec35006a27a4f3682d102988ff27be53a07 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgpu/WebGPUBackend.d.ts @@ -0,0 +1,27 @@ +/// + +import { CoordinateSystem, HalfFloatType, UnsignedByteType } from "../../constants.js"; +import Backend, { BackendParameters } from "../common/Backend.js"; + +export interface WebGPUBackendParameters extends BackendParameters { + alpha?: boolean | undefined; + compatibilityMode?: boolean | undefined; + requiredLimits?: Record | undefined; + trackTimestamp?: boolean | undefined; + device?: GPUDevice | undefined; + powerPreference?: GPUPowerPreference | undefined; + context?: GPUCanvasContext | undefined; + outputType?: typeof UnsignedByteType | typeof HalfFloatType | undefined; +} + +export default class WebGPUBackend extends Backend { + readonly isWebGPUBackend: true; + + constructor(parameters?: WebGPUBackendParameters); + + get coordinateSystem(): CoordinateSystem; + + // utils public + + getMaxAnisotropy(): number; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgpu/WebGPURenderer.Nodes.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgpu/WebGPURenderer.Nodes.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b9eb0ddeb9e3e836db7b31b7003614c815155acd --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgpu/WebGPURenderer.Nodes.d.ts @@ -0,0 +1,12 @@ +import Renderer, { RendererParameters } from "../common/Renderer.js"; +import { WebGPUBackendParameters } from "./WebGPUBackend.js"; + +export interface WebGPURendererParameters extends RendererParameters, WebGPUBackendParameters { + forceWebGL?: boolean | undefined; +} + +export default class WebGPURenderer extends Renderer { + readonly isWebGPURenderer: true; + + constructor(parameters?: WebGPURendererParameters); +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgpu/WebGPURenderer.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgpu/WebGPURenderer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f6ee11e63943b794264c6a634d8d8e3894481b20 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgpu/WebGPURenderer.d.ts @@ -0,0 +1,17 @@ +import Renderer, { RendererParameters } from "../common/Renderer.js"; +import StandardNodeLibrary from "./nodes/StandardNodeLibrary.js"; +import { WebGPUBackendParameters } from "./WebGPUBackend.js"; + +export interface WebGPURendererParameters extends RendererParameters, WebGPUBackendParameters { + forceWebGL?: boolean | undefined; +} + +declare class WebGPURenderer extends Renderer { + library: StandardNodeLibrary; + + readonly isWebGPURenderer: true; + + constructor(parameters?: WebGPURendererParameters); +} + +export default WebGPURenderer; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgpu/nodes/BasicNodeLibrary.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgpu/nodes/BasicNodeLibrary.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d78b1b2f88d94f6612386808ce6acef112cd6f75 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgpu/nodes/BasicNodeLibrary.d.ts @@ -0,0 +1,15 @@ +import NodeLibrary from "../../common/nodes/NodeLibrary.js"; +/** + * This version of a node library represents a basic version + * just focusing on lights and tone mapping techniques. + * + * @private + * @augments NodeLibrary + */ +declare class BasicNodeLibrary extends NodeLibrary { + /** + * Constructs a new basic node library. + */ + constructor(); +} +export default BasicNodeLibrary; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgpu/nodes/StandardNodeLibrary.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgpu/nodes/StandardNodeLibrary.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3ed5750ce4460dd257eae42d6f010e30478ff0dc --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgpu/nodes/StandardNodeLibrary.d.ts @@ -0,0 +1,81 @@ +import { LineBasicNodeMaterialNodeProperties } from "../../../materials/nodes/LineBasicNodeMaterial.js"; +import { LineDashedNodeMaterialNodeProperties } from "../../../materials/nodes/LineDashedNodeMaterial.js"; +import { MeshBasicNodeMaterialNodeProperties } from "../../../materials/nodes/MeshBasicNodeMaterial.js"; +import { MeshLambertNodeMaterialNodeProperties } from "../../../materials/nodes/MeshLambertNodeMaterial.js"; +import { MeshMatcapNodeMaterialNodeProperties } from "../../../materials/nodes/MeshMatcapNodeMaterial.js"; +import { MeshNormalNodeMaterialNodeProperties } from "../../../materials/nodes/MeshNormalNodeMaterial.js"; +import { MeshPhongNodeMaterialNodeProperties } from "../../../materials/nodes/MeshPhongNodeMaterial.js"; +import { MeshPhysicalNodeMaterialNodeProperties } from "../../../materials/nodes/MeshPhysicalNodeMaterial.js"; +import { MeshStandardNodeMaterialNodeProperties } from "../../../materials/nodes/MeshStandardNodeMaterial.js"; +import { MeshToonNodeMaterialNodeProperties } from "../../../materials/nodes/MeshToonNodeMaterial.js"; +import { PointsNodeMaterialNodeProperties } from "../../../materials/nodes/PointsNodeMaterial.js"; +import { ShadowNodeMaterialNodeProperties } from "../../../materials/nodes/ShadowNodeMaterial.js"; +import { SpriteNodeMaterialNodeProperties } from "../../../materials/nodes/SpriteNodeMaterial.js"; +import NodeLibrary from "../../common/nodes/NodeLibrary.js"; +/** + * This version of a node library represents the standard version + * used in {@link WebGPURenderer}. It maps lights, tone mapping + * techniques and materials to node-based implementations. + * + * @private + * @augments NodeLibrary + */ +declare class StandardNodeLibrary extends NodeLibrary { + /** + * Constructs a new standard node library. + */ + constructor(); +} +declare module "../../../materials/MeshPhongMaterial.js" { + interface MeshPhongMaterialProperties extends MeshPhongNodeMaterialNodeProperties { + } +} +declare module "../../../materials/MeshStandardMaterial.js" { + interface MeshStandardMaterialProperties extends MeshStandardNodeMaterialNodeProperties { + } +} +declare module "../../../materials/MeshPhysicalMaterial.js" { + interface MeshPhysicalMaterialProperties extends MeshPhysicalNodeMaterialNodeProperties { + } +} +declare module "../../../materials/MeshToonMaterial.js" { + interface MeshToonMaterialProperties extends MeshToonNodeMaterialNodeProperties { + } +} +declare module "../../../materials/MeshBasicMaterial.js" { + interface MeshBasicMaterialProperties extends MeshBasicNodeMaterialNodeProperties { + } +} +declare module "../../../materials/MeshLambertMaterial.js" { + interface MeshLambertMaterialProperties extends MeshLambertNodeMaterialNodeProperties { + } +} +declare module "../../../materials/MeshNormalMaterial.js" { + interface MeshNormalMaterialProperties extends MeshNormalNodeMaterialNodeProperties { + } +} +declare module "../../../materials/MeshMatcapMaterial.js" { + interface MeshMatcapMaterialProperties extends MeshMatcapNodeMaterialNodeProperties { + } +} +declare module "../../../materials/LineBasicMaterial.js" { + interface LineBasicMaterialProperties extends LineBasicNodeMaterialNodeProperties { + } +} +declare module "../../../materials/LineDashedMaterial.js" { + interface LineDashedMaterialProperties extends LineDashedNodeMaterialNodeProperties { + } +} +declare module "../../../materials/PointsMaterial.js" { + interface PointsMaterialProperties extends PointsNodeMaterialNodeProperties { + } +} +declare module "../../../materials/SpriteMaterial.js" { + interface SpriteMaterialProperties extends SpriteNodeMaterialNodeProperties { + } +} +declare module "../../../materials/ShadowMaterial.js" { + interface ShadowMaterialProperties extends ShadowNodeMaterialNodeProperties { + } +} +export default StandardNodeLibrary; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8991342187820cb0760a01d4ce0eb923e6de65df --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts @@ -0,0 +1,125 @@ +import CodeNode from "../../../nodes/code/CodeNode.js"; +import { NodeShaderStage } from "../../../nodes/core/constants.js"; +import NodeBuilder from "../../../nodes/core/NodeBuilder.js"; +import NodeUniform from "../../../nodes/core/NodeUniform.js"; +import NodeVar from "../../../nodes/core/NodeVar.js"; +import StructTypeNode from "../../../nodes/core/StructTypeNode.js"; +import { ShaderNode } from "../../../nodes/tsl/TSLCore.js"; +import { Texture } from "../../../textures/Texture.js"; +import NodeUniformsGroup from "../../common/nodes/NodeUniformsGroup.js"; + +type BuiltinStage = NodeShaderStage | "attribute" | "output"; +interface BuiltinType { + name: string; + property: string; + type: string; +} + +export default class WGSLNodeBuilder extends NodeBuilder { + builtins: { [key in BuiltinStage]: Map }; + uniformGroups: { [key in NodeShaderStage]: NodeUniformsGroup }; + + _generateTextureSample( + texture: Texture, + textureProperty: string, + uvSnippet: string, + depthSnippet: string | null, + shaderStage: NodeShaderStage, + ): string; + _generateVideoSample(textureProperty: string, uvSnippet: string, shaderStage: NodeShaderStage): string; + _generateTextureSampleLevel( + texture: Texture, + textureProperty: string, + uvSnippet: string, + levelSnippet: string, + depthSnippet: string | null, + shaderStage: NodeShaderStage, + ): string; + generateTextureLod(texture: Texture, textureProperty: string, uvSnippet: string, levelSnippet: string): string; + generateTextureLoad( + texture: Texture, + textureProperty: string, + uvIndexSnippet: string, + depthSnippet: string | null, + shaderStage: NodeShaderStage, + ): string; + generateTextureStore( + texture: Texture, + textureProperty: string, + uvIndexSnippet: string, + depthSnippet: string | null, + valueSnippet: string, + ): string; + isUnfilterable(texture: Texture): boolean; + generateTexture( + texture: Texture, + textureProperty: string, + uvSnippet: string, + depthSnippet: string | null, + shaderStage: NodeShaderStage, + ): string; + generateTextureGrad( + texture: Texture, + textureProperty: string, + uvSnippet: string, + gradSnippet: string[], + depthSnippet: string | null, + shaderStage: NodeShaderStage, + ): string; + generateTextureCompare( + texture: Texture, + textureProperty: string, + uvSnippet: string, + compareSnippet: String, + shaderStage: NodeShaderStage, + ): string; + generateTextureLevel( + texture: Texture, + textureProperty: string, + uvSnippet: string, + levelSnippet: string, + depthSnippet: string | null, + shaderStage: NodeShaderStage, + ): string; + + getPropertyName(node: NodeVar | NodeUniform, shaderStage: NodeShaderStage): string; + + getOutputStructName(): string; + + _getUniformGroupCount(shaderStage: NodeShaderStage): number; + + getFunctionOperator(op: string): string | null; + // getStorageAccess(node: StorageTextureNode | StorageBufferNode): string; + + getBuiltin(name: string, property: string, type: string, shaderStage: BuiltinStage): string; + getVertexIndex(): string; + getInstanceIndex(): string; + getDrawIndex(): null; + + buildFunctionCode(shaderNode: ShaderNode): string; + + getFragDepth(): string; + getFragCoord(): string; + getFrontFacing(): string; + + getBuiltins(shaderStage: BuiltinStage): string; + getAttributes(shaderStage: NodeShaderStage): string; + + getStructMembers(struct: StructTypeNode): string; + getStructs(shaderStage: NodeShaderStage): string; + + getVar(type: string, name: string): string; + getVars(shaderStage: NodeShaderStage): string; + getVaryings(shaderStage: NodeShaderStage): string; + getUniforms(shaderStage: NodeShaderStage): string; + buildCode(): void; + getMethod(method: string, output?: string | null): string; + + _getWGSLMethod(method: string): CodeNode | string; + _include(name: string): CodeNode; + _getWGSLVertexCode(shaderData: { [key: string]: string }): string; + _getWGSLFragmentCode(shaderData: { [key: string]: string }): string; + _getWGSLComputeCode(shaderData: { [key: string]: string }, workgroupSize: string): string; + _getWGSLStruct(name: string, vars: string): string; + _getWGSLStructBinding(name: string, vars: string, access: string, binding: number, group: number): string; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgpu/nodes/WGSLNodeFunction.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgpu/nodes/WGSLNodeFunction.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6476dd122587124fcb5c404e2b90573d21640210 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgpu/nodes/WGSLNodeFunction.d.ts @@ -0,0 +1,6 @@ +import NodeFunction from "../../../nodes/core/NodeFunction.js"; + +export default class WGSLNodeFunction extends NodeFunction { + constructor(source: string); + getCode(name?: string): string; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgpu/nodes/WGSLNodeParser.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgpu/nodes/WGSLNodeParser.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6fceb3911018e1781b477b7b4bacba7eb9a043a2 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgpu/nodes/WGSLNodeParser.d.ts @@ -0,0 +1,6 @@ +import NodeParser from "../../../nodes/core/NodeParser.js"; +import WGSLNodeFunction from "./WGSLNodeFunction.js"; + +export default class WGSLNodeParser extends NodeParser { + parseFunction(source: string): WGSLNodeFunction; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgpu/utils/WebGPUConstants.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgpu/utils/WebGPUConstants.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..65adaf938fbf00d67e99a42e7ddf04be29497323 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webgpu/utils/WebGPUConstants.d.ts @@ -0,0 +1,337 @@ +export enum GPUPrimitiveTopology { + PointList = "point-list", + LineList = "line-list", + LineStrip = "line-strip", + TriangleList = "triangle-list", + TriangleStrip = "triangle-strip", +} + +export enum GPUCompareFunction { + Never = "never", + Less = "less", + Equal = "equal", + LessEqual = "less-equal", + Greater = "greater", + NotEqual = "not-equal", + GreaterEqual = "greater-equal", + Always = "always", +} + +export enum GPUStoreOp { + Store = "store", + Discard = "discard", +} + +export enum GPULoadOp { + Load = "load", + Clear = "clear", +} + +export enum GPUFrontFace { + CCW = "ccw", + CW = "cw", +} + +export enum GPUCullMode { + None = "none", + Front = "front", + Back = "back", +} + +export enum GPUIndexFormat { + Uint16 = "uint16", + Uint32 = "uint32", +} + +export enum GPUVertexFormat { + Uint8x2 = "uint8x2", + Uint8x4 = "uint8x4", + Sint8x2 = "sint8x2", + Sint8x4 = "sint8x4", + Unorm8x2 = "unorm8x2", + Unorm8x4 = "unorm8x4", + Snorm8x2 = "snorm8x2", + Snorm8x4 = "snorm8x4", + Uint16x2 = "uint16x2", + Uint16x4 = "uint16x4", + Sint16x2 = "sint16x2", + Sint16x4 = "sint16x4", + Unorm16x2 = "unorm16x2", + Unorm16x4 = "unorm16x4", + Snorm16x2 = "snorm16x2", + Snorm16x4 = "snorm16x4", + Float16x2 = "float16x2", + Float16x4 = "float16x4", + Float32 = "float32", + Float32x2 = "float32x2", + Float32x3 = "float32x3", + Float32x4 = "float32x4", + Uint32 = "uint32", + Uint32x2 = "uint32x2", + Uint32x3 = "uint32x3", + Uint32x4 = "uint32x4", + Sint32 = "sint32", + Sint32x2 = "sint32x2", + Sint32x3 = "sint32x3", + Sint32x4 = "sint32x4", +} + +export enum GPUTextureFormat { + // 8-bit formats + + R8Unorm = "r8unorm", + R8Snorm = "r8snorm", + R8Uint = "r8uint", + R8Sint = "r8sint", + + // 16-bit formats + + R16Uint = "r16uint", + R16Sint = "r16sint", + R16Float = "r16float", + RG8Unorm = "rg8unorm", + RG8Snorm = "rg8snorm", + RG8Uint = "rg8uint", + RG8Sint = "rg8sint", + + // 32-bit formats + + R32Uint = "r32uint", + R32Sint = "r32sint", + R32Float = "r32float", + RG16Uint = "rg16uint", + RG16Sint = "rg16sint", + RG16Float = "rg16float", + RGBA8Unorm = "rgba8unorm", + RGBA8UnormSRGB = "rgba8unorm-srgb", + RGBA8Snorm = "rgba8snorm", + RGBA8Uint = "rgba8uint", + RGBA8Sint = "rgba8sint", + BGRA8Unorm = "bgra8unorm", + BGRA8UnormSRGB = "bgra8unorm-srgb", + // Packed 32-bit formats + RGB9E5UFloat = "rgb9e5ufloat", + RGB10A2Unorm = "rgb10a2unorm", + RG11B10UFloat = "rg11b10ufloat", + + // 64-bit formats + + RG32Uint = "rg32uint", + RG32Sint = "rg32sint", + RG32Float = "rg32float", + RGBA16Uint = "rgba16uint", + RGBA16Sint = "rgba16sint", + RGBA16Float = "rgba16float", + + // 128-bit formats + + RGBA32Uint = "rgba32uint", + RGBA32Sint = "rgba32sint", + RGBA32Float = "rgba32float", + + // Depth and stencil formats + + Stencil8 = "stencil8", + Depth16Unorm = "depth16unorm", + Depth24Plus = "depth24plus", + Depth24PlusStencil8 = "depth24plus-stencil8", + Depth32Float = "depth32float", + + // 'depth32float-stencil8' extension + + Depth32FloatStencil8 = "depth32float-stencil8", + + // BC compressed formats usable if 'texture-compression-bc' is both + // supported by the device/user agent and enabled in requestDevice. + + BC1RGBAUnorm = "bc1-rgba-unorm", + BC1RGBAUnormSRGB = "bc1-rgba-unorm-srgb", + BC2RGBAUnorm = "bc2-rgba-unorm", + BC2RGBAUnormSRGB = "bc2-rgba-unorm-srgb", + BC3RGBAUnorm = "bc3-rgba-unorm", + BC3RGBAUnormSRGB = "bc3-rgba-unorm-srgb", + BC4RUnorm = "bc4-r-unorm", + BC4RSnorm = "bc4-r-snorm", + BC5RGUnorm = "bc5-rg-unorm", + BC5RGSnorm = "bc5-rg-snorm", + BC6HRGBUFloat = "bc6h-rgb-ufloat", + BC6HRGBFloat = "bc6h-rgb-float", + BC7RGBAUnorm = "bc7-rgba-unorm", + BC7RGBAUnormSRGB = "bc7-rgba-srgb", + + // ETC2 compressed formats usable if 'texture-compression-etc2' is both + // supported by the device/user agent and enabled in requestDevice. + + ETC2RGB8Unorm = "etc2-rgb8unorm", + ETC2RGB8UnormSRGB = "etc2-rgb8unorm-srgb", + ETC2RGB8A1Unorm = "etc2-rgb8a1unorm", + ETC2RGB8A1UnormSRGB = "etc2-rgb8a1unorm-srgb", + ETC2RGBA8Unorm = "etc2-rgba8unorm", + ETC2RGBA8UnormSRGB = "etc2-rgba8unorm-srgb", + EACR11Unorm = "eac-r11unorm", + EACR11Snorm = "eac-r11snorm", + EACRG11Unorm = "eac-rg11unorm", + EACRG11Snorm = "eac-rg11snorm", + + // ASTC compressed formats usable if 'texture-compression-astc' is both + // supported by the device/user agent and enabled in requestDevice. + + ASTC4x4Unorm = "astc-4x4-unorm", + ASTC4x4UnormSRGB = "astc-4x4-unorm-srgb", + ASTC5x4Unorm = "astc-5x4-unorm", + ASTC5x4UnormSRGB = "astc-5x4-unorm-srgb", + ASTC5x5Unorm = "astc-5x5-unorm", + ASTC5x5UnormSRGB = "astc-5x5-unorm-srgb", + ASTC6x5Unorm = "astc-6x5-unorm", + ASTC6x5UnormSRGB = "astc-6x5-unorm-srgb", + ASTC6x6Unorm = "astc-6x6-unorm", + ASTC6x6UnormSRGB = "astc-6x6-unorm-srgb", + ASTC8x5Unorm = "astc-8x5-unorm", + ASTC8x5UnormSRGB = "astc-8x5-unorm-srgb", + ASTC8x6Unorm = "astc-8x6-unorm", + ASTC8x6UnormSRGB = "astc-8x6-unorm-srgb", + ASTC8x8Unorm = "astc-8x8-unorm", + ASTC8x8UnormSRGB = "astc-8x8-unorm-srgb", + ASTC10x5Unorm = "astc-10x5-unorm", + ASTC10x5UnormSRGB = "astc-10x5-unorm-srgb", + ASTC10x6Unorm = "astc-10x6-unorm", + ASTC10x6UnormSRGB = "astc-10x6-unorm-srgb", + ASTC10x8Unorm = "astc-10x8-unorm", + ASTC10x8UnormSRGB = "astc-10x8-unorm-srgb", + ASTC10x10Unorm = "astc-10x10-unorm", + ASTC10x10UnormSRGB = "astc-10x10-unorm-srgb", + ASTC12x10Unorm = "astc-12x10-unorm", + ASTC12x10UnormSRGB = "astc-12x10-unorm-srgb", + ASTC12x12Unorm = "astc-12x12-unorm", + ASTC12x12UnormSRGB = "astc-12x12-unorm-srgb", +} + +export enum GPUAddressMode { + ClampToEdge = "clamp-to-edge", + Repeat = "repeat", + MirrorRepeat = "mirror-repeat", +} + +export enum GPUFilterMode { + Linear = "linear", + Nearest = "nearest", +} + +export enum GPUBlendFactor { + Zero = "zero", + One = "one", + Src = "src", + OneMinusSrc = "one-minus-src", + SrcAlpha = "src-alpha", + OneMinusSrcAlpha = "one-minus-src-alpha", + Dst = "dst", + OneMinusDst = "one-minus-dst", + DstAlpha = "dst-alpha", + OneMinusDstAlpha = "one-minus-dst-alpha", + SrcAlphaSaturated = "src-alpha-saturated", + Constant = "constant", + OneMinusConstant = "one-minus-constant", +} + +export enum GPUBlendOperation { + Add = "add", + Subtract = "subtract", + ReverseSubtract = "reverse-subtract", + Min = "min", + Max = "max", +} + +export enum GPUColorWriteFlags { + None = 0, + Red = 0x1, + Green = 0x2, + Blue = 0x4, + Alpha = 0x8, + All = 0xF, +} + +export enum GPUStencilOperation { + Keep = "keep", + Zero = "zero", + Replace = "replace", + Invert = "invert", + IncrementClamp = "increment-clamp", + DecrementClamp = "decrement-clamp", + IncrementWrap = "increment-wrap", + DecrementWrap = "decrement-wrap", +} + +export enum GPUBufferBindingType { + Uniform = "uniform", + Storage = "storage", + ReadOnlyStorage = "read-only-storage", +} + +export enum GPUStorageTextureAccess { + WriteOnly = "write-only", + ReadOnly = "read-only", + ReadWrite = "read-write", +} + +export enum GPUSamplerBindingType { + Filtering = "filtering", + NonFiltering = "non-filtering", + Comparison = "comparison", +} + +export enum GPUTextureSampleType { + Float = "float", + UnfilterableFloat = "unfilterable-float", + Depth = "depth", + SInt = "sint", + UInt = "uint", +} + +export enum GPUTextureDimension { + OneD = "1d", + TwoD = "2d", + ThreeD = "3d", +} + +export enum GPUTextureViewDimension { + OneD = "1d", + TwoD = "2d", + TwoDArray = "2d-array", + Cube = "cube", + CubeArray = "cube-array", + ThreeD = "3d", +} + +export enum GPUTextureAspect { + All = "all", + StencilOnly = "stencil-only", + DepthOnly = "depth-only", +} + +export enum GPUInputStepMode { + Vertex = "vertex", + Instance = "instance", +} + +export enum GPUFeatureName { + CoreFeaturesAndLimits = "core-features-and-limits", + DepthClipControl = "depth-clip-control", + Depth32FloatStencil8 = "depth32float-stencil8", + TextureCompressionBC = "texture-compression-bc", + TextureCompressionBCSliced3D = "texture-compression-bc-sliced-3d", + TextureCompressionETC2 = "texture-compression-etc2", + TextureCompressionASTC = "texture-compression-astc", + TextureCompressionASTCSliced3D = "texture-compression-astc-sliced-3d", + TimestampQuery = "timestamp-query", + IndirectFirstInstance = "indirect-first-instance", + ShaderF16 = "shader-f16", + RG11B10UFloat = "rg11b10ufloat-renderable", + BGRA8UNormStorage = "bgra8unorm-storage", + Float32Filterable = "float32-filterable", + Float32Blendable = "float32-blendable", + ClipDistances = "clip-distances", + DualSourceBlending = "dual-source-blending", + Subgroups = "subgroups", + TextureFormatsTier1 = "texture-formats-tier1", + TextureFormatsTier2 = "texture-formats-tier2", +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webxr/WebXRController.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webxr/WebXRController.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..956a036b4f4a603c4abd09d0ba154fd144ba23ff --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webxr/WebXRController.d.ts @@ -0,0 +1,63 @@ +import { Object3DEventMap } from "../../core/Object3D.js"; +import { Vector3 } from "../../math/Vector3.js"; +import { Group } from "../../objects/Group.js"; + +export type XRControllerEventType = XRSessionEventType | XRInputSourceEventType | "disconnected" | "connected"; + +export class XRJointSpace extends Group { + readonly jointRadius: number | undefined; +} + +export type XRHandJoints = Record; + +export interface XRHandInputState { + pinching: boolean; +} + +export interface WebXRSpaceEventMap extends Object3DEventMap { + select: { data: XRInputSource }; + selectstart: { data: XRInputSource }; + selectend: { data: XRInputSource }; + squeeze: { data: XRInputSource }; + squeezestart: { data: XRInputSource }; + squeezeend: { data: XRInputSource }; + + connected: { data: XRInputSource }; + disconnected: { data: XRInputSource }; + + pinchend: { handedness: XRHandedness; target: WebXRController }; // This Event break the THREE.EventDispatcher contract, replacing the target to the wrong instance. + pinchstart: { handedness: XRHandedness; target: WebXRController }; // This Event break the THREE.EventDispatcher contract, replacing the target to the wrong instance. + + move: {}; +} + +export class XRHandSpace extends Group { + readonly joints: Partial; + readonly inputState: XRHandInputState; +} + +export class XRTargetRaySpace extends Group { + hasLinearVelocity: boolean; + readonly linearVelocity: Vector3; + hasAngularVelocity: boolean; + readonly angularVelocity: Vector3; +} + +export class XRGripSpace extends Group { + hasLinearVelocity: boolean; + readonly linearVelocity: Vector3; + hasAngularVelocity: boolean; + readonly angularVelocity: Vector3; +} + +export class WebXRController { + constructor(); + + getHandSpace(): XRHandSpace; + getTargetRaySpace(): XRTargetRaySpace; + getGripSpace(): XRGripSpace; + dispatchEvent(event: { type: XRControllerEventType; data?: XRInputSource }): this; + connect(inputSource: XRInputSource): this; + disconnect(inputSource: XRInputSource): this; + update(inputSource: XRInputSource, frame: XRFrame, referenceSpace: XRReferenceSpace): this; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webxr/WebXRDepthSensing.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webxr/WebXRDepthSensing.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..35a98c2a7f6ef93471f631a57a02d683ffa8201c --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webxr/WebXRDepthSensing.d.ts @@ -0,0 +1,21 @@ +import { Mesh } from "../../objects/Mesh.js"; +import { ExternalTexture } from "../../textures/ExternalTexture.js"; +import { WebXRArrayCamera } from "./WebXRManager.js"; + +export class WebXRDepthSensing { + texture: ExternalTexture | null; + mesh: Mesh | null; + + depthNear: number; + depthFar: number; + + constructor(); + + init(depthData: XRWebGLDepthInformation, renderState: XRRenderState): void; + + getMesh(cameraXR: WebXRArrayCamera): Mesh | null; + + reset(): void; + + getDepthTexture(): ExternalTexture | null; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webxr/WebXRManager.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webxr/WebXRManager.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b7c84b6395c05ef121e17d9f33e776fd0e4143cc --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/renderers/webxr/WebXRManager.d.ts @@ -0,0 +1,87 @@ +/// + +import { ArrayCamera } from "../../cameras/ArrayCamera.js"; +import { PerspectiveCamera } from "../../cameras/PerspectiveCamera.js"; +import { EventDispatcher } from "../../core/EventDispatcher.js"; +import { Vector4 } from "../../math/Vector4.js"; +import { Mesh } from "../../objects/Mesh.js"; +import { ExternalTexture } from "../../textures/ExternalTexture.js"; +import { WebGLRenderer } from "../WebGLRenderer.js"; +import { XRGripSpace, XRHandSpace, XRTargetRaySpace } from "./WebXRController.js"; + +export type WebXRCamera = PerspectiveCamera & { viewport: Vector4 }; +export type WebXRArrayCamera = Omit & { cameras: [WebXRCamera, WebXRCamera] }; + +export interface WebXRManagerEventMap { + sessionstart: {}; + sessionend: {}; + planeadded: { data: XRPlane }; + planeremoved: { data: XRPlane }; + planechanged: { data: XRPlane }; + planesdetected: { data: XRPlaneSet }; +} + +export class WebXRManager extends EventDispatcher { + /** + * @default true + */ + cameraAutoUpdate: boolean; + + /** + * @default false + */ + enabled: boolean; + + /** + * @default false + */ + isPresenting: boolean; + + constructor(renderer: WebGLRenderer, gl: WebGLRenderingContext); + + getController: (index: number) => XRTargetRaySpace; + + getControllerGrip: (index: number) => XRGripSpace; + + getHand: (index: number) => XRHandSpace; + + setFramebufferScaleFactor: (value: number) => void; + + setReferenceSpaceType: (value: XRReferenceSpaceType) => void; + + getReferenceSpace: () => XRReferenceSpace | null; + + setReferenceSpace: (value: XRReferenceSpace) => void; + + getBaseLayer: () => XRWebGLLayer | XRProjectionLayer; + + getBinding: () => XRWebGLBinding; + + getFrame: () => XRFrame; + + getSession: () => XRSession | null; + + setSession: (value: XRSession | null) => Promise; + + getEnvironmentBlendMode: () => XREnvironmentBlendMode | undefined; + + getDepthTexture: () => ExternalTexture | null; + + updateCamera: (camera: PerspectiveCamera) => void; + + getCamera: () => WebXRArrayCamera; + + getFoveation: () => number | undefined; + + setFoveation: (value: number) => void; + + hasDepthSensing: () => boolean; + + getDepthSensingMesh: () => Mesh | null; + + getCameraTexture: (xrCamera: WebXRCamera) => ExternalTexture | undefined; + + setAnimationLoop: (callback: XRFrameRequestCallback | null) => void; + + dispose: () => void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/scenes/Fog.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/scenes/Fog.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc0f180197fd30c0324ee6a211ccdeb69f5011be --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/scenes/Fog.d.ts @@ -0,0 +1,77 @@ +import { Color, ColorRepresentation } from "../math/Color.js"; + +export interface FogJSON { + type: string; + name: string; + color: number; + near: number; + far: number; +} + +/** + * This class contains the parameters that define linear fog, i.e., that grows linearly denser with the distance. + * @example + * ```typescript + * const scene = new THREE.Scene(); + * scene.fog = new THREE.Fog(0xcccccc, 10, 15); + * ``` + * @see {@link https://threejs.org/docs/index.html#api/en/scenes/Fog | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/scenes/Fog.js | Source} + */ +export class Fog { + /** + * The color parameter is passed to the {@link THREE.Color | Color} constructor to set the color property + * @remarks + * Color can be a hexadecimal integer or a CSS-style string. + * @param color + * @param near Expects a `Float` + * @param far Expects a `Float` + */ + constructor(color: ColorRepresentation, near?: number, far?: number); + + /** + * Read-only flag to check if a given object is of type {@link Fog}. + * @remarks This is a _constant_ value + * @defaultValue `true` + */ + readonly isFog: true; + + /** + * Optional name of the object + * @remarks _(doesn't need to be unique)_. + * @defaultValue `""` + */ + name: string; + + /** + * Fog color. + * @remarks If set to black, far away objects will be rendered black. + */ + color: Color; + + /** + * The minimum distance to start applying fog. + * @remarks Objects that are less than **near** units from the active camera won't be affected by fog. + * @defaultValue `1` + * @remarks Expects a `Float` + */ + near: number; + + /** + * The maximum distance at which fog stops being calculated and applied. + * @remarks Objects that are more than **far** units away from the active camera won't be affected by fog. + * @defaultValue `1000` + * @remarks Expects a `Float` + */ + far: number; + + /** + * Returns a new {@link Fog} instance with the same parameters as this one. + */ + clone(): Fog; + + /** + * Return {@link Fog} data in JSON format. + */ + toJSON(): FogJSON; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/scenes/FogExp2.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/scenes/FogExp2.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..af00981e66609605d993993565b1274580388c39 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/scenes/FogExp2.d.ts @@ -0,0 +1,66 @@ +import { Color, ColorRepresentation } from "../math/Color.js"; + +export interface FogExp2JSON { + type: string; + name: string; + color: number; + density: number; +} + +/** + * This class contains the parameters that define exponential squared fog, which gives a clear view near the camera and a faster than exponentially densening fog farther from the camera. + * @example + * ```typescript + * const scene = new THREE.Scene(); + * scene.fog = new THREE.FogExp2(0xcccccc, 0.002); + * ``` + * @see Example: {@link https://threejs.org/examples/#webgl_geometry_terrain | webgl geometry terrain} + * @see {@link https://threejs.org/docs/index.html#api/en/scenes/FogExp2 | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/scenes/FogExp2.js | Source} + */ +export class FogExp2 { + /** + * The color parameter is passed to the {@link THREE.Color | Color} constructor to set the color property + * @remarks Color can be a hexadecimal integer or a CSS-style string. + * @param color + * @param density Expects a `Float` + */ + constructor(color: ColorRepresentation, density?: number); + + /** + * Read-only flag to check if a given object is of type {@link FogExp2}. + * @remarks This is a _constant_ value + * @defaultValue `true` + */ + readonly isFogExp2: true; + + /** + * Optional name of the object + * @remarks _(doesn't need to be unique)_. + * @defaultValue `""` + */ + name: string; + + /** + * Fog color. + * @remarks If set to black, far away objects will be rendered black. + */ + color: Color; + + /** + * Defines how fast the fog will grow dense. + * @defaultValue `0.00025` + * @remarks Expects a `Float` + */ + density: number; + + /** + * Returns a new {@link FogExp2} instance with the same parameters as this one. + */ + clone(): FogExp2; + + /** + * Return {@link FogExp2} data in JSON format. + */ + toJSON(): FogExp2JSON; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/scenes/Scene.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/scenes/Scene.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c2f43afd7b0b5b452561d7eea6e1b3faa958b6f5 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/scenes/Scene.d.ts @@ -0,0 +1,118 @@ +import { JSONMeta, Object3D, Object3DJSON, Object3DJSONObject } from "../core/Object3D.js"; +import { Material } from "../materials/Material.js"; +import { Color } from "../math/Color.js"; +import { Euler, EulerTuple } from "../math/Euler.js"; +import { CubeTexture } from "../textures/CubeTexture.js"; +import { Texture } from "../textures/Texture.js"; +import { Fog, FogJSON } from "./Fog.js"; +import { FogExp2, FogExp2JSON } from "./FogExp2.js"; + +export interface SceneJSONObject extends Object3DJSONObject { + fog?: FogJSON | FogExp2JSON; + + backgroundBlurriness?: number; + backgroundIntensity?: number; + backgroundRotation: EulerTuple; + + environmentIntensity?: number; + environmentRotation: EulerTuple; +} + +export interface SceneJSON extends Object3DJSON { + object: SceneJSONObject; +} + +/** + * Scenes allow you to set up what and where is to be rendered by three.js + * @remarks + * This is where you place objects, lights and cameras. + * @see Example: {@link https://threejs.org/examples/#webgl_multiple_scenes_comparison | webgl multiple scenes comparison} + * @see {@link https://threejs.org/docs/index.html#manual/en/introduction/Creating-a-scene | Manual: Creating a scene} + * @see {@link https://threejs.org/docs/index.html#api/en/scenes/Scene | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/scenes/Scene.js | Source} + */ +export class Scene extends Object3D { + /** + * Create a new {@link Scene} object. + */ + constructor(); + + /** + * Read-only flag to check if a given object is of type {@link Scene}. + * @remarks This is a _constant_ value + * @defaultValue `true` + */ + readonly isScene: true; + + /** + * @defaultValue `Scene` + */ + type: "Scene"; + + /** + * A {@link Fog | fog} instance defining the type of fog that affects everything rendered in the scene. + * @defaultValue `null` + */ + fog: Fog | FogExp2 | null; + + /** + * Sets the blurriness of the background. Only influences environment maps assigned to {@link THREE.Scene.background | Scene.background}. + * @defaultValue `0` + * @remarks Expects a `Float` between `0` and `1`. + */ + backgroundBlurriness: number; + + /** + * Attenuates the color of the background. Only applies to background textures. + * @defaultValue `1` + * @remarks Expects a `Float` + */ + backgroundIntensity: number; + + /** + * Forces everything in the {@link Scene} to be rendered with the defined material. + * @defaultValue `null` + */ + overrideMaterial: Material | null; + + /** + * Defines the background of the scene. + * @remarks Valid inputs are: + * - A {@link THREE.Color | Color} for defining a uniform colored background. + * - A {@link THREE.Texture | Texture} for defining a (flat) textured background. + * - Texture cubes ({@link THREE.CubeTexture | CubeTexture}) or equirectangular textures for defining a skybox. + * @defaultValue `null` + */ + background: Color | Texture | CubeTexture | null; + + /** + * The rotation of the background in radians. Only influences environment maps assigned to {@link .background}. + * Default is `(0,0,0)`. + */ + backgroundRotation: Euler; + + /** + * Sets the environment map for all physical materials in the scene. + * However, it's not possible to overwrite an existing texture assigned to {@link THREE.MeshStandardMaterial.envMap | MeshStandardMaterial.envMap}. + * @defaultValue `null` + */ + environment: Texture | null; + + /** + * Attenuates the color of the environment. Only influences environment maps assigned to {@link Scene.environment}. + * @default 1 + */ + environmentIntensity: number; + + /** + * The rotation of the environment map in radians. Only influences physical materials in the scene when + * {@link .environment} is used. Default is `(0,0,0)`. + */ + environmentRotation: Euler; + + /** + * Convert the {@link Scene} to three.js {@link https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 | JSON Object/Scene format}. + * @param meta Object containing metadata such as textures or images for the scene. + */ + toJSON(meta?: JSONMeta): SceneJSON; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/textures/CanvasTexture.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/textures/CanvasTexture.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4db5b83165bbe768bd98b1e9b85bbfc8903a5d8f --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/textures/CanvasTexture.d.ts @@ -0,0 +1,51 @@ +import { + MagnificationTextureFilter, + Mapping, + MinificationTextureFilter, + PixelFormat, + TextureDataType, + Wrapping, +} from "../constants.js"; +import { OffscreenCanvas, Texture } from "./Texture.js"; + +/** + * Creates a texture from a {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas | canvas element}. + * @remarks + * This is almost the same as the base {@link Texture | Texture} class, + * except that it sets {@link Texture.needsUpdate | needsUpdate} to `true` immediately. + * @see {@link THREE.Texture | Texture} + * @see {@link https://threejs.org/docs/index.html#api/en/textures/CanvasTexture | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/textures/CanvasTexture.js | Source} + */ +export class CanvasTexture extends Texture { + /** + * This creates a new {@link THREE.CanvasTexture | CanvasTexture} object. + * @param canvas The HTML canvas element from which to load the texture. + * @param mapping See {@link Texture.mapping | .mapping}. Default {@link THREE.Texture.DEFAULT_MAPPING} + * @param wrapS See {@link Texture.wrapS | .wrapS}. Default {@link THREE.ClampToEdgeWrapping} + * @param wrapT See {@link Texture.wrapT | .wrapT}. Default {@link THREE.ClampToEdgeWrapping} + * @param magFilter See {@link Texture.magFilter | .magFilter}. Default {@link THREE.LinearFilter} + * @param minFilter See {@link Texture.minFilter | .minFilter}. Default {@link THREE.LinearMipmapLinearFilter} + * @param format See {@link Texture.format | .format}. Default {@link THREE.RGBAFormat} + * @param type See {@link Texture.type | .type}. Default {@link THREE.UnsignedByteType} + * @param anisotropy See {@link Texture.anisotropy | .anisotropy}. Default {@link THREE.Texture.DEFAULT_ANISOTROPY} + */ + constructor( + canvas?: TexImageSource | OffscreenCanvas, + mapping?: Mapping, + wrapS?: Wrapping, + wrapT?: Wrapping, + magFilter?: MagnificationTextureFilter, + minFilter?: MinificationTextureFilter, + format?: PixelFormat, + type?: TextureDataType, + anisotropy?: number, + ); + + /** + * Read-only flag to check if a given object is of type {@link CanvasTexture}. + * @remarks This is a _constant_ value + * @defaultValue `true` + */ + readonly isCanvasTexture: true; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/textures/CompressedArrayTexture.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/textures/CompressedArrayTexture.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e46c3d47898fa8e7998cd6270af98663c9ffdfdc --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/textures/CompressedArrayTexture.d.ts @@ -0,0 +1,68 @@ +import { CompressedPixelFormat, TextureDataType, Wrapping } from "../constants.js"; +import { CompressedTexture, CompressedTextureMipmap } from "./CompressedTexture.js"; + +/** + * Creates an texture 2D array based on data in compressed form, for example from a + * {@link https://en.wikipedia.org/wiki/DirectDraw_Surface | DDS} file. + * @remarks For use with the {@link THREE.CompressedTextureLoader | CompressedTextureLoader}. + * @see {@link https://threejs.org/docs/index.html#api/en/textures/CompressedArrayTexture | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/textures/CompressedArrayTexture.js | Source} + */ +export class CompressedArrayTexture extends CompressedTexture { + /** + * Read-only flag to check if a given object is of type {@link CompressedArrayTexture}. + * @remarks This is a _constant_ value + * @defaultValue `true` + */ + readonly isCompressedArrayTexture: true; + + /** + * Overridden with a object containing width and height. + * @override + */ + get image(): { width: number; height: number; depth: number }; + set image(value: { width: number; height: number; depth: number }); + + /** + * This defines how the texture is wrapped in the depth direction. + * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants} + * @defaultValue {@link THREE.ClampToEdgeWrapping} + */ + wrapR: Wrapping; + + /** + * A set of all layers which need to be updated in the texture. See {@link CompressedArrayTexture.addLayerUpdate}. + */ + layerUpdates: Set; + + /** + * Create a new instance of {@link CompressedArrayTexture} + * @param mipmaps The mipmaps array should contain objects with data, width and height. The mipmaps should be of the + * correct format and type. + * @param width The width of the biggest mipmap. + * @param height The height of the biggest mipmap. + * @param depth The number of layers of the 2D array texture + * @param format The format used in the mipmaps. See {@link THREE.CompressedPixelFormat}. + * @param type See {@link Texture.type | .type}. Default {@link THREE.UnsignedByteType} + */ + constructor( + mipmaps: CompressedTextureMipmap[], + width: number, + height: number, + depth: number, + format: CompressedPixelFormat, + type?: TextureDataType, + ); + + /** + * Describes that a specific layer of the texture needs to be updated. Normally when {@link Texture.needsUpdate} is + * set to true, the entire compressed texture array is sent to the GPU. Marking specific layers will only transmit + * subsets of all mipmaps associated with a specific depth in the array which is often much more performant. + */ + addLayerUpdate(layerIndex: number): void; + + /** + * Resets the layer updates registry. See {@link CompressedArrayTexture.addLayerUpdate}. + */ + clearLayoutUpdates(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/textures/CompressedCubeTexture.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/textures/CompressedCubeTexture.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9c72145a05e51ab21321852ba64971138e4b2680 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/textures/CompressedCubeTexture.d.ts @@ -0,0 +1,13 @@ +import { CompressedPixelFormat, TextureDataType } from "../constants.js"; +import { CompressedTexture } from "./CompressedTexture.js"; + +export class CompressedCubeTexture extends CompressedTexture { + readonly isCompressedCubeTexture: true; + readonly isCubeTexture: true; + + constructor( + images: Array<{ width: number; height: number }>, + format?: CompressedPixelFormat, + type?: TextureDataType, + ); +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/textures/CompressedTexture.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/textures/CompressedTexture.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8112f90ee0ebda8b905f78d9226151109c99e157 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/textures/CompressedTexture.d.ts @@ -0,0 +1,94 @@ +import { + CompressedPixelFormat, + MagnificationTextureFilter, + Mapping, + MinificationTextureFilter, + TextureDataType, + Wrapping, +} from "../constants.js"; +import { TypedArray } from "../core/BufferAttribute.js"; +import { Texture } from "./Texture.js"; + +export interface CompressedTextureMipmap { + data: TypedArray; + width: number; + height: number; +} + +/** + * Creates a texture based on data in compressed form, for example from a {@link https://en.wikipedia.org/wiki/DirectDraw_Surface | DDS} file. + * @remarks For use with the {@link THREE.CompressedTextureLoader | CompressedTextureLoader}. + * @see {@link https://threejs.org/docs/index.html#api/en/textures/CompressedTexture | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/textures/CompressedTexture.js | Source} + */ +export class CompressedTexture extends Texture { + /** + * This creates a new {@link THREE.CompressedTexture | CompressedTexture} object. + * @param mipmaps The mipmaps array should contain objects with data, width and height. The mipmaps should be of the + * correct format and type. + * @param width The width of the biggest mipmap. + * @param height The height of the biggest mipmap. + * @param format The format used in the mipmaps. See {@link THREE.CompressedPixelFormat}. + * @param type See {@link Texture.type | .type}. Default {@link THREE.UnsignedByteType} + * @param mapping See {@link Texture.mapping | .mapping}. Default {@link THREE.Texture.DEFAULT_MAPPING} + * @param wrapS See {@link Texture.wrapS | .wrapS}. Default {@link THREE.ClampToEdgeWrapping} + * @param wrapT See {@link Texture.wrapT | .wrapT}. Default {@link THREE.ClampToEdgeWrapping} + * @param magFilter See {@link Texture.magFilter | .magFilter}. Default {@link THREE.LinearFilter} + * @param minFilter See {@link Texture.minFilter | .minFilter}. Default {@link THREE.LinearMipmapLinearFilter} + * @param anisotropy See {@link Texture.anisotropy | .anisotropy}. Default {@link THREE.Texture.DEFAULT_ANISOTROPY} + * @param colorSpace See {@link Texture.colorSpace .colorSpace}. Default {@link NoColorSpace} + */ + constructor( + mipmaps: CompressedTextureMipmap[], + width: number, + height: number, + format?: CompressedPixelFormat, + type?: TextureDataType, + mapping?: Mapping, + wrapS?: Wrapping, + wrapT?: Wrapping, + magFilter?: MagnificationTextureFilter, + minFilter?: MinificationTextureFilter, + anisotropy?: number, + colorSpace?: string, + ); + + /** + * Read-only flag to check if a given object is of type {@link CompressedTexture}. + * @remarks This is a _constant_ value + * @defaultValue `true` + */ + readonly isCompressedTexture: true; + + /** + * Overridden with a object containing width and height. + * @override + */ + get image(): { width: number; height: number }; + set image(value: { width: number; height: number }); + + /** + * The mipmaps array should contain objects with data, width and height. The mipmaps should be of the correct + * format and type. + */ + mipmaps: CompressedTextureMipmap[]; + + /** + * @override + * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants} + * @see {@link THREE.CompressedPixelFormat} + */ + format: CompressedPixelFormat; + + /** + * @override No flipping for cube textures. (also flipping doesn't work for compressed textures) + * @defaultValue `false` + */ + flipY: boolean; + + /** + * @override Can't generate mipmaps for compressed textures. mips must be embedded in DDS files + * @defaultValue `false` + */ + generateMipmaps: boolean; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/textures/CubeTexture.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/textures/CubeTexture.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f5808aaf93b7c550b2d31216968b355f4d88c0ac --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/textures/CubeTexture.d.ts @@ -0,0 +1,89 @@ +import { + CubeTextureMapping, + MagnificationTextureFilter, + MinificationTextureFilter, + PixelFormat, + TextureDataType, + Wrapping, +} from "../constants.js"; +import { Texture } from "./Texture.js"; + +/** + * Creates a cube texture made up of six images. + * @remarks + * {@link CubeTexture} is almost equivalent in functionality and usage to {@link Texture}. + * The only differences are that the images are an array of _6_ images as opposed to a single image, + * and the mapping options are {@link THREE.CubeReflectionMapping} (default) or {@link THREE.CubeRefractionMapping} + * @example + * ```typescript + * const loader = new THREE.CubeTextureLoader(); + * loader.setPath('textures/cube/pisa/'); + * const textureCube = loader.load(['px.png', 'nx.png', 'py.png', 'ny.png', 'pz.png', 'nz.png']); + * const material = new THREE.MeshBasicMaterial({ + * color: 0xffffff, + * envMap: textureCube + * }); + * ``` + * @see {@link https://threejs.org/docs/index.html#api/en/textures/CubeTexture | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/textures/CubeTexture.js | Source} + */ +export class CubeTexture extends Texture { + /** + * This creates a new {@link THREE.CubeTexture | CubeTexture} object. + * @param images + * @param mapping See {@link CubeTexture.mapping | .mapping}. Default {@link THREE.CubeReflectionMapping} + * @param wrapS See {@link Texture.wrapS | .wrapS}. Default {@link THREE.ClampToEdgeWrapping} + * @param wrapT See {@link Texture.wrapT | .wrapT}. Default {@link THREE.ClampToEdgeWrapping} + * @param magFilter See {@link Texture.magFilter | .magFilter}. Default {@link THREE.LinearFilter} + * @param minFilter See {@link Texture.minFilter | .minFilter}. Default {@link THREE.LinearMipmapLinearFilter} + * @param format See {@link Texture.format | .format}. Default {@link THREE.RGBAFormat} + * @param type See {@link Texture.type | .type}. Default {@link THREE.UnsignedByteType} + * @param anisotropy See {@link Texture.anisotropy | .anisotropy}. Default {@link THREE.Texture.DEFAULT_ANISOTROPY} + * @param colorSpace See {@link Texture.colorSpace | .colorSpace}. Default {@link NoColorSpace} + */ + constructor( + images?: any[], // HTMLImageElement or HTMLCanvasElement + mapping?: CubeTextureMapping, + wrapS?: Wrapping, + wrapT?: Wrapping, + magFilter?: MagnificationTextureFilter, + minFilter?: MinificationTextureFilter, + format?: PixelFormat, + type?: TextureDataType, + anisotropy?: number, + colorSpace?: string, + ); + + /** + * Read-only flag to check if a given object is of type {@link CubeTexture}. + * @remarks This is a _constant_ value + * @defaultValue `true` + */ + readonly isCubeTexture: true; + + /** + * An image object, typically created using the {@link THREE.CubeTextureLoader.load | CubeTextureLoader.load()} method. + * @see {@link Texture.image} + */ + get image(): any; + set image(data: any); + + /** + * An image object, typically created using the {@link THREE.CubeTextureLoader.load | CubeTextureLoader.load()} method. + * @see {@link Texture.image} + */ + get images(): any; + set images(data: any); + + /** + * @inheritDoc + * @defaultValue {@link THREE.CubeReflectionMapping} + */ + mapping: CubeTextureMapping; + + /** + * @inheritDoc + * @defaultValue `false` + */ + flipY: boolean; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/textures/Data3DTexture.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/textures/Data3DTexture.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..99ef5ce0dd71261f4f90fcd86527e05a79f7383c --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/textures/Data3DTexture.d.ts @@ -0,0 +1,99 @@ +import { MagnificationTextureFilter, MinificationTextureFilter, Wrapping } from "../constants.js"; +import { TypedArray } from "../core/BufferAttribute.js"; +import { TextureImageData } from "./DataTexture.js"; +import { Texture } from "./Texture.js"; + +/** + * Creates a three-dimensional texture from raw data, with parameters to divide it into width, height, and depth + * @example + * ```typescript + * This creates a[name] with repeating data, 0 to 255 + * // create a buffer with some data + * const sizeX = 64; + * const sizeY = 64; + * const sizeZ = 64; + * const data = new Uint8Array(sizeX * sizeY * sizeZ); + * let i = 0; + * for (let z = 0; z & lt; sizeZ; z++) { + * for (let y = 0; y & lt; sizeY; y++) { + * for (let x = 0; x & lt; sizeX; x++) { + * data[i] = i % 256; + * i++; + * } + * } + * } + * // use the buffer to create the texture + * const texture = new THREE.Data3DTexture(data, sizeX, sizeY, sizeZ); + * texture.needsUpdate = true; + * ``` + * @see Example: {@link https://threejs.org/examples/#webgl2_materials_texture3d | WebGL2 / materials / texture3d} + * @see Example: {@link https://threejs.org/examples/#webgl2_materials_texture3d_partialupdate | WebGL2 / materials / texture3d / partialupdate} + * @see Example: {@link https://threejs.org/examples/#webgl2_volume_cloud | WebGL2 / volume / cloud} + * @see Example: {@link https://threejs.org/examples/#webgl2_volume_perlin | WebGL2 / volume / perlin} + * @see {@link https://threejs.org/docs/index.html#api/en/textures/Data3DTexture | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/textures/Data3DTexture.js | Source} + */ +export class Data3DTexture extends Texture { + /** + * Create a new instance of {@link Data3DTexture} + * @param data {@link https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView | ArrayBufferView} of the texture. Default `null`. + * @param width Width of the texture. Default `1`. + * @param height Height of the texture. Default `1`. + * @param depth Depth of the texture. Default `1`. + */ + constructor(data?: TypedArray | null, width?: number, height?: number, depth?: number); + + /** + * Read-only flag to check if a given object is of type {@link Data3DTexture}. + * @remarks This is a _constant_ value + * @defaultValue `true` + */ + readonly isData3DTexture: true; + + /** + * Overridden with a record type holding data, width and height and depth. + * @override + */ + get image(): Texture3DImageData; + set image(data: Texture3DImageData); + + /** + * @override + * @defaultValue {@link THREE.NearestFilter} + */ + magFilter: MagnificationTextureFilter; + + /** + * @override + * @defaultValue {@link THREE.NearestFilter} + */ + minFilter: MinificationTextureFilter; + + /** + * @override + * @defaultValue {@link THREE.ClampToEdgeWrapping} + */ + wrapR: Wrapping; + + /** + * @override + * @defaultValue `false` + */ + flipY: boolean; + + /** + * @override + * @defaultValue `false` + */ + generateMipmaps: boolean; + + /** + * @override + * @defaultValue `1` + */ + unpackAlignment: number; +} + +export interface Texture3DImageData extends TextureImageData { + depth: number; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/textures/DataArrayTexture.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/textures/DataArrayTexture.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..eacca2abb19012bfe73e3d4d749a35c8c2a6531e --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/textures/DataArrayTexture.d.ts @@ -0,0 +1,123 @@ +import { MagnificationTextureFilter, MinificationTextureFilter } from "../constants.js"; +import { Texture3DImageData } from "./Data3DTexture.js"; +import { Texture } from "./Texture.js"; + +/** + * Creates an array of textures directly from raw data, width and height and depth + * @example + * ```typescript + * This creates a[name] where each texture has a different color. + * // create a buffer with color data + * const width = 512; + * const height = 512; + * const depth = 100; + * const size = width * height; + * const data = new Uint8Array(4 * size * depth); + * for (let i = 0; i & lt; depth; i++) { + * const color = new THREE.Color(Math.random(), Math.random(), Math.random()); + * const r = Math.floor(color.r * 255); + * const g = Math.floor(color.g * 255); + * const b = Math.floor(color.b * 255); + * for (let j = 0; j & lt; size; j++) { + * const stride = (i * size + j) * 4; + * data[stride] = r; + * data[stride + 1] = g; + * data[stride + 2] = b; + * data[stride + 3] = 255; + * } + * } + * // used the buffer to create a [name] + * const texture = new THREE.DataArrayTexture(data, width, height, depth); + * texture.needsUpdate = true; + * ``` + * @see Example: {@link https://threejs.org/examples/#webgl2_materials_texture2darray | WebGL2 / materials / texture2darray} + * @see Example: {@link https://threejs.org/examples/#webgl2_rendertarget_texture2darray | WebGL2 / rendertarget / texture2darray} + * @see {@link https://threejs.org/docs/index.html#api/en/textures/DataArrayTexture | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/textures/DataArrayTexture.js | Source} + */ +export class DataArrayTexture extends Texture { + /** + * Read-only flag to check if a given object is of type {@link DataArrayTexture}. + * @remarks This is a _constant_ value + * @defaultValue `true` + */ + readonly isDataArrayTexture: true; + + /** + * Overridden with a record type holding data, width and height and depth. + * @override + */ + get image(): Texture3DImageData; + set image(data: Texture3DImageData); + + /** + * @override + * @defaultValue {@link THREE.NearestFilter} + */ + magFilter: MagnificationTextureFilter; + + /** + * @override + * @defaultValue {@link THREE.NearestFilter} + */ + minFilter: MinificationTextureFilter; + + /** + * @override + * @defaultValue {@link THREE.ClampToEdgeWrapping} + */ + wrapR: boolean; + + /** + * @override + * @defaultValue `false` + */ + generateMipmaps: boolean; + + /** + * @override + * @defaultValue `false` + */ + flipY: boolean; + + /** + * @override + * @defaultValue `1` + */ + unpackAlignment: number; + + /** + * A set of all layers which need to be updated in the texture. See {@link DataArrayTexture.addLayerUpdate}. + */ + layerUpdates: Set; + + /** + * This creates a new {@link THREE.DataArrayTexture | DataArrayTexture} object. + * @remarks The interpretation of the data depends on {@link format} and {@link type}. + * @remarks If the {@link type} is {@link THREE.UnsignedByteType}, a {@link Uint8Array} will be useful for addressing the texel data + * @remarks If the {@link format} is {@link THREE.RGBAFormat}, data needs four values for one texel; Red, Green, Blue and Alpha (typically the opacity). + * @remarks For the packed {@link type | types}, {@link THREE.UnsignedShort4444Type} and {@link THREE.UnsignedShort5551Type} + * all color components of one texel can be addressed as bitfields within an integer element of a {@link Uint16Array}. + * @remarks In order to use the {@link type | types} {@link THREE.FloatType} and {@link THREE.HalfFloatType}, + * the WebGL implementation must support the respective extensions _OES_texture_float_ and _OES_texture_half_float_ + * @remarks In order to use {@link THREE.LinearFilter} for component-wise, bilinear interpolation of the texels based on these types, + * the WebGL extensions _OES_texture_float_linear_ or _OES_texture_half_float_linear_ must also be present. + * @param data {@link https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView | ArrayBufferView} of the texture. Default `null`. + * @param width Width of the texture. Default `1`. + * @param height Height of the texture. Default `1`. + * @param depth Depth of the texture. Default `1`. + */ + constructor(data?: BufferSource | null, width?: number, height?: number, depth?: number); + + /** + * Describes that a specific layer of the texture needs to be updated. Normally when {@link Texture.needsUpdate} is + * set to true, the entire compressed texture array is sent to the GPU. Marking specific layers will only transmit + * subsets of all mipmaps associated with a specific depth in the array which is often much more performant. + */ + addLayerUpdate(layerIndex: number): void; + + /** + * Resets the layer updates registry. See {@link DataArrayTexture.addLayerUpdate}. + */ + clearLayoutUpdates(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/textures/DataTexture.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/textures/DataTexture.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..51d2b1b982b9c20ca852ac641c02eea99a6adfbf --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/textures/DataTexture.d.ts @@ -0,0 +1,118 @@ +import { + MagnificationTextureFilter, + Mapping, + MinificationTextureFilter, + PixelFormat, + TextureDataType, + Wrapping, +} from "../constants.js"; +import { TypedArray } from "../core/BufferAttribute.js"; +import { Texture } from "./Texture.js"; + +/** + * Creates a texture directly from raw data, width and height. + * @example + * ```typescript + * // create a buffer with color data + * const width = 512; + * const height = 512; + * const size = width * height; + * const data = new Uint8Array(4 * size); + * const color = new THREE.Color(0xffffff); + * const r = Math.floor(color.r * 255); + * const g = Math.floor(color.g * 255); + * const b = Math.floor(color.b * 255); + * for (let i = 0; i & lt; size; i++) { + * const stride = i * 4; + * data[stride] = r; + * data[stride + 1] = g; + * data[stride + 2] = b; + * data[stride + 3] = 255; + * } + * // used the buffer to create a [name] + * const texture = new THREE.DataTexture(data, width, height); + * texture.needsUpdate = true; + * ``` + * @see {@link https://threejs.org/docs/index.html#api/en/textures/DataTexture | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/textures/DataTexture.js | Source} + */ +export class DataTexture extends Texture { + /** + * @param data {@link https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView | ArrayBufferView} of the texture. Default `null`. + * @param width Width of the texture. Default `1`. + * @param height Height of the texture. Default `1`. + * @param format See {@link Texture.format | .format}. Default {@link THREE.RGBAFormat} + * @param type See {@link Texture.type | .type}. Default {@link THREE.UnsignedByteType} + * @param mapping See {@link Texture.mapping | .mapping}. Default {@link THREE.Texture.DEFAULT_MAPPING} + * @param wrapS See {@link Texture.wrapS | .wrapS}. Default {@link THREE.ClampToEdgeWrapping} + * @param wrapT See {@link Texture.wrapT | .wrapT}. Default {@link THREE.ClampToEdgeWrapping} + * @param magFilter See {@link Texture.magFilter | .magFilter}. Default {@link THREE.NearestFilter} + * @param minFilter See {@link Texture.minFilter | .minFilter}. Default {@link THREE.NearestFilter} + * @param anisotropy See {@link Texture.anisotropy | .anisotropy}. Default {@link THREE.Texture.DEFAULT_ANISOTROPY} + * @param colorSpace See {@link Texture.colorSpace | .colorSpace}. Default {@link NoColorSpace} + */ + constructor( + data?: TypedArray | null, + width?: number, + height?: number, + format?: PixelFormat, + type?: TextureDataType, + mapping?: Mapping, + wrapS?: Wrapping, + wrapT?: Wrapping, + magFilter?: MagnificationTextureFilter, + minFilter?: MinificationTextureFilter, + anisotropy?: number, + colorSpace?: string, + ); + + /** + * Read-only flag to check if a given object is of type {@link DataTexture}. + * @remarks This is a _constant_ value + * @defaultValue `true` + */ + readonly isDataTexture: true; + + /** + * Overridden with a record type holding data, width and height and depth. + * @override + */ + get image(): TextureImageData; + set image(value: TextureImageData); + + /** + * @override + * @defaultValue {@link THREE.NearestFilter} + */ + magFilter: MagnificationTextureFilter; + + /** + * @override + * @defaultValue {@link THREE.NearestFilter} + */ + minFilter: MinificationTextureFilter; + + /** + * @override + * @defaultValue `false` + */ + flipY: boolean; + + /** + * @override + * @defaultValue `false` + */ + generateMipmaps: boolean; + + /** + * @override + * @defaultValue `1` + */ + unpackAlignment: number; +} + +export interface TextureImageData { + data: TypedArray; + height: number; + width: number; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/textures/DepthTexture.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/textures/DepthTexture.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9dca127ac7beb0e340b2ccaf6f9ad81ca03a6467 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/textures/DepthTexture.d.ts @@ -0,0 +1,106 @@ +import { + DepthTexturePixelFormat, + MagnificationTextureFilter, + Mapping, + MinificationTextureFilter, + TextureComparisonFunction, + TextureDataType, + Wrapping, +} from "../constants.js"; +import { Texture } from "./Texture.js"; + +/** + * This class can be used to automatically save the depth information of a rendering into a texture + * @see Example: {@link https://threejs.org/examples/#webgl_depth_texture | depth / texture} + * @see {@link https://threejs.org/docs/index.html#api/en/textures/DepthTexture | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/textures/DepthTexture.js | Source} + */ +export class DepthTexture extends Texture { + /** + * Create a new instance of {@link DepthTexture} + * @param width Width of the texture. + * @param height Height of the texture. + * @param type See {@link Texture.type | .type}. Default {@link THREE.UnsignedByteType} or {@link THREE.UnsignedInt248Type} + * @param mapping See {@link Texture.mapping | .mapping}. Default {@link THREE.Texture.DEFAULT_MAPPING} + * @param wrapS See {@link Texture.wrapS | .wrapS}. Default {@link THREE.ClampToEdgeWrapping} + * @param wrapT See {@link Texture.wrapT | .wrapT}. Default {@link THREE.ClampToEdgeWrapping} + * @param magFilter See {@link Texture.magFilter | .magFilter}. Default {@link THREE.NearestFilter} + * @param minFilter See {@link Texture.minFilter | .minFilter}. Default {@link THREE.NearestFilter} + * @param anisotropy See {@link Texture.anisotropy | .anisotropy}. Default {@link THREE.Texture.DEFAULT_ANISOTROPY} + * @param format See {@link DepthTexture.format | .format}. Default {@link THREE.DepthFormat} + * @param {number} [depth=1] - The depth of the texture. + */ + constructor( + width: number, + height: number, + type?: TextureDataType, + mapping?: Mapping, + wrapS?: Wrapping, + wrapT?: Wrapping, + magFilter?: MagnificationTextureFilter, + minFilter?: MinificationTextureFilter, + anisotropy?: number, + format?: DepthTexturePixelFormat, + depth?: number, + ); + + /** + * Read-only flag to check if a given object is of type {@link DepthTexture}. + * @remarks This is a _constant_ value + * @defaultValue `true` + */ + readonly isDepthTexture: true; + + /** + * Overridden with a record type holding width and height. + * @override + */ + get image(): { width: number; height: number; depth: number }; + set image(value: { width: number; height: number; depth: number }); + + /** + * @override + * @defaultValue `false` + */ + flipY: boolean; + + /** + * @override + * @defaultValue {@link THREE.NearestFilter} + */ + magFilter: MagnificationTextureFilter; + + /** + * @override + * @defaultValue {@link THREE.NearestFilter} + */ + minFilter: MinificationTextureFilter; + + /** + * @override Depth textures do not use mipmaps. + * @defaultValue `false` + */ + generateMipmaps: boolean; + + /** + * @override + * @see {@link Texture.format | Texture.format} + * @defaultValue {@link THREE.DepthFormat}. + */ + format: DepthTexturePixelFormat; + + /** + * @override + * @defaultValue {@link THREE.UnsignedByteType} when {@link format | .format} === {@link THREE.DepthFormat} + * @defaultValue {@link THREE.UnsignedInt248Type} when {@link format | .format} === {@link THREE.DepthStencilFormat} + */ + type: TextureDataType; + + /** + * This is used to define the comparison function used when comparing texels in the depth texture to the value in + * the depth buffer. Default is `null` which means comparison is disabled. + * + * See {@link THREE.TextureComparisonFunction} for functions. + */ + compareFunction: TextureComparisonFunction | null; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/textures/ExternalTexture.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/textures/ExternalTexture.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8f62cacbb1cab570373a0f4d098f967a675bd4b2 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/textures/ExternalTexture.d.ts @@ -0,0 +1,11 @@ +import { Texture } from "./Texture.js"; + +declare class ExternalTexture extends Texture { + sourceTexture: WebGLTexture | GPUTexture | null; + + readonly isExternalTexture: true; + + constructor(sourceTexture?: WebGLTexture | GPUTexture | null); +} + +export { ExternalTexture }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/textures/FramebufferTexture.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/textures/FramebufferTexture.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ad54c51757d5cce1135d1532249c66c5786b1c65 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/textures/FramebufferTexture.d.ts @@ -0,0 +1,62 @@ +import { MagnificationTextureFilter, MinificationTextureFilter } from "../constants.js"; +import { Texture } from "./Texture.js"; + +/** + * This class can only be used in combination with {@link THREE.WebGLRenderer.copyFramebufferToTexture | WebGLRenderer.copyFramebufferToTexture()}. + * @example + * ```typescript + * const pixelRatio = window.devicePixelRatio; + * const textureSize = 128 * pixelRatio; + * + * // instantiate a framebuffer texture + * const frameTexture = new FramebufferTexture( textureSize, textureSize, RGBAFormat ); + * + * // calculate start position for copying part of the frame data + * const vector = new Vector2(); + * vector.x = ( window.innerWidth * pixelRatio / 2 ) - ( textureSize / 2 ); + * vector.y = ( window.innerHeight * pixelRatio / 2 ) - ( textureSize / 2 ); + * + * // render the scene + * renderer.clear(); + * renderer.render( scene, camera ); + * + * // copy part of the rendered frame into the framebuffer texture + * renderer.copyFramebufferToTexture( frameTexture, vector ); + * ``` + * @see Example: {@link https://threejs.org/examples/#webgl_framebuffer_texture | webgl_framebuffer_texture} + * @see {@link https://threejs.org/docs/index.html#api/en/textures/FramebufferTexture | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/textures/FramebufferTexture.js | Source} + */ +export class FramebufferTexture extends Texture { + /** + * Create a new instance of {@link FramebufferTexture} + * @param width The width of the texture. + * @param height The height of the texture. + */ + constructor(width: number, height: number); + + /** + * Read-only flag to check if a given object is of type {@link FramebufferTexture}. + * @remarks This is a _constant_ value + * @defaultValue `true` + */ + readonly isFramebufferTexture: true; + + /** + * @override + * @defaultValue {@link THREE.NearestFilter} + */ + magFilter: MagnificationTextureFilter; + + /** + * @override + * @defaultValue {@link THREE.NearestFilter} + */ + minFilter: MinificationTextureFilter; + + /** + * @override + * @defaultValue `false` + */ + generateMipmaps: boolean; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/textures/Source.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/textures/Source.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6894f09bf525430211539762c30a729a5e0dc8a4 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/textures/Source.d.ts @@ -0,0 +1,79 @@ +import { Vector3 } from "../math/Vector3.js"; + +export type SerializedImage = + | string + | { + data: number[]; + width: number; + height: number; + type: string; + }; + +export class SourceJSON { + uuid: string; + url: SerializedImage | SerializedImage[]; +} + +/** + * Represents the data {@link Source} of a texture. + * @see {@link https://threejs.org/docs/index.html#api/en/textures/Source | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/textures/Source.js | Source} + */ +export class Source { + /** + * Flag to check if a given object is of type {@link Source}. + * @remarks This is a _constant_ value + * @defaultValue `true` + */ + readonly isSource: true; + + readonly id: number; + + /** + * {@link http://en.wikipedia.org/wiki/Universally_unique_identifier | UUID} of this object instance. + * @remarks This gets automatically assigned and shouldn't be edited. + */ + uuid: string; + + /** + * The actual data of a texture. + * @remarks The type of this property depends on the texture that uses this instance. + */ + data: any; + + /** + * This property is only relevant when {@link .needsUpdate} is set to `true` and provides more control on how + * texture data should be processed. + * When `dataReady` is set to `false`, the engine performs the memory allocation (if necessary) but does not + * transfer the data into the GPU memory. + * @default true + */ + dataReady: boolean; + + /** + * This starts at `0` and counts how many times {@link needsUpdate | .needsUpdate} is set to `true`. + * @remarks Expects a `Integer` + * @defaultValue `0` + */ + version: number; + + /** + * Create a new instance of {@link Source} + * @param data The data definition of a texture. Default `null` + */ + constructor(data: any); + + getSize(target: Vector3): Vector3; + + /** + * When the property is set to `true`, the engine allocates the memory for the texture (if necessary) and triggers + * the actual texture upload to the GPU next time the source is used. + */ + set needsUpdate(value: boolean); + + /** + * Convert the data {@link Source} to three.js {@link https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 | JSON Object/Scene format}. + * @param meta Optional object containing metadata. + */ + toJSON(meta?: string | {}): SourceJSON; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/textures/Texture.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/textures/Texture.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a9e9ba2dea06db23cee42f5954b0cb9389853a49 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/textures/Texture.d.ts @@ -0,0 +1,550 @@ +import { + AnyMapping, + AnyPixelFormat, + ColorSpace, + MagnificationTextureFilter, + Mapping, + MinificationTextureFilter, + PixelFormat, + PixelFormatGPU, + TextureDataType, + Wrapping, +} from "../constants.js"; +import { EventDispatcher } from "../core/EventDispatcher.js"; +import { RenderTarget } from "../core/RenderTarget.js"; +import { Matrix3 } from "../math/Matrix3.js"; +import { Vector2 } from "../math/Vector2.js"; +import { CompressedTextureMipmap } from "./CompressedTexture.js"; +import { CubeTexture } from "./CubeTexture.js"; +import { Source } from "./Source.js"; + +// NOTE: DOM upload fields are not implemented where parameters are accepted. +export interface TextureParameters { + mapping?: AnyMapping | undefined; + // image?: TexImageSource | OffscreenCanvas | undefined; + // channel?: number | undefined; + + wrapS?: Wrapping | undefined; + wrapT?: Wrapping | undefined; + wrapR?: Wrapping | undefined; + + format?: PixelFormat | undefined; + internalFormat?: PixelFormatGPU | null | undefined; + type?: TextureDataType | undefined; + colorSpace?: ColorSpace | undefined; + + magFilter?: MagnificationTextureFilter | undefined; + minFilter?: MinificationTextureFilter | undefined; + anisotropy?: number | undefined; + + flipY?: boolean | undefined; + + generateMipmaps?: boolean | undefined; + // premultiplyAlpha?: boolean | undefined; + // unpackAlignment?: number | undefined; +} + +export interface TextureJSON { + metadata: { version: number; type: string; generator: string }; + + uuid: string; + name: string; + + image: string; + + mapping: AnyMapping; + channel: number; + + repeat: [x: number, y: number]; + offset: [x: number, y: number]; + center: [x: number, y: number]; + rotation: number; + + wrap: [wrapS: number, wrapT: number]; + + format: AnyPixelFormat; + internalFormat: PixelFormatGPU | null; + type: TextureDataType; + colorSpace: string; + + minFilter: MinificationTextureFilter; + magFilter: MagnificationTextureFilter; + anisotropy: number; + + flipY: boolean; + + generateMipmaps: boolean; + premultiplyAlpha: boolean; + unpackAlignment: number; + + userData?: Record; +} + +/** Shim for OffscreenCanvas. */ +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface OffscreenCanvas extends EventTarget {} + +/** + * Create a {@link Texture} to apply to a surface or as a reflection or refraction map. + * @remarks + * After the initial use of a texture, its **dimensions**, {@link format}, and {@link type} cannot be changed + * Instead, call {@link dispose | .dispose()} on the {@link Texture} and instantiate a new {@link Texture}. + * @example + * ```typescript + * // load a texture, set wrap mode to repeat + * const texture = new THREE.TextureLoader().load("textures/water.jpg"); + * texture.wrapS = THREE.RepeatWrapping; + * texture.wrapT = THREE.RepeatWrapping; + * texture.repeat.set(4, 4); + * ``` + * @see Example: {@link https://threejs.org/examples/#webgl_materials_texture_filters | webgl materials texture filters} + * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants} + * @see {@link https://threejs.org/docs/index.html#api/en/textures/Texture | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/Textures/Texture.js | Source} + */ +export class Texture extends EventDispatcher<{ dispose: {} }> { + /** + * This creates a new {@link THREE.Texture | Texture} object. + * @param image See {@link Texture.image | .image}. Default {@link THREE.Texture.DEFAULT_IMAGE} + * @param mapping See {@link Texture.mapping | .mapping}. Default {@link THREE.Texture.DEFAULT_MAPPING} + * @param wrapS See {@link Texture.wrapS | .wrapS}. Default {@link THREE.ClampToEdgeWrapping} + * @param wrapT See {@link Texture.wrapT | .wrapT}. Default {@link THREE.ClampToEdgeWrapping} + * @param magFilter See {@link Texture.magFilter | .magFilter}. Default {@link THREE.LinearFilter} + * @param minFilter See {@link Texture.minFilter | .minFilter}. Default {@link THREE.LinearMipmapLinearFilter} + * @param format See {@link Texture.format | .format}. Default {@link THREE.RGBAFormat} + * @param type See {@link Texture.type | .type}. Default {@link THREE.UnsignedByteType} + * @param anisotropy See {@link Texture.anisotropy | .anisotropy}. Default {@link THREE.Texture.DEFAULT_ANISOTROPY} + * @param colorSpace See {@link Texture.colorSpace | .colorSpace}. Default {@link THREE.NoColorSpace} + */ + constructor( + image?: TexImageSource | OffscreenCanvas, + mapping?: Mapping, + wrapS?: Wrapping, + wrapT?: Wrapping, + magFilter?: MagnificationTextureFilter, + minFilter?: MinificationTextureFilter, + format?: PixelFormat, + type?: TextureDataType, + anisotropy?: number, + colorSpace?: ColorSpace, + ); + + /** + * @deprecated + */ + constructor( + image: TexImageSource | OffscreenCanvas, + mapping: Mapping, + wrapS: Wrapping, + wrapT: Wrapping, + magFilter: MagnificationTextureFilter, + minFilter: MinificationTextureFilter, + format: PixelFormat, + type: TextureDataType, + anisotropy: number, + ); + + /** + * Read-only flag to check if a given object is of type {@link Texture}. + * @remarks This is a _constant_ value + * @defaultValue `true` + */ + readonly isTexture: true; + + /** + * Unique number for this {@link Texture} instance. + * @remarks Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object. + * @remarks Expects a `Integer` + */ + readonly id: number; + + /** + * {@link http://en.wikipedia.org/wiki/Universally_unique_identifier | UUID} of this object instance. + * @remarks This gets automatically assigned and shouldn't be edited. + */ + uuid: string; + + /** + * Optional name of the object + * @remarks _(doesn't need to be unique)_. + * @defaultValue `""` + */ + name: string; + + /** + * The data definition of a texture. A reference to the data source can be shared across textures. + * This is often useful in context of spritesheets where multiple textures render the same data + * but with different {@link Texture} transformations. + */ + source: Source; + + /** + * The width of the texture in pixels. + */ + get width(): number; + + /** + * The height of the texture in pixels. + */ + get height(): number; + + /** + * The depth of the texture in pixels. + */ + get depth(): number; + + /** + * An image object, typically created using the {@link THREE.TextureLoader.load | TextureLoader.load()} method. + * @remarks This can be any image (e.g., PNG, JPG, GIF, DDS) or video (e.g., MP4, OGG/OGV) type supported by three.js. + * @remarks To use video as a {@link Texture} you need to have a playing HTML5 video element as a source + * for your {@link Texture} image and continuously update this {@link Texture} + * as long as video is playing - the {@link THREE.VideoTexture | VideoTexture} class handles this automatically. + */ + get image(): any; + set image(data: any); + + /** + * Array of user-specified mipmaps + * @defaultValue `[]` + */ + mipmaps: CompressedTextureMipmap[] | CubeTexture[] | HTMLCanvasElement[]; + + /** + * How the image is applied to the object. + * @remarks All {@link Texture} types except {@link THREE.CubeTexture} expect the _values_ be {@link THREE.Mapping} + * @remarks {@link CubeTexture} expect the _values_ be {@link THREE.CubeTextureMapping} + * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants} + * @defaultValue _value of_ {@link THREE.Texture.DEFAULT_MAPPING} + */ + mapping: AnyMapping; + + /** + * Lets you select the uv attribute to map the texture to. `0` for `uv`, `1` for `uv1`, `2` for `uv2` and `3` for + * `uv3`. + */ + channel: number; + + /** + * This defines how the {@link Texture} is wrapped *horizontally* and corresponds to **U** in UV mapping. + * @remarks for **WEBGL1** - tiling of images in textures only functions if image dimensions are powers of two + * (2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...) in terms of pixels. + * Individual dimensions need not be equal, but each must be a power of two. This is a limitation of WebGL1, not three.js. + * **WEBGL2** does not have this limitation. + * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants} + * @see {@link wrapT} + * @see {@link repeat} + * @defaultValue {@link THREE.ClampToEdgeWrapping} + */ + wrapS: Wrapping; + + /** + * This defines how the {@link Texture} is wrapped *vertically* and corresponds to **V** in UV mapping. + * @remarks for **WEBGL1** - tiling of images in textures only functions if image dimensions are powers of two + * (2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...) in terms of pixels. + * Individual dimensions need not be equal, but each must be a power of two. This is a limitation of WebGL1, not three.js. + * **WEBGL2** does not have this limitation. + * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants} + * @see {@link wrapS} + * @see {@link repeat} + * @defaultValue {@link THREE.ClampToEdgeWrapping} + */ + wrapT: Wrapping; + + /** + * How the {@link Texture} is sampled when a texel covers more than one pixel. + * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants} + * @see {@link minFilter} + * @see {@link THREE.MagnificationTextureFilter} + * @defaultValue {@link THREE.LinearFilter} + */ + magFilter: MagnificationTextureFilter; + + /** + * How the {@link Texture} is sampled when a texel covers less than one pixel. + * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants} + * @see {@link magFilter} + * @see {@link THREE.MinificationTextureFilter} + * @defaultValue {@link THREE.LinearMipmapLinearFilter} + */ + minFilter: MinificationTextureFilter; + + /** + * The number of samples taken along the axis through the pixel that has the highest density of texels. + * @remarks A higher value gives a less blurry result than a basic mipmap, at the cost of more {@link Texture} samples being used. + * @remarks Use {@link THREE.WebGLCapabilities.getMaxAnisotropy() | renderer.capabilities.getMaxAnisotropy()} to find the maximum valid anisotropy value for the GPU; + * @remarks This value is usually a power of 2. + * @default _value of_ {@link THREE.Texture.DEFAULT_ANISOTROPY}. That is normally `1`. + */ + anisotropy: number; + + /** + * These define how elements of a 2D texture, or texels, are read by shaders. + * @remarks All {@link Texture} types except {@link THREE.DepthTexture} and {@link THREE.CompressedPixelFormat} expect the _values_ be {@link THREE.PixelFormat} + * @remarks {@link DepthTexture} expect the _values_ be {@link THREE.CubeTextureMapping} + * @remarks {@link CompressedPixelFormat} expect the _values_ be {@link THREE.CubeTextureMapping} + * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants} + * @see {@link THREE.PixelFormat} + * @defaultValue {@link THREE.RGBAFormat}. + */ + format: AnyPixelFormat; + + /** + * This must correspond to the {@link Texture.format | .format}. + * @remarks {@link THREE.UnsignedByteType}, is the type most used by Texture formats. + * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants} + * @see {@link THREE.TextureDataType} + * @defaultValue {@link THREE.UnsignedByteType} + */ + type: TextureDataType; + + /** + * The GPU Pixel Format allows the developer to specify how the data is going to be stored on the GPU. + * @remarks Compatible only with {@link WebGL2RenderingContext | WebGL 2 Rendering Context}. + * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants} + * @defaultValue The default value is obtained using a combination of {@link Texture.format | .format} and {@link Texture.type | .type}. + */ + internalFormat: PixelFormatGPU | null; + + /** + * The uv-transform matrix for the texture. + * @remarks + * When {@link Texture.matrixAutoUpdate | .matrixAutoUpdate} property is `true`. + * Will be updated by the renderer from the properties: + * - {@link Texture.offset | .offset} + * - {@link Texture.repeat | .repeat} + * - {@link Texture.rotation | .rotation} + * - {@link Texture.center | .center} + * @remarks + * When {@link Texture.matrixAutoUpdate | .matrixAutoUpdate} property is `false`. + * This matrix may be set manually. + * @see {@link matrixAutoUpdate | .matrixAutoUpdate} + * @defaultValue `new THREE.Matrix3()` + */ + matrix: Matrix3; + + /** + * Whether is to update the texture's uv-transform {@link matrix | .matrix}. + * @remarks Set this to `false` if you are specifying the uv-transform {@link matrix} directly. + * @see {@link matrix | .matrix} + * @defaultValue `true` + */ + matrixAutoUpdate: boolean; + + /** + * How much a single repetition of the texture is offset from the beginning, in each direction **U** and **V**. + * @remarks Typical range is `0.0` to `1.0`. + * @defaultValue `new THREE.Vector2(0, 0)` + */ + offset: Vector2; + + /** + * How many times the texture is repeated across the surface, in each direction **U** and **V**. + * @remarks + * If repeat is set greater than `1` in either direction, the corresponding *Wrap* parameter should + * also be set to {@link THREE.RepeatWrapping} or {@link THREE.MirroredRepeatWrapping} to achieve the desired tiling effect. + * @see {@link wrapS} + * @see {@link wrapT} + * @defaultValue `new THREE.Vector2( 1, 1 )` + */ + repeat: Vector2; + + /** + * The point around which rotation occurs. + * @remarks A value of `(0.5, 0.5)` corresponds to the center of the texture. + * @defaultValue `new THREE.Vector2( 0, 0 )`, _lower left._ + */ + center: Vector2; + + /** + * How much the texture is rotated around the center point, in radians. + * @remarks Positive values are counter-clockwise. + * @defaultValue `0` + */ + rotation: number; + + /** + * Whether to generate mipmaps, _(if possible)_ for a texture. + * @remarks Set this to false if you are creating mipmaps manually. + * @defaultValue true + */ + generateMipmaps: boolean; + + /** + * If set to `true`, the alpha channel, if present, is multiplied into the color channels when the texture is uploaded to the GPU. + * @remarks + * Note that this property has no effect for {@link https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap | ImageBitmap}. + * You need to configure on bitmap creation instead. See {@link THREE.ImageBitmapLoader | ImageBitmapLoader}. + * @see {@link THREE.ImageBitmapLoader | ImageBitmapLoader}. + * @defaultValue `false` + */ + premultiplyAlpha: boolean; + + /** + * If set to `true`, the texture is flipped along the vertical axis when uploaded to the GPU. + * @remarks + * Note that this property has no effect for {@link https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap | ImageBitmap}. + * You need to configure on bitmap creation instead. See {@link THREE.ImageBitmapLoader | ImageBitmapLoader}. + * @see {@link THREE.ImageBitmapLoader | ImageBitmapLoader}. + * @defaultValue `true` + */ + flipY: boolean; + + /** + * Specifies the alignment requirements for the start of each pixel row in memory. + * @remarks + * The allowable values are: + * - `1` (byte-alignment) + * - `2` (rows aligned to even-numbered bytes) + * - `4` (word-alignment) + * - `8` (rows start on double-word boundaries). + * @see {@link http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml | glPixelStorei} for more information. + * @defaultValue `4` + */ + unpackAlignment: number; // TODO Fix typing to only allow the expected values. + + /** + * The {@link Textures | {@link Texture} constants} page for details of other color spaces. + * @remarks + * Textures containing color data should be annotated with {@link SRGBColorSpace THREE.SRGBColorSpace} or + * {@link LinearSRGBColorSpace THREE.LinearSRGBColorSpace}. + * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants} + * @see {@link THREE.TextureDataType} + * @defaultValue {@link THREE.NoColorSpace} + */ + colorSpace: string; + + /** + * Indicates whether a texture belongs to a render target or not + * @defaultValue `false` + */ + isRenderTargetTexture: boolean; + + /** + * Indicates if a texture should be handled like a texture array. + * + * @default false + */ + isArrayTexture: boolean; + + /** + * An object that can be used to store custom data about the texture. + * @remarks It should not hold references to functions as these will not be cloned. + * @defaultValue `{}` + */ + userData: Record; + + /** + * This can be used to only update a subregion or specific rows of the texture (for example, just the + * first 3 rows). Use the `addUpdateRange()` function to add ranges to this array. + */ + updateRanges: Array<{ start: number; count: number }>; + + /** + * This starts at `0` and counts how many times {@link needsUpdate | .needsUpdate} is set to `true`. + * @remarks Expects a `Integer` + * @defaultValue `0` + */ + version: number; + + /** + * Indicates whether this texture should be processed by PMREMGenerator or not (only relevant for render target + * textures) + */ + pmremVersion: number; + + /** + * Set this to `true` to trigger an update next time the texture is used. Particularly important for setting the wrap mode. + */ + set needsUpdate(value: boolean); + + /** + * Indicates whether this texture should be processed by {@link THREE.PMREMGenerator} or not. + * @remarks Only relevant for render target textures. + * @defaultValue `false` + */ + set needsPMREMUpdate(value: boolean); + + /** + * The Global default value for {@link anisotropy | .anisotropy}. + * @defaultValue `1`. + */ + static DEFAULT_ANISOTROPY: number; + + /** + * The Global default value for {@link Texture.image | .image}. + * @defaultValue `null`. + */ + static DEFAULT_IMAGE: any; + + /** + * The Global default value for {@link mapping | .mapping}. + * @defaultValue {@link THREE.UVMapping} + */ + static DEFAULT_MAPPING: Mapping; + + renderTarget: RenderTarget | null; + + /** + * A callback function, called when the texture is updated _(e.g., when needsUpdate has been set to true and then the texture is used)_. + */ + onUpdate: ((texture: Texture) => void) | null; + + /** + * Transform the **UV** based on the value of this texture's + * {@link offset | .offset}, + * {@link repeat | .repeat}, + * {@link wrapS | .wrapS}, + * {@link wrapT | .wrapT} and + * {@link flipY | .flipY} properties. + * @param uv + */ + transformUv(uv: Vector2): Vector2; + + /** + * Update the texture's **UV-transform** {@link matrix | .matrix} from the texture properties + * {@link offset | .offset}, + * {@link repeat | .repeat}, + * {@link rotation | .rotation} and + * {@link center | .center}. + */ + updateMatrix(): void; + + /** + * Adds a range of data in the data texture to be updated on the GPU. + * + * @param {number} start - Position at which to start update. + * @param {number} count - The number of components to update. + */ + addUpdateRange(start: number, count: number): void; + + /** + * Clears the update ranges. + */ + clearUpdateRanges(): void; + + /** + * Make copy of the texture. Note this is not a "deep copy", the image is shared. Cloning the texture automatically + * marks it for texture upload. + */ + clone(): this; + + copy(source: Texture): this; + + /** + * Sets this texture's properties based on `values`. + * @param values - A container with texture parameters. + */ + setValues(values: TextureParameters): void; + + /** + * Convert the texture to three.js {@link https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 | JSON Object/Scene format}. + * @param meta Optional object containing metadata. + */ + toJSON(meta?: string | {}): TextureJSON; + + /** + * Frees the GPU-related resources allocated by this instance + * @remarks Call this method whenever this instance is no longer used in your app. + */ + dispose(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/textures/VideoFrameTexture.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/textures/VideoFrameTexture.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8f89271d7b3cd2c32f8d508ef5aeeebadd798953 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/textures/VideoFrameTexture.d.ts @@ -0,0 +1,27 @@ +import { + MagnificationTextureFilter, + Mapping, + MinificationTextureFilter, + PixelFormat, + TextureDataType, + Wrapping, +} from "../constants.js"; +import { VideoTexture } from "./VideoTexture.js"; + +declare class VideoFrameTexture extends VideoTexture { + constructor( + mapping?: Mapping, + wrapS?: Wrapping, + wrapT?: Wrapping, + magFilter?: MagnificationTextureFilter, + minFilter?: MinificationTextureFilter, + format?: PixelFormat, + type?: TextureDataType, + anisotropy?: number, + ); + + // FIXME Replace with VideoFrame when we no longer need to support TypeScript 5.0 + setFrame(frame: unknown): void; +} + +export { VideoFrameTexture }; diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/textures/VideoTexture.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/textures/VideoTexture.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..31dc5d4566924a1e90df245de16969982de352b4 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/textures/VideoTexture.d.ts @@ -0,0 +1,90 @@ +import { + MagnificationTextureFilter, + Mapping, + MinificationTextureFilter, + PixelFormat, + TextureDataType, + Wrapping, +} from "../constants.js"; +import { Texture } from "./Texture.js"; + +/** + * Creates a texture for use with a video. + * @remarks + * Note: After the initial use of a texture, the video cannot be changed + * Instead, call {@link dispose | .dispose()} on the texture and instantiate a new one. + * @example + * ```typescript + * // assuming you have created a HTML video element with id="video" + * const video = document.getElementById('video'); + * const texture = new THREE.VideoTexture(video); + * ``` + * @see Example: {@link https://threejs.org/examples/#webgl_materials_video | materials / video} + * @see Example: {@link https://threejs.org/examples/#webgl_materials_video_webcam | materials / video / webcam} + * @see Example: {@link https://threejs.org/examples/#webgl_video_kinect | video / kinect} + * @see Example: {@link https://threejs.org/examples/#webgl_video_panorama_equirectangular | video / panorama / equirectangular} + * @see Example: {@link https://threejs.org/examples/#webxr_vr_video | vr / video} + * @see {@link https://threejs.org/docs/index.html#api/en/textures/VideoTexture | Official Documentation} + * @see {@link https://github.com/mrdoob/three.js/blob/master/src/textures/VideoTexture.js | Source} + */ +export class VideoTexture extends Texture { + /** + * Create a new instance of {@link VideoTexture} + * @param video The video element to use as the texture. + * @param mapping See {@link Texture.mapping | .mapping}. Default {@link THREE.Texture.DEFAULT_MAPPING} + * @param wrapS See {@link Texture.wrapS | .wrapS}. Default {@link THREE.ClampToEdgeWrapping} + * @param wrapT See {@link Texture.wrapT | .wrapT}. Default {@link THREE.ClampToEdgeWrapping} + * @param magFilter See {@link Texture.magFilter | .magFilter}. Default {@link THREE.LinearFilter} + * @param minFilter See {@link Texture.minFilter | .minFilter}. Default {@link THREE.LinearFilter} + * @param format See {@link Texture.format | .format}. Default {@link THREE.RGBAFormat} + * @param type See {@link Texture.type | .type}. Default {@link THREE.UnsignedByteType} + * @param anisotropy See {@link Texture.anisotropy | .anisotropy}. Default {@link THREE.Texture.DEFAULT_ANISOTROPY} + */ + constructor( + video: HTMLVideoElement, + mapping?: Mapping, + wrapS?: Wrapping, + wrapT?: Wrapping, + magFilter?: MagnificationTextureFilter, + minFilter?: MinificationTextureFilter, + format?: PixelFormat, + type?: TextureDataType, + anisotropy?: number, + ); + + /** + * Read-only flag to check if a given object is of type {@link VideoTexture}. + * @remarks This is a _constant_ value + * @defaultValue `true` + */ + readonly isVideoTexture: true; + + /** + * @override + * @defaultValue {@link THREE.LinearFilter} + */ + magFilter: MagnificationTextureFilter; + + /** + * @override + * @defaultValue {@link THREE.LinearFilter} + */ + minFilter: MinificationTextureFilter; + + /** + * @override + * @defaultValue `false` + */ + generateMipmaps: boolean; + + /** + * @override + * You will **not** need to set this manually here as it is handled by the {@link update | update()} method. + */ + set needsUpdate(value: boolean); + + /** + * This is called automatically and sets {@link needsUpdate | .needsUpdate } to `true` every time a new frame is available. + */ + update(): void; +} diff --git a/astra_scene_test/X_03/node_modules/@types/three/src/utils.d.ts b/astra_scene_test/X_03/node_modules/@types/three/src/utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3fda1cfda6a357303712712beb43673139c82af7 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/three/src/utils.d.ts @@ -0,0 +1,3 @@ +export function createCanvasElement(): HTMLCanvasElement; + +export function probeAsync(gl: WebGLRenderingContext, sync: WebGLSync, interval: number): Promise; diff --git a/astra_scene_test/X_03/node_modules/@types/use-sync-external-store/LICENSE b/astra_scene_test/X_03/node_modules/@types/use-sync-external-store/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9e841e7a26e4eb057b24511e7b92d42b257a80e5 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/use-sync-external-store/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/astra_scene_test/X_03/node_modules/@types/use-sync-external-store/README.md b/astra_scene_test/X_03/node_modules/@types/use-sync-external-store/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8196cacb237c13242caf64ba31831cdd01cc2447 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/use-sync-external-store/README.md @@ -0,0 +1,15 @@ +# Installation +> `npm install --save @types/use-sync-external-store` + +# Summary +This package contains type definitions for use-sync-external-store (https://github.com/facebook/react#readme). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/use-sync-external-store. + +### Additional Details + * Last updated: Tue, 07 Nov 2023 15:11:36 GMT + * Dependencies: none + +# Credits +These definitions were written by [eps1lon](https://github.com/eps1lon), and [Mark Erikson](https://github.com/markerikson). diff --git a/astra_scene_test/X_03/node_modules/@types/use-sync-external-store/index.d.ts b/astra_scene_test/X_03/node_modules/@types/use-sync-external-store/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d2f4c6289a484ce1ed5c9144627ef4ebb1759797 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/use-sync-external-store/index.d.ts @@ -0,0 +1,5 @@ +export function useSyncExternalStore( + subscribe: (onStoreChange: () => void) => () => void, + getSnapshot: () => Snapshot, + getServerSnapshot?: () => Snapshot, +): Snapshot; diff --git a/astra_scene_test/X_03/node_modules/@types/use-sync-external-store/package.json b/astra_scene_test/X_03/node_modules/@types/use-sync-external-store/package.json new file mode 100644 index 0000000000000000000000000000000000000000..1ad6a1a9c4cb06c110b39e9d8a872d4be3f4cebb --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/use-sync-external-store/package.json @@ -0,0 +1,30 @@ +{ + "name": "@types/use-sync-external-store", + "version": "0.0.6", + "description": "TypeScript definitions for use-sync-external-store", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/use-sync-external-store", + "license": "MIT", + "contributors": [ + { + "name": "eps1lon", + "githubUsername": "eps1lon", + "url": "https://github.com/eps1lon" + }, + { + "name": "Mark Erikson", + "githubUsername": "markerikson", + "url": "https://github.com/markerikson" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/use-sync-external-store" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "c048e9b12d49a82481404fb3bc099a0aa28adff9fc0d9755b69bbc54901ea2fb", + "typeScriptVersion": "4.5" +} \ No newline at end of file diff --git a/astra_scene_test/X_03/node_modules/@types/use-sync-external-store/shim/index.d.ts b/astra_scene_test/X_03/node_modules/@types/use-sync-external-store/shim/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8a0f16ce83046f1c8245edbafd9083d076559a8f --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/use-sync-external-store/shim/index.d.ts @@ -0,0 +1 @@ +export * from "../"; diff --git a/astra_scene_test/X_03/node_modules/@types/use-sync-external-store/shim/with-selector.d.ts b/astra_scene_test/X_03/node_modules/@types/use-sync-external-store/shim/with-selector.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..eef2fb432cb5d249d200d88e5f249bc9cc919bee --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/use-sync-external-store/shim/with-selector.d.ts @@ -0,0 +1 @@ +export * from "../with-selector"; diff --git a/astra_scene_test/X_03/node_modules/@types/use-sync-external-store/with-selector.d.ts b/astra_scene_test/X_03/node_modules/@types/use-sync-external-store/with-selector.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..65bc642fd5fea3650bfa0e60e24303b034fce24c --- /dev/null +++ b/astra_scene_test/X_03/node_modules/@types/use-sync-external-store/with-selector.d.ts @@ -0,0 +1,7 @@ +export function useSyncExternalStoreWithSelector( + subscribe: (onStoreChange: () => void) => () => void, + getSnapshot: () => Snapshot, + getServerSnapshot: undefined | null | (() => Snapshot), + selector: (snapshot: Snapshot) => Selection, + isEqual?: (a: Selection, b: Selection) => boolean, +): Selection; diff --git a/astra_scene_test/X_03/node_modules/jsesc/LICENSE-MIT.txt b/astra_scene_test/X_03/node_modules/jsesc/LICENSE-MIT.txt new file mode 100644 index 0000000000000000000000000000000000000000..a41e0a7ef970ecdd83d82cd99bda97b22077bc62 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/jsesc/LICENSE-MIT.txt @@ -0,0 +1,20 @@ +Copyright Mathias Bynens + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/astra_scene_test/X_03/node_modules/jsesc/README.md b/astra_scene_test/X_03/node_modules/jsesc/README.md new file mode 100644 index 0000000000000000000000000000000000000000..840d2c857df885e8234aca979f3a136f88869ab8 --- /dev/null +++ b/astra_scene_test/X_03/node_modules/jsesc/README.md @@ -0,0 +1,422 @@ +# jsesc + +Given some data, _jsesc_ returns a stringified representation of that data. jsesc is similar to `JSON.stringify()` except: + +1. it outputs JavaScript instead of JSON [by default](#json), enabling support for data structures like ES6 maps and sets; +2. it offers [many options](#api) to customize the output; +3. its output is ASCII-safe [by default](#minimal), thanks to its use of [escape sequences](https://mathiasbynens.be/notes/javascript-escapes) where needed. + +For any input, jsesc generates the shortest possible valid printable-ASCII-only output. [Here’s an online demo.](https://mothereff.in/js-escapes) + +jsesc’s output can be used instead of `JSON.stringify`’s to avoid [mojibake](https://en.wikipedia.org/wiki/Mojibake) and other encoding issues, or even to [avoid errors](https://twitter.com/annevk/status/380000829643571200) when passing JSON-formatted data (which may contain U+2028 LINE SEPARATOR, U+2029 PARAGRAPH SEPARATOR, or [lone surrogates](https://esdiscuss.org/topic/code-points-vs-unicode-scalar-values#content-14)) to a JavaScript parser or an UTF-8 encoder. + +## Installation + +Via [npm](https://www.npmjs.com/): + +```bash +npm install jsesc +``` + +In [Node.js](https://nodejs.org/): + +```js +const jsesc = require('jsesc'); +``` + +## API + +### `jsesc(value, options)` + +This function takes a value and returns an escaped version of the value where any characters that are not printable ASCII symbols are escaped using the shortest possible (but valid) [escape sequences for use in JavaScript strings](https://mathiasbynens.be/notes/javascript-escapes). The first supported value type is strings: + +```js +jsesc('Ich ♥ Bücher'); +// → 'Ich \\u2665 B\\xFCcher' + +jsesc('foo 𝌆 bar'); +// → 'foo \\uD834\\uDF06 bar' +``` + +Instead of a string, the `value` can also be an array, an object, a map, a set, or a buffer. In such cases, `jsesc` returns a stringified version of the value where any characters that are not printable ASCII symbols are escaped in the same way. + +```js +// Escaping an array +jsesc([ + 'Ich ♥ Bücher', 'foo 𝌆 bar' +]); +// → '[\'Ich \\u2665 B\\xFCcher\',\'foo \\uD834\\uDF06 bar\']' + +// Escaping an object +jsesc({ + 'Ich ♥ Bücher': 'foo 𝌆 bar' +}); +// → '{\'Ich \\u2665 B\\xFCcher\':\'foo \\uD834\\uDF06 bar\'}' +``` + +The optional `options` argument accepts an object with the following options: + +#### `quotes` + +The default value for the `quotes` option is `'single'`. This means that any occurrences of `'` in the input string are escaped as `\'`, so that the output can be used in a string literal wrapped in single quotes. + +```js +jsesc('`Lorem` ipsum "dolor" sit \'amet\' etc.'); +// → 'Lorem ipsum "dolor" sit \\\'amet\\\' etc.' + +jsesc('`Lorem` ipsum "dolor" sit \'amet\' etc.', { + 'quotes': 'single' +}); +// → '`Lorem` ipsum "dolor" sit \\\'amet\\\' etc.' +// → "`Lorem` ipsum \"dolor\" sit \\'amet\\' etc." +``` + +If you want to use the output as part of a string literal wrapped in double quotes, set the `quotes` option to `'double'`. + +```js +jsesc('`Lorem` ipsum "dolor" sit \'amet\' etc.', { + 'quotes': 'double' +}); +// → '`Lorem` ipsum \\"dolor\\" sit \'amet\' etc.' +// → "`Lorem` ipsum \\\"dolor\\\" sit 'amet' etc." +``` + +If you want to use the output as part of a template literal (i.e. wrapped in backticks), set the `quotes` option to `'backtick'`. + +```js +jsesc('`Lorem` ipsum "dolor" sit \'amet\' etc.', { + 'quotes': 'backtick' +}); +// → '\\`Lorem\\` ipsum "dolor" sit \'amet\' etc.' +// → "\\`Lorem\\` ipsum \"dolor\" sit 'amet' etc." +// → `\\\`Lorem\\\` ipsum "dolor" sit 'amet' etc.` +``` + +This setting also affects the output for arrays and objects: + +```js +jsesc({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }, { + 'quotes': 'double' +}); +// → '{"Ich \\u2665 B\\xFCcher":"foo \\uD834\\uDF06 bar"}' + +jsesc([ 'Ich ♥ Bücher', 'foo 𝌆 bar' ], { + 'quotes': 'double' +}); +// → '["Ich \\u2665 B\\xFCcher","foo \\uD834\\uDF06 bar"]' +``` + +#### `numbers` + +The default value for the `numbers` option is `'decimal'`. This means that any numeric values are represented using decimal integer literals. Other valid options are `binary`, `octal`, and `hexadecimal`, which result in binary integer literals, octal integer literals, and hexadecimal integer literals, respectively. + +```js +jsesc(42, { + 'numbers': 'binary' +}); +// → '0b101010' + +jsesc(42, { + 'numbers': 'octal' +}); +// → '0o52' + +jsesc(42, { + 'numbers': 'decimal' +}); +// → '42' + +jsesc(42, { + 'numbers': 'hexadecimal' +}); +// → '0x2A' +``` + +#### `wrap` + +The `wrap` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, the output is a valid JavaScript string literal wrapped in quotes. The type of quotes can be specified through the `quotes` setting. + +```js +jsesc('Lorem ipsum "dolor" sit \'amet\' etc.', { + 'quotes': 'single', + 'wrap': true +}); +// → '\'Lorem ipsum "dolor" sit \\\'amet\\\' etc.\'' +// → "\'Lorem ipsum \"dolor\" sit \\\'amet\\\' etc.\'" + +jsesc('Lorem ipsum "dolor" sit \'amet\' etc.', { + 'quotes': 'double', + 'wrap': true +}); +// → '"Lorem ipsum \\"dolor\\" sit \'amet\' etc."' +// → "\"Lorem ipsum \\\"dolor\\\" sit \'amet\' etc.\"" +``` + +#### `es6` + +The `es6` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, any astral Unicode symbols in the input are escaped using [ECMAScript 6 Unicode code point escape sequences](https://mathiasbynens.be/notes/javascript-escapes#unicode-code-point) instead of using separate escape sequences for each surrogate half. If backwards compatibility with ES5 environments is a concern, don’t enable this setting. If the `json` setting is enabled, the value for the `es6` setting is ignored (as if it was `false`). + +```js +// By default, the `es6` option is disabled: +jsesc('foo 𝌆 bar 💩 baz'); +// → 'foo \\uD834\\uDF06 bar \\uD83D\\uDCA9 baz' + +// To explicitly disable it: +jsesc('foo 𝌆 bar 💩 baz', { + 'es6': false +}); +// → 'foo \\uD834\\uDF06 bar \\uD83D\\uDCA9 baz' + +// To enable it: +jsesc('foo 𝌆 bar 💩 baz', { + 'es6': true +}); +// → 'foo \\u{1D306} bar \\u{1F4A9} baz' +``` + +#### `escapeEverything` + +The `escapeEverything` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, all the symbols in the output are escaped — even printable ASCII symbols. + +```js +jsesc('lolwat"foo\'bar', { + 'escapeEverything': true +}); +// → '\\x6C\\x6F\\x6C\\x77\\x61\\x74\\"\\x66\\x6F\\x6F\\\'\\x62\\x61\\x72' +// → "\\x6C\\x6F\\x6C\\x77\\x61\\x74\\\"\\x66\\x6F\\x6F\\'\\x62\\x61\\x72" +``` + +This setting also affects the output for string literals within arrays and objects. + +#### `minimal` + +The `minimal` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, only a limited set of symbols in the output are escaped: + +* U+0000 `\0` +* U+0008 `\b` +* U+0009 `\t` +* U+000A `\n` +* U+000C `\f` +* U+000D `\r` +* U+005C `\\` +* U+2028 `\u2028` +* U+2029 `\u2029` +* whatever symbol is being used for wrapping string literals (based on [the `quotes` option](#quotes)) +* [lone surrogates](https://esdiscuss.org/topic/code-points-vs-unicode-scalar-values#content-14) + +Note: with this option enabled, jsesc output is no longer guaranteed to be ASCII-safe. + +```js +jsesc('foo\u2029bar\nbaz©qux𝌆flops', { + 'minimal': false +}); +// → 'foo\\u2029bar\\nbaz©qux𝌆flops' +``` + +#### `isScriptContext` + +The `isScriptContext` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, occurrences of [`` or `