From 55541aa0202cbb725e560714e3e0e9a01049d7fa Mon Sep 17 00:00:00 2001 From: Rafa Mel Date: Wed, 1 May 2019 07:56:58 +0200 Subject: [PATCH] docs: improves tsdocs --- src/public/exec/stream.ts | 6 ++++++ src/public/kpo/list.ts | 2 ++ src/public/kpo/options.ts | 3 +++ 3 files changed, 11 insertions(+) diff --git a/src/public/exec/stream.ts b/src/public/exec/stream.ts index 2b38e53..d355336 100644 --- a/src/public/exec/stream.ts +++ b/src/public/exec/stream.ts @@ -34,6 +34,11 @@ export type TStreamOptions = IMultiExecOptions & { export default expose(stream); +/** + * Streams *kpo* commands for children projects. + * It is an *exposed* function: call `stream.fn()`, which takes the same arguments, in order to execute on call. + * @returns An asynchronous function taking additional arguments to be used for all commands -hence, calling `stream` won't have any effect until the returned function is called. + */ function stream( argv: string[], options: TStreamOptions = {} @@ -89,6 +94,7 @@ function stream( }; } +/** @hidden */ function getChild(name: string, children: IChild[]): IChild { const matches = children.filter((child) => child.matcher(name)); if (matches.length > 1) throw Error(`Several scopes matched name "${name}"`); diff --git a/src/public/kpo/list.ts b/src/public/kpo/list.ts index 77e4439..bef7711 100644 --- a/src/public/kpo/list.ts +++ b/src/public/kpo/list.ts @@ -39,6 +39,7 @@ function list(options: IListOptions = {}): () => Promise { }; } +/** @hidden */ export function fromTasks(tasks: ITasks): string { let str = ''; @@ -61,6 +62,7 @@ export function fromTasks(tasks: ITasks): string { return str; } +/** @hidden */ export async function fromScopes(): Promise { const cwd = await core.cwd(); const root = await core.root(); diff --git a/src/public/kpo/options.ts b/src/public/kpo/options.ts index b44144c..4228d9e 100644 --- a/src/public/kpo/options.ts +++ b/src/public/kpo/options.ts @@ -2,6 +2,9 @@ import { options as _options } from '~/core'; import { IScopeOptions } from '~/types'; import { wrap } from '~/utils/errors'; +/** + * Programmatically sets *kpo* options. + */ export default function options(opts: IScopeOptions): void { return wrap.throws(() => _options.setScope(opts)); }