UNPKG

2.56 kBMarkdownView Raw
1# Installation
2> `npm install --save @types/glob-stream`
3
4# Summary
5This package contains type definitions for glob-stream (https://github.com/wearefractal/glob-stream).
6
7# Details
8Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/glob-stream.
9## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/glob-stream/index.d.ts)
10````ts
11// Type definitions for glob-stream v6.1.0
12// Project: https://github.com/wearefractal/glob-stream
13// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
14// mrmlnc <https://github.com/mrmlnc>
15// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
16
17/// <reference types="node" />
18/// <reference types="glob" />
19
20import glob = require('glob');
21
22declare function GlobStream(glob: string | string[]): NodeJS.ReadableStream;
23declare function GlobStream(glob: string | string[], options: GlobStream.Options): NodeJS.ReadableStream;
24
25declare namespace GlobStream {
26 export interface Entry {
27 cwd: string;
28 base: string;
29 path: string;
30 }
31
32 export type UniqueByStringPredicate = 'cwd' | 'base' | 'path';
33 export type UniqueByFunctionPredicate = (entry: Entry) => string;
34
35 export interface Options extends glob.IOptions {
36 /**
37 * Whether or not to error upon an empty singular glob.
38 */
39 allowEmpty?: boolean | undefined;
40 /**
41 * The absolute segment of the glob path that isn't a glob. This value is attached
42 * to each globobject and is useful for relative pathing.
43 */
44 base?: string | undefined;
45 /**
46 * Whether or not the `cwd` and `base` should be the same.
47 */
48 cwdbase?: boolean | undefined;
49 /**
50 * Filters stream to remove duplicates based on the string property name or the result of function.
51 * When using a function, the function receives the streamed
52 * data (objects containing `cwd`, `base`, `path` properties) to compare against.
53 */
54 uniqueBy?: UniqueByStringPredicate | UniqueByFunctionPredicate | undefined;
55 }
56}
57
58export = GlobStream;
59
60````
61
62### Additional Details
63 * Last updated: Tue, 06 Jul 2021 20:33:05 GMT
64 * Dependencies: [@types/glob](https://npmjs.com/package/@types/glob), [@types/node](https://npmjs.com/package/@types/node)
65 * Global values: none
66
67# Credits
68These definitions were written by [Bart van der Schoor](https://github.com/Bartvds), and [mrmlnc](https://github.com/mrmlnc).
69
\No newline at end of file