# @types/omelette

> TypeScript definitions for omelette

Latest version **0.4.5** (published 2025-03-22) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 50/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; popular repo; extremely popular.

Warnings: low downloads; no esm support; pre 1.0.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 0.4.5 |
| Published | 2025-03-22 |
| First published | 2019-08-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51419 |
| Maintainers | types |

## Links

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

## Recent versions

- 0.4.5 (latest) — 2025-03-22
- 0.4.4 (ts4.9) — 2023-11-07
- 0.4.2 (ts4.1) — 2022-11-07
- 0.4.1 (ts3.5) — 2021-01-10
- 0.4.0 (ts3.0) — 2019-08-19
- 0.4.3 — 2023-10-18

## README

# Installation
> `npm install --save @types/omelette`

# Summary
This package contains type definitions for omelette (https://github.com/f/omelette).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/omelette.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/omelette/index.d.ts)
````ts
declare var omelette: omelette.Omelette;

export = omelette;
export as namespace omelette;

declare namespace omelette {
    interface Omelette {
        (message: string): Instance;
        (literals: TemplateStringsArray, ...placeholders: TemplateValue[]): Instance;
    }

    interface Instance {
        cleanupShellInitFile(initFile?: string): void;

        init(): void;
        next(fn: () => void): void;

        on(action: string, callback: Callback): void;
        on(action: "complete", callback: CallbackOnComplete): void;

        onAsync(actions: string, callback: CallbackAsync): void;

        setupShellInitFile(initFile?: string): void;

        tree(value: TreeValue): this;
    }

    type ReplyFn<T> = (value: T) => void;

    interface CallbackValue {
        before: string;
        fragment: number;
        line: string;
        reply: ReplyFn<Choices>;
    }

    interface CallbackAsyncValue {
        before: string;
        fragment: number;
        line: string;
        reply: ReplyFn<Promise<Choices>>;
    }

    type Callback = (obj: CallbackValue) => void;
    type CallbackOnComplete = (fragment: string, obj: CallbackValue) => void;

    type CallbackAsync = (obj: CallbackAsyncValue) => Promise<void>;

    type Choices = string[];

    type TemplatePrimativeValue = string | Choices;

    type TemplateValue = TemplatePrimativeValue | Callback;

    type TreeCallback<V> = () => V;

    interface TreeValue {
        [key: string]: TreeValue | Choices | TreeCallback<Choices>;
    }
}

````

### Additional Details
 * Last updated: Sat, 22 Mar 2025 04:36:23 GMT
 * Dependencies: none

# Credits
These definitions were written by [Kamontat Chantrachirathumrong](https://github.com/kamontat).

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