Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exported interface Options not available in distributed types #38

Open
esetnik opened this issue Dec 8, 2022 · 3 comments
Open

exported interface Options not available in distributed types #38

esetnik opened this issue Dec 8, 2022 · 3 comments

Comments

@esetnik
Copy link
Contributor

esetnik commented Dec 8, 2022

The v7.0.2 version contains dist/index.d.ts but interface Options is not exported. I have no idea why this is. Can you verify that the version available on npm was published correctly?

export declare class TimeoutError extends Error {
    previous: Error | undefined;
    constructor(message: string, previousError?: Error);
}
export type MatchOption = string | RegExp | Error | Function;
interface Options {
    max: number;
    timeout?: number | undefined;
    match?: MatchOption[] | MatchOption | undefined;
    backoffBase?: number | undefined;
    backoffExponent?: number | undefined;
    report?: ((message: string, obj: Options, err?: any) => void) | undefined;
    name?: string | undefined;
}
type CoercedOptions = {
    $current: number;
    max: number;
    timeout?: number | undefined;
    match: MatchOption[];
    backoffBase: number;
    backoffExponent: number;
    report?: ((message: string, obj: Options, err?: any) => void) | undefined;
    name?: string | undefined;
};
type MaybePromise<T> = PromiseLike<T> | T;
type RetryCallback<T> = ({ current }: {
    current: CoercedOptions['$current'];
}) => MaybePromise<T>;
export declare function retryAsPromised<T>(callback: RetryCallback<T>, optionsInput: Options | number | CoercedOptions): Promise<T>;
export default retryAsPromised;
@esetnik
Copy link
Contributor Author

esetnik commented Dec 8, 2022

I built the same target locally using npm run build and get the correct types so there appears to be some discrepancy between what was published on npm and the current version in the source code.

@mickhansen
Copy link
Owner

@esetnik My mistake, package.json had no prepublish script. [email protected] should be correct.

@esetnik
Copy link
Contributor Author

esetnik commented Dec 8, 2022

Looks good now! Thanks 👍

I believe the prepublish script should also perform a clean of the dist directory to avoid accidentally publishing old assets that aren't overwritten in the build step.

WikiRik added a commit to sequelize/sequelize that referenced this issue Dec 8, 2022
…ocumentation (#15400)

* use retry-as-promised types for retry options

* prefer exact package version

* move to production deps

* unpin @types/retry-as-promised

* import retry-as-promised

* retry-as-promised typings re-exported

* import and re-export Options from retry-as-promised after mickhansen/retry-as-promised#38

Co-authored-by: Rik Smale <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants