@bedrock-apis/env-types 1.0.0-beta.6 → 1.1.0-rc

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +11 -7
  2. package/lib.d.ts +206 -3
  3. package/package.json +2 -1
package/README.md CHANGED
@@ -40,24 +40,28 @@ Add the package to the `types` field in your `tsconfig.json`:
40
40
  ```json
41
41
  {
42
42
  "compilerOptions": {
43
+ // ... your properties
43
44
  "noLib": true,
44
45
  "types": ["@bedrock-apis/env-types"]
45
46
  }
46
47
  }
47
48
  ```
48
49
 
49
- ## Development Plan
50
-
51
- - Generate a basic set of methods and properties for each global class.
52
- - Compare and extend these definitions against TypeScript's standard global types.
50
+ ## Future Plan
53
51
  - Continuously update with help of contributions.
54
52
 
55
53
  ## Contributing
56
54
 
57
- This package is in **beta**, and we welcome contributions from the community. You can help by:
55
+ This package is in **release candidate**, and we welcome contributions from the community. You can help by:
58
56
 
59
- * Adding missing type definitions.
60
- * Fixing inconsistencies between types and engine environment apis.
57
+ * Cloning and checking of all types matches latest engine environment
61
58
  * Suggesting new features or improvements.
62
59
 
60
+ ### How to repo
61
+ * Clone repo
62
+ * Install dependencies
63
+ * Move cwd to "./dev/"
64
+ * Run "node bds-gen.ts" to update generated file
65
+ * Run "node scrapple.ts" to bundle all /lib/ files to single /lib.d.ts
66
+
63
67
  Please visit our [GitHub repository](https://github.com/bedrock-apis/env-types) to submit issues or pull requests.
package/lib.d.ts CHANGED
@@ -3018,6 +3018,181 @@ interface FinalizationRegistryConstructor {
3018
3018
  }
3019
3019
  declare var FinalizationRegistry: FinalizationRegistryConstructor;
3020
3020
 
3021
+ interface Array<T> {
3022
+ /**
3023
+ * Returns the item located at the specified index.
3024
+ * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
3025
+ */
3026
+ at(index: number): T | undefined;
3027
+ }
3028
+ interface ReadonlyArray<T> {
3029
+ /**
3030
+ * Returns the item located at the specified index.
3031
+ * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
3032
+ */
3033
+ at(index: number): T | undefined;
3034
+ }
3035
+ interface Int8Array<TArrayBuffer extends ArrayBufferLike> {
3036
+ /**
3037
+ * Returns the item located at the specified index.
3038
+ * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
3039
+ */
3040
+ at(index: number): number | undefined;
3041
+ }
3042
+ interface Uint8Array<TArrayBuffer extends ArrayBufferLike> {
3043
+ /**
3044
+ * Returns the item located at the specified index.
3045
+ * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
3046
+ */
3047
+ at(index: number): number | undefined;
3048
+ }
3049
+ interface Uint8ClampedArray<TArrayBuffer extends ArrayBufferLike> {
3050
+ /**
3051
+ * Returns the item located at the specified index.
3052
+ * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
3053
+ */
3054
+ at(index: number): number | undefined;
3055
+ }
3056
+ interface Int16Array<TArrayBuffer extends ArrayBufferLike> {
3057
+ /**
3058
+ * Returns the item located at the specified index.
3059
+ * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
3060
+ */
3061
+ at(index: number): number | undefined;
3062
+ }
3063
+ interface Uint16Array<TArrayBuffer extends ArrayBufferLike> {
3064
+ /**
3065
+ * Returns the item located at the specified index.
3066
+ * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
3067
+ */
3068
+ at(index: number): number | undefined;
3069
+ }
3070
+ interface Int32Array<TArrayBuffer extends ArrayBufferLike> {
3071
+ /**
3072
+ * Returns the item located at the specified index.
3073
+ * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
3074
+ */
3075
+ at(index: number): number | undefined;
3076
+ }
3077
+ interface Uint32Array<TArrayBuffer extends ArrayBufferLike> {
3078
+ /**
3079
+ * Returns the item located at the specified index.
3080
+ * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
3081
+ */
3082
+ at(index: number): number | undefined;
3083
+ }
3084
+ interface Float32Array<TArrayBuffer extends ArrayBufferLike> {
3085
+ /**
3086
+ * Returns the item located at the specified index.
3087
+ * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
3088
+ */
3089
+ at(index: number): number | undefined;
3090
+ }
3091
+ interface Float64Array<TArrayBuffer extends ArrayBufferLike> {
3092
+ /**
3093
+ * Returns the item located at the specified index.
3094
+ * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
3095
+ */
3096
+ at(index: number): number | undefined;
3097
+ }
3098
+ interface BigInt64Array<TArrayBuffer extends ArrayBufferLike> {
3099
+ /**
3100
+ * Returns the item located at the specified index.
3101
+ * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
3102
+ */
3103
+ at(index: number): bigint | undefined;
3104
+ }
3105
+ interface BigUint64Array<TArrayBuffer extends ArrayBufferLike> {
3106
+ /**
3107
+ * Returns the item located at the specified index.
3108
+ * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
3109
+ */
3110
+ at(index: number): bigint | undefined;
3111
+ }
3112
+
3113
+ interface ErrorOptions {
3114
+ cause?: unknown;
3115
+ }
3116
+ interface Error {
3117
+ cause?: unknown;
3118
+ }
3119
+ interface ErrorConstructor {
3120
+ new (message?: string, options?: ErrorOptions): Error;
3121
+ (message?: string, options?: ErrorOptions): Error;
3122
+ }
3123
+ interface EvalErrorConstructor {
3124
+ new (message?: string, options?: ErrorOptions): EvalError;
3125
+ (message?: string, options?: ErrorOptions): EvalError;
3126
+ }
3127
+ interface RangeErrorConstructor {
3128
+ new (message?: string, options?: ErrorOptions): RangeError;
3129
+ (message?: string, options?: ErrorOptions): RangeError;
3130
+ }
3131
+ interface ReferenceErrorConstructor {
3132
+ new (message?: string, options?: ErrorOptions): ReferenceError;
3133
+ (message?: string, options?: ErrorOptions): ReferenceError;
3134
+ }
3135
+ interface SyntaxErrorConstructor {
3136
+ new (message?: string, options?: ErrorOptions): SyntaxError;
3137
+ (message?: string, options?: ErrorOptions): SyntaxError;
3138
+ }
3139
+ interface TypeErrorConstructor {
3140
+ new (message?: string, options?: ErrorOptions): TypeError;
3141
+ (message?: string, options?: ErrorOptions): TypeError;
3142
+ }
3143
+ interface URIErrorConstructor {
3144
+ new (message?: string, options?: ErrorOptions): URIError;
3145
+ (message?: string, options?: ErrorOptions): URIError;
3146
+ }
3147
+ interface AggregateErrorConstructor {
3148
+ new (
3149
+ errors: Iterable<any>,
3150
+ message?: string,
3151
+ options?: ErrorOptions,
3152
+ ): AggregateError;
3153
+ (
3154
+ errors: Iterable<any>,
3155
+ message?: string,
3156
+ options?: ErrorOptions,
3157
+ ): AggregateError;
3158
+ }
3159
+
3160
+ interface ObjectConstructor {
3161
+ /**
3162
+ * Determines whether an object has a property with the specified name.
3163
+ * @param o An object.
3164
+ * @param v A property name.
3165
+ */
3166
+ hasOwn(o: object, v: PropertyKey): boolean;
3167
+ }
3168
+
3169
+ interface RegExpMatchArray {
3170
+ indices?: RegExpIndicesArray;
3171
+ }
3172
+ interface RegExpExecArray {
3173
+ indices?: RegExpIndicesArray;
3174
+ }
3175
+ interface RegExpIndicesArray extends Array<[number, number]> {
3176
+ groups?: {
3177
+ [key: string]: [number, number];
3178
+ };
3179
+ }
3180
+ interface RegExp {
3181
+ /**
3182
+ * Returns a Boolean value indicating the state of the hasIndices flag (d) used with a regular expression.
3183
+ * Default is false. Read-only.
3184
+ */
3185
+ readonly hasIndices: boolean;
3186
+ }
3187
+
3188
+ interface String {
3189
+ /**
3190
+ * Returns a new String consisting of the single UTF-16 code unit located at the specified index.
3191
+ * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
3192
+ */
3193
+ at(index: number): string | undefined;
3194
+ }
3195
+
3021
3196
  interface Array<T> {
3022
3197
  /**
3023
3198
  * Returns the value of the last element in the array where predicate is true, and undefined
@@ -8345,7 +8520,23 @@ interface InternalErrorConstructor {
8345
8520
  (message?: string): InternalError;
8346
8521
  readonly prototype: InternalError;
8347
8522
  }
8348
- declare var InternalError: new () => InternalError;
8523
+ declare var InternalError: InternalErrorConstructor;
8524
+
8525
+ interface SetConstructor {
8526
+ /**
8527
+ * @deprecated This function is not supposed to be on Set constructor ref: https://github.com/quickjs-ng/quickjs/issues/714
8528
+ */
8529
+ groupBy<K, T>(
8530
+ items: Iterable<T>,
8531
+ keySelector: (item: T, index: number) => K,
8532
+ ): Map<K, T[]>;
8533
+ }
8534
+
8535
+ interface Date {
8536
+ getYear(): number;
8537
+ setYear(year: number): number;
8538
+ toGMTString(): string;
8539
+ }
8349
8540
 
8350
8541
  interface Object {
8351
8542
  /**
@@ -8354,8 +8545,20 @@ interface Object {
8354
8545
  * @protected
8355
8546
  * @ignore
8356
8547
  */
8357
- get __proto__(): object;
8358
- set __proto__(prototype: object);
8548
+ get __proto__(): object | null;
8549
+ set __proto__(prototype: object | null);
8550
+
8551
+ /** @deprecated */
8552
+ __defineGetter__(v: PropertyKey, getter: () => any): void;
8553
+
8554
+ /** @deprecated */
8555
+ __defineSetter__(v: PropertyKey, setter: (val: any) => void): void;
8556
+
8557
+ /** @deprecated */
8558
+ __lookupGetter__(v: PropertyKey): (() => any) | undefined;
8559
+
8560
+ /** @deprecated */
8561
+ __lookupSetter__(v: PropertyKey): ((val: any) => void) | undefined;
8359
8562
  }
8360
8563
 
8361
8564
  interface ObjectConstructor {
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@bedrock-apis/env-types",
3
- "version": "1.0.0-beta.6",
3
+ "version": "1.1.0-rc",
4
4
  "description": "A collection of environment-specific TypeScript type definitions for engines with non-standard versioning and selective feature support across versions.",
5
5
  "main": "",
6
6
  "types": "lib.d.ts",
7
+ "type": "module",
7
8
  "keywords": [
8
9
  "typescript",
9
10
  "api-types",