ses 0.18.7 → 1.0.0

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.
package/types.d.ts CHANGED
@@ -19,7 +19,7 @@
19
19
  // version of harden.
20
20
  export type Harden = <T>(value: T) => T; // not Hardened<T>;
21
21
 
22
- export interface LockdownOptions {
22
+ export interface RepairOptions {
23
23
  regExpTaming?: 'safe' | 'unsafe';
24
24
  localeTaming?: 'safe' | 'unsafe';
25
25
  consoleTaming?: 'safe' | 'unsafe';
@@ -36,6 +36,11 @@ export interface LockdownOptions {
36
36
  __hardenTaming__?: 'safe' | 'unsafe';
37
37
  }
38
38
 
39
+ // Deprecated in favor of the more specific RepairOptions
40
+ export type LockdownOptions = RepairOptions;
41
+
42
+ export type RepairIntrinsics = (options?: LockdownOptions) => void;
43
+ export type HardenIntrinsics = () => void;
39
44
  export type Lockdown = (options?: LockdownOptions) => void;
40
45
 
41
46
  export type __LiveExportMap__ = Record<string, [string, boolean]>;
@@ -53,8 +58,11 @@ export interface PrecompiledStaticModuleInterface {
53
58
  export interface ThirdPartyStaticModuleInterface {
54
59
  imports: Array<string>;
55
60
  exports: Array<string>;
61
+ /**
62
+ * Note that this value does _not_ contain any numeric or symbol property keys, which can theoretically be members of `exports` in a CommonJS module.
63
+ */
56
64
  execute(
57
- proxiedExports: Object,
65
+ proxiedExports: Record<string, any>,
58
66
  compartment: Compartment,
59
67
  resolvedImports: Record<string, string>,
60
68
  ): void;
@@ -172,19 +180,13 @@ export type Raise = (reason: Error) => void;
172
180
  // eslint-disable-next-line no-use-before-define
173
181
  export type MakeAssert = (raise?: Raise, unredacted?: boolean) => Assert;
174
182
 
175
- export interface Assert {
183
+ export interface AssertionFunctions {
176
184
  (
177
185
  value: any,
178
186
  details?: Details,
179
187
  errorConstructor?: ErrorConstructor,
180
188
  ): asserts value;
181
189
  typeof: AssertTypeof;
182
- error(
183
- details?: Details,
184
- errorConstructor?: ErrorConstructor,
185
- options?: AssertMakeErrorOptions,
186
- ): Error;
187
- fail(details?: Details, errorConstructor?: ErrorConstructor): never;
188
190
  equal(
189
191
  left: any,
190
192
  right: any,
@@ -192,6 +194,15 @@ export interface Assert {
192
194
  errorConstructor?: ErrorConstructor,
193
195
  ): void;
194
196
  string(specimen: any, details?: Details): asserts specimen is string;
197
+ fail(details?: Details, errorConstructor?: ErrorConstructor): never;
198
+ }
199
+
200
+ export interface AssertionUtilities {
201
+ error(
202
+ details?: Details,
203
+ errorConstructor?: ErrorConstructor,
204
+ options?: AssertMakeErrorOptions,
205
+ ): Error;
195
206
  note(error: Error, details: Details): void;
196
207
  details(
197
208
  template: TemplateStringsArray | string[],
@@ -200,9 +211,16 @@ export interface Assert {
200
211
  Fail(template: TemplateStringsArray | string[], ...args: any): never;
201
212
  quote(payload: any, spaces?: string | number): ToStringable;
202
213
  bare(payload: any, spaces?: string | number): ToStringable;
214
+ }
215
+
216
+ export interface DeprecatedAssertionUtilities {
203
217
  makeAssert: MakeAssert;
204
218
  }
205
219
 
220
+ export type Assert = AssertionFunctions &
221
+ AssertionUtilities &
222
+ DeprecatedAssertionUtilities;
223
+
206
224
  interface CompartmentEvaluateOptions {
207
225
  sloppyGlobalsMode?: boolean;
208
226
  __moduleShimLexicals__?: Object;
@@ -214,6 +232,8 @@ interface CompartmentEvaluateOptions {
214
232
  declare global {
215
233
  var harden: Harden;
216
234
 
235
+ var repairIntrinsics: RepairIntrinsics;
236
+ var hardenIntrinsics: HardenIntrinsics;
217
237
  var lockdown: Lockdown;
218
238
 
219
239
  var assert: Assert;