@types/glob-stream
Advanced tools
Comparing version
@@ -1,2 +0,2 @@ | ||
// Type definitions for glob-stream v6.1.0 | ||
// Type definitions for glob-stream v8.0.0 | ||
// Project: https://github.com/wearefractal/glob-stream | ||
@@ -10,8 +10,9 @@ // Definitions by: Bart van der Schoor <https://github.com/Bartvds> | ||
import glob = require('glob'); | ||
import { PicomatchOptions } from "picomatch"; | ||
import { Readable } from "streamx"; | ||
declare function GlobStream(glob: string | string[]): NodeJS.ReadableStream; | ||
declare function GlobStream(glob: string | string[], options: GlobStream.Options): NodeJS.ReadableStream; | ||
declare function globStream(glob: string | string[]): Readable<globStream.Entry>; | ||
declare function globStream(glob: string | string[], options: globStream.Options): Readable<globStream.Entry>; | ||
declare namespace GlobStream { | ||
declare namespace globStream { | ||
export interface Entry { | ||
@@ -23,6 +24,9 @@ cwd: string; | ||
export type UniqueByStringPredicate = 'cwd' | 'base' | 'path'; | ||
export type UniqueByStringPredicate = keyof Entry; | ||
export type UniqueByFunctionPredicate = (entry: Entry) => string; | ||
export interface Options extends glob.GlobOptions { | ||
// Here, the settings interface provided by `picomatch` is used rather than the `anymatch` one's. | ||
// This is due to the fact that `anymatch` redirects its options to `picomatch`. | ||
// Furthermore, `anymatch`s type declaration of the `picomatch` options is hand-written and describes some of the available options incorrectly. | ||
export interface Options extends PicomatchOptions { | ||
/** | ||
@@ -33,8 +37,16 @@ * Whether or not to error upon an empty singular glob. | ||
/** | ||
* The current working directory that the glob is resolved against. | ||
*/ | ||
cwd?: string | undefined; | ||
/** | ||
* The root path that the glob is resolved against. | ||
*/ | ||
root?: string | undefined; | ||
/** | ||
* The absolute segment of the glob path that isn't a glob. This value is attached | ||
* to each globobject and is useful for relative pathing. | ||
* to each glob object and is useful for relative pathing. | ||
*/ | ||
base?: string | undefined; | ||
/** | ||
* Whether or not the `cwd` and `base` should be the same. | ||
* Whether or not the {@linkcode cwd} and {@linkcode base} should be the same. | ||
*/ | ||
@@ -51,2 +63,2 @@ cwdbase?: boolean | undefined; | ||
export = GlobStream; | ||
export = globStream; |
{ | ||
"name": "@types/glob-stream", | ||
"version": "6.1.3", | ||
"version": "8.0.0", | ||
"description": "TypeScript definitions for glob-stream", | ||
@@ -34,6 +34,7 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/glob-stream", | ||
"@types/node": "*", | ||
"glob": "^10.2.1" | ||
"@types/picomatch": "*", | ||
"@types/streamx": "*" | ||
}, | ||
"typesPublisherContentHash": "af95904a26b95b468d7cf6dc533d7c9e88aee2beb28a6140afaa1454c951a58c", | ||
"typesPublisherContentHash": "ea4939858cd75586b74b01bb8e87b20ba4a965cdd084809c158c8c16d45a4c35", | ||
"typeScriptVersion": "4.3" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
````ts | ||
// Type definitions for glob-stream v6.1.0 | ||
// Type definitions for glob-stream v8.0.0 | ||
// Project: https://github.com/wearefractal/glob-stream | ||
@@ -21,8 +21,9 @@ // Definitions by: Bart van der Schoor <https://github.com/Bartvds> | ||
import glob = require('glob'); | ||
import { PicomatchOptions } from "picomatch"; | ||
import { Readable } from "streamx"; | ||
declare function GlobStream(glob: string | string[]): NodeJS.ReadableStream; | ||
declare function GlobStream(glob: string | string[], options: GlobStream.Options): NodeJS.ReadableStream; | ||
declare function globStream(glob: string | string[]): Readable<globStream.Entry>; | ||
declare function globStream(glob: string | string[], options: globStream.Options): Readable<globStream.Entry>; | ||
declare namespace GlobStream { | ||
declare namespace globStream { | ||
export interface Entry { | ||
@@ -34,6 +35,9 @@ cwd: string; | ||
export type UniqueByStringPredicate = 'cwd' | 'base' | 'path'; | ||
export type UniqueByStringPredicate = keyof Entry; | ||
export type UniqueByFunctionPredicate = (entry: Entry) => string; | ||
export interface Options extends glob.GlobOptions { | ||
// Here, the settings interface provided by `picomatch` is used rather than the `anymatch` one's. | ||
// This is due to the fact that `anymatch` redirects its options to `picomatch`. | ||
// Furthermore, `anymatch`s type declaration of the `picomatch` options is hand-written and describes some of the available options incorrectly. | ||
export interface Options extends PicomatchOptions { | ||
/** | ||
@@ -44,8 +48,16 @@ * Whether or not to error upon an empty singular glob. | ||
/** | ||
* The current working directory that the glob is resolved against. | ||
*/ | ||
cwd?: string | undefined; | ||
/** | ||
* The root path that the glob is resolved against. | ||
*/ | ||
root?: string | undefined; | ||
/** | ||
* The absolute segment of the glob path that isn't a glob. This value is attached | ||
* to each globobject and is useful for relative pathing. | ||
* to each glob object and is useful for relative pathing. | ||
*/ | ||
base?: string | undefined; | ||
/** | ||
* Whether or not the `cwd` and `base` should be the same. | ||
* Whether or not the {@linkcode cwd} and {@linkcode base} should be the same. | ||
*/ | ||
@@ -62,3 +74,3 @@ cwdbase?: boolean | undefined; | ||
export = GlobStream; | ||
export = globStream; | ||
@@ -68,4 +80,4 @@ ```` | ||
### Additional Details | ||
* Last updated: Wed, 10 May 2023 21:03:25 GMT | ||
* Dependencies: [@types/glob](https://npmjs.com/package/@types/glob), [@types/node](https://npmjs.com/package/@types/node) | ||
* Last updated: Wed, 10 May 2023 22:32:48 GMT | ||
* Dependencies: [@types/node](https://npmjs.com/package/@types/node), [@types/picomatch](https://npmjs.com/package/@types/picomatch), [@types/streamx](https://npmjs.com/package/@types/streamx) | ||
* Global values: none | ||
@@ -72,0 +84,0 @@ |
8162
21.15%53
29.27%81
17.39%3
50%+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed