Skip to content

Commit

Permalink
types(ses): Add new module descriptor shapes
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal committed Jul 15, 2024
1 parent 9b36afd commit debd810
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions packages/ses/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,35 +72,40 @@ export interface VirtualModuleSource {

export type ModuleSource = PrecompiledModuleSource | VirtualModuleSource;

export interface RedirectModuleDescriptor {
specifier: string;
record?: ModuleSource;
export interface SourceModuleDescriptor {
source: string | ModuleSource;
specifier?: string;
importMeta?: any;
compartment?: Compartment; // defaults to parent
}

export interface NamespaceModuleDescriptor {
namespace: string | ModuleExportsNamespace;
compartment?: Compartment;
}

export interface ReferenceModuleDescriptor {
// Deprecated in favor of SourceModuleDescriptor,
// but beware the change in default compartment.
export interface RecordModuleDescriptor {
specifier: string;
record?: ModuleSource;
importMeta?: any;
compartment?: Compartment;
compartment?: Compartment; // defaults to self
}

export type ModuleDescriptor =
// These descriptor shapes are needed for XS parity:
// | SourceModuleDescriptor
// | NamespaceModuleDescriptor
| SourceModuleDescriptor
| NamespaceModuleDescriptor
// To be deprecated:
| RedirectModuleDescriptor
| ReferenceModuleDescriptor
| RecordModuleDescriptor
| ModuleExportsNamespace
| VirtualModuleSource
| PrecompiledModuleSource;

// Deprecated type aliases:
export type PrecompiledStaticModuleInterface = PrecompiledModuleSource;
export type ThirdPartyStaticModuleInterface = VirtualModuleSource;
export type RedirectStaticModuleInterface = RedirectModuleDescriptor;
export type RedirectStaticModuleInterface = RecordModuleDescriptor;
export type FinalStaticModuleType = ModuleSource;
export type StaticModuleType = RedirectStaticModuleInterface | ModuleSource;

Expand Down

0 comments on commit debd810

Please sign in to comment.