@types/snowpack-env
TypeScript icon, indicating that this package has built-in type declarations

2.3.7 • Public • Published

Installation

npm install --save @types/snowpack-env

Summary

This package contains type definitions for snowpack-env (https://github.com/pikapkg/snowpack#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/snowpack-env.

index.d.ts

interface ImportMetaHot {
    /** Accept the HMR update. */
    accept(
        callback?: (update: {
            /** The newer version of the current module */
            module: unknown;
        }) => void,
    ): void;
    /** Accept the HMR update with dependencies update. */
    accept(
        dependencies: readonly string[],
        callback: (update: {
            /** The newer version of the current module */
            module: unknown;
            /** The newer version of dependencies. Order is same as the first argument. */
            deps: unknown[];
        }) => void,
    ): void;
    /** Cleanup side-effects before load the newer version of this module. */
    dispose(callback: () => void): void;
    /** Mark the HMR as invalidated to reload the whole page. */
    invalidate(): void;
    /** Mark this module as HMR incompatible, always reload the page. */
    decline(): void;
    /** See https://github.com/pikapkg/esm-hmr#importmetahotdata */
    data: unknown;
}

interface ImportMeta {
    url: string;
    // TypeScript Bug: https://github.com/microsoft/TypeScript/issues/41468
    // When TS bug is fixed and ecosystem has upgraded, then it will be safe
    // to change `hot` to the more correct "possibly undefined" (hot?: ...).
    readonly hot: ImportMetaHot;
    readonly env: {
        readonly [key: string]: any;
        readonly SNOWPACK_PUBLIC_API_URL: string;
        readonly MODE: string;
        readonly NODE_ENV: string;
        readonly SSR?: boolean | undefined;
    };
}

Additional Details

  • Last updated: Tue, 30 Jan 2024 21:35:45 GMT
  • Dependencies: none

Credits

These definitions were written by Fred K. Schott, Michael Stramel, Drew Powers, and Jack Works.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/snowpack-env

Weekly Downloads

5,481

Version

2.3.7

License

MIT

Unpacked Size

6.23 kB

Total Files

5

Last publish

Collaborators

  • types