UNPKG

1.15 kBTypeScriptView Raw
1/**
2 * If you import a dependency which does not include its own type definitions,
3 * TypeScript will try to find a definition for it by following the `typeRoots`
4 * compiler option in tsconfig.json. For this project, we've configured it to
5 * fall back to this folder if nothing is found in node_modules/@types.
6 *
7 * Often, you can install the DefinitelyTyped
8 * (https://github.com/DefinitelyTyped/DefinitelyTyped) type definition for the
9 * dependency in question. However, if no one has yet contributed definitions
10 * for the package, you may want to declare your own. (If you're using the
11 * `noImplicitAny` compiler options, you'll be required to declare it.)
12 *
13 * This is an example type definition which allows import from `module-name`,
14 * e.g.:
15 * ```ts
16 * import something from 'module-name';
17 * something();
18 * ```
19 */
20declare module 'kruptein' {
21 type Callback = (msg?: string, data?: string) => void
22 class Kruptein {
23 public set(
24 secret: string,
25 plaintext: string | any,
26 callback: Callback
27 ): void
28
29 public get(secret: string, ciphertext: string, callback: Callback): void
30 }
31 export = Kruptein
32}