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

    4.0.1 • Public • Published

    Installation

    npm install --save @types/loadjs

    Summary

    This package contains type definitions for loadjs (https://github.com/muicss/loadjs).

    Details

    Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/loadjs.

    index.d.ts

    // Type definitions for loadjs 4.0
    // Project: https://github.com/muicss/loadjs
    // Definitions by: Christian Rackerseder <https://github.com/screendriver>
    //                 Aziz Khambati <https://github.com/azizhk>
    // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
    // TypeScript Version: 2.6
    
    export as namespace loadjs;
    
    export = loadjs;
    
    declare function loadjs(
        files: string | string[],
        bundleIdOrLoaded: string | loadjs.LoadOptions | loadjs.LoadedFn,
    ): void;
    
    declare function loadjs(
        files: string | string[],
        bundleId: string,
        optionsOrCallback: loadjs.LoadOptions | loadjs.LoadedFn
    ): void;
    
    declare function loadjs(
        files: string | string[],
        options: loadjs.LoadOptions & {
            returnPromise: true
        }
    ): Promise<void>;
    
    declare function loadjs(
        files: string | string[],
        bundleId: string,
        options: loadjs.LoadOptions & {
            returnPromise: true
        }
    ): Promise<void>;
    
    declare namespace loadjs {
        type LoadedFn = () => void;
    
        interface LoadOptions {
            before?(path: string, scriptEl: HTMLElement): void;
            async?: boolean | undefined;
            numRetries?: number | undefined;
            success?(): void; // Arguments provided are different in case of returnPromise: true / false
            error?(depsNotFound: string[]): void;
        }
    
        interface ReadyOptions {
            success?(): void;
            error?(depsNotFound: string[]): void;
        }
    
        function ready(bundleIds: string | string[], optionsOrCallback: ReadyOptions | LoadedFn): typeof loadjs;
        function isDefined(bundleId: string): boolean;
        function done(bundleId: string): void;
        function reset(): void;
    }

    Additional Details

    • Last updated: Tue, 06 Jul 2021 22:02:43 GMT
    • Dependencies: none
    • Global values: loadjs

    Credits

    These definitions were written by Christian Rackerseder, and Aziz Khambati.

    Keywords

    none

    Install

    npm i @types/loadjs

    DownloadsWeekly Downloads

    43,882

    Version

    4.0.1

    License

    MIT

    Unpacked Size

    6.09 kB

    Total Files

    4

    Last publish

    Collaborators

    • types