2.3.7 • Published 3 months ago

@types/snowpack-env v2.3.7

Weekly downloads
6,854
License
MIT
Repository
github
Last release
3 months ago

Installation

npm install --save @types/snowpack-env

Summary

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

Details

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

index.d.ts

// Type definitions for snowpack 2.3
// Project: https://github.com/pikapkg/snowpack#readme
// Definitions by: Fred K. Schott <https://github.com/FredKSchott>
//                 Michael Stramel <https://github.com/stramel>
//                 Drew Powers <https://github.com/drwpow>
//                 Jack Works <https://github.com/Jack-Works>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Minimum TypeScript Version: 3.7

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, 06 Jul 2021 16:35:02 GMT
  • Dependencies: none
  • Global values: none

Credits

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

2.3.7

3 months ago

2.3.6

6 months ago

2.3.5

7 months ago

2.3.4

3 years ago

2.3.3

3 years ago

2.3.2

3 years ago

2.3.1

3 years ago

2.3.0

4 years ago