ses 1.11.0 → 1.13.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
@@ -1,5 +1,6 @@
1
1
  /**
2
- * @module Types of the SES environment
2
+ * Types of the SES environment
3
+ * @module
3
4
  */
4
5
 
5
6
  /* eslint-disable no-restricted-globals, vars-on-top, no-var */
@@ -19,6 +20,10 @@
19
20
  // version of harden.
20
21
  export type Harden = <T>(value: T) => T; // not Hardened<T>;
21
22
 
23
+ // TODO Somehow remove the redundancy between these type deinitions and the
24
+ // inline casts on each call to `getenv` in `lockdown.js`. Hopefully we can
25
+ // keep the type info in those casts so it is easily comparable by eye to
26
+ // the parameters of that call to `genev`.
22
27
  export interface RepairOptions {
23
28
  regExpTaming?: 'safe' | 'unsafe';
24
29
  localeTaming?: 'safe' | 'unsafe';
@@ -35,8 +40,15 @@ export interface RepairOptions {
35
40
  * @deprecated Deprecated and does nothing. In the future specifying it will be an error.
36
41
  */
37
42
  mathTaming?: 'safe' | 'unsafe';
38
- evalTaming?: 'safeEval' | 'unsafeEval' | 'noEval';
39
- stackFiltering?: 'concise' | 'verbose';
43
+ evalTaming?:
44
+ | 'safe-eval'
45
+ | 'unsafe-eval'
46
+ | 'no-eval'
47
+ // deprecated
48
+ | 'safeEval'
49
+ | 'unsafeEval'
50
+ | 'noEval';
51
+ stackFiltering?: 'concise' | 'omit-frames' | 'shorten-paths' | 'verbose';
40
52
  overrideTaming?: 'moderate' | 'min' | 'severe';
41
53
  overrideDebug?: Array<string>;
42
54
  domainTaming?: 'safe' | 'unsafe';
@@ -135,10 +147,12 @@ export type ModuleMapHook = (
135
147
  moduleSpecifier: string,
136
148
  ) => ModuleDescriptor | undefined;
137
149
  export type ImportHook = (moduleSpecifier: string) => Promise<ModuleDescriptor>;
138
- export type ImportNowHook = (moduleSpecifier: string) => ModuleDescriptor;
150
+ export type ImportNowHook = (
151
+ moduleSpecifier: string,
152
+ ) => ModuleDescriptor | undefined;
139
153
  export type ImportMetaHook = (
140
154
  moduleSpecifier: string,
141
- importMeta: Object,
155
+ importMeta: ImportMeta,
142
156
  ) => void;
143
157
 
144
158
  export interface CompartmentOptions {
@@ -569,7 +583,9 @@ declare global {
569
583
 
570
584
  evaluate(code: string, options?: CompartmentEvaluateOptions): any;
571
585
 
572
- import(specifier: string): Promise<{ namespace: ModuleExportsNamespace }>;
586
+ import(
587
+ specifier: string | null,
588
+ ): Promise<{ namespace: ModuleExportsNamespace }>;
573
589
 
574
590
  load(specifier: string): Promise<void>;
575
591