# @types/loadjs

> TypeScript definitions for loadjs

Latest version **4.0.4** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/loadjs
pnpm add @types/loadjs
yarn add @types/loadjs
bun add @types/loadjs
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 4.0.4 |
| Published | 2023-11-07 |
| First published | 2018-05-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51443 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/loadjs
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/loadjs
- npm.io page: https://npm.io/package/@types/loadjs

## Recent versions

- 4.0.4 (latest) — 2023-11-07
- 4.0.2 (ts4.3) — 2023-08-30
- 4.0.1 (ts3.6) — 2021-07-06
- 4.0.0 (ts2.6) — 2019-10-07
- 4.0.3 — 2023-10-18
- 3.5.0 — 2018-05-24

## README

# 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](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/loadjs/index.d.ts)
````ts
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, 07 Nov 2023 09:09:38 GMT
 * Dependencies: none

# Credits
These definitions were written by [Christian Rackerseder](https://github.com/screendriver), and [Aziz Khambati](https://github.com/azizhk).

---
_Source: https://npm.io/package/@types/loadjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
