-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
General info
- Package:
@segment/facade - version:
3.4.10
Current state
- Currently, the @segment/facade package is referring to type definitions inside its
index.d.ts. - Those type definitions are being declared inside an augmented module via
declare module ...:
declare module '@segment/facade' {
interface Options {
clone?: boolean;
traverse?: boolean;
}
export class Facade<T = { [key: string]: any }> {
constructor(object: { [key: string]: any }, options?: Options);
...
}
...
}
Issue
- When generating type defintions for a consumer of segment it is impossible for the compiler to get exported members of the
@segment/facademodule, which results in an error:"Facade" is not exported by "node_modules/@segment/facade/index.d.ts", imported by "node_modules/@segment/analytics-next/dist/types/lib/to-facade.d.ts". - btw.: this is the only
@segment/...module that is using augmentation in type definitions.
Proposition
- Remove the wrapping module augmentation
declare module...as it's not really needed as the types can be easily imported by using the module's name@segment/facadedeclared inpackage.json. - Add
exportmodifier to theOptionsinterface declaration, so that is can be consumed from outside:
export interface Options {
clone?: boolean;
traverse?: boolean;
}
Metadata
Metadata
Assignees
Labels
No labels