Skip to content

Commit

Permalink
chore: update target
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Jan 12, 2025
1 parent 538b43a commit da0a312
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 5 deletions.
2 changes: 1 addition & 1 deletion target/dts/error.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @module zurk/error
* @module
*
* Zurk spawn error codes & handling utilities
*
Expand Down
2 changes: 1 addition & 1 deletion target/dts/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export { $ } from './x.js';
export { zurk } from './zurk.js';
export { type Promisified, buildCmd } from './util.js';
/**
* @module zurk
* @module
*
* A generic process spawner
*
Expand Down
5 changes: 5 additions & 0 deletions target/dts/mixin/pipe.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
import type { TMixin } from '../x.js';
/**
* @module
*
* Zurk $ pipe mixin
*/
export declare const pipeMixin: TMixin;
43 changes: 42 additions & 1 deletion target/dts/spawn.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import EventEmitter from 'node:events';
import { Buffer } from 'node:buffer';
import { Readable, Writable, Stream, Transform } from 'node:stream';
/**
* @module zurk/spawn
* @module
*
* Zurk internal child_process caller API
*
Expand Down Expand Up @@ -96,12 +96,34 @@ export interface TSpawnCtxNormalized {
run: (cb: () => void, ctx: TSpawnCtxNormalized) => void;
stack: string;
}
/**
* zurk default settings
*/
export declare const defaults: TSpawnCtxNormalized;
/**
* Normalizes spawn context.
*
* @param ctxs Contexts to normalize
* @returns
*/
export declare const normalizeCtx: (...ctxs: TSpawnCtx[]) => TSpawnCtxNormalized;
/**
* Redirects input to child process stdin
* @param child
* @param input
*/
export declare const processInput: (child: TChild, input?: TInput | null) => void;
/**
* Transformer that emits data but does not consume it.
*/
export declare class VoidStream extends Transform {
_transform(chunk: any, _: string, cb: (err?: Error) => void): void;
}
/**
* Builds spawn options
* @param ctx
* @returns spawn options
*/
export declare const buildSpawnOpts: ({ spawnOpts, stdio, cwd, shell, input, env, detached, signal }: TSpawnCtxNormalized) => {
env: Record<string, string | undefined>;
cwd: string;
Expand All @@ -112,7 +134,26 @@ export declare const buildSpawnOpts: ({ spawnOpts, stdio, cwd, shell, input, env
detached: boolean;
signal: AbortSignal;
};
/**
* Toggles event listeners
* @param pos 'on' | 'off'
* @param ee EventEmitter
* @param on listeners map
*/
export declare const toggleListeners: (pos: "on" | "off", ee: EventEmitter, on?: Partial<TSpawnListeners>) => void;
/**
* Creates a new spawn store
*/
export declare const createStore: () => TSpawnStore;
/**
* Invokes a child process
* @param c Normalized context.
* @returns Normalized context.
*/
export declare const invoke: (c: TSpawnCtxNormalized) => TSpawnCtxNormalized;
/**
* Executes a child process
* @param ctx TSpawnCtx
* @returns TSpawnCtxNormalized
*/
export declare const exec: (ctx: TSpawnCtx) => TSpawnCtxNormalized;
2 changes: 1 addition & 1 deletion target/dts/util.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Stream } from 'node:stream';
import { Buffer } from 'node:buffer';
/**
* @module zurk/util
* @module
*
* Zurk utility functions
*
Expand Down
25 changes: 25 additions & 0 deletions target/dts/x.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
import type { Readable, Writable } from 'node:stream';
import { TZurk, TZurkPromise, TZurkOptions, TZurkCtx } from './zurk.js';
import { type Promisified, type TVoidCallback, type TQuote } from './util.js';
/**
* @module
*
* Zurk $ API
*
* @example
* ```ts
* import {$} from 'zurk/x'
*
* const p = await $`echo foo`'
* ```
*/
export interface TShellCtxExtra {
}
export interface TShellExtra {
Expand Down Expand Up @@ -50,5 +62,18 @@ export interface TShellSync {
<O>(this: O, pieces?: TemplateStringsArray, ...args: any[]): TShellResponseSync;
(opts: TShellOptions): TShellSync;
}
/**
* Zurk $ template API
*
* @param pieces
* @param args
*/
export declare const $: TShell;
/**
* Applies mixins to the result.
* @param $
* @param result
* @param parent
* @returns TZurk | TZurkPromise | TShellOptions
*/
export declare const applyMixins: ($: TShell, result: TZurk | TZurkPromise | TShellOptions, parent?: TZurk | TZurkPromise) => TZurk | TZurkPromise | TShellOptions;
2 changes: 1 addition & 1 deletion target/dts/zurk.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type TSpawnCtxNormalized, type TSpawnResult, type TSpawnListeners } from './spawn.js';
import { type Promisified } from './util.js';
/**
* @module zurk/zurk
* @module
*
* Zurk process spawner
*
Expand Down

0 comments on commit da0a312

Please sign in to comment.