Skip to content

Commit

Permalink
docs: improves tsdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
rafamel committed May 1, 2019
1 parent 0494c93 commit 55541aa
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/public/exec/stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down Expand Up @@ -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}"`);
Expand Down
2 changes: 2 additions & 0 deletions src/public/kpo/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ function list(options: IListOptions = {}): () => Promise<void> {
};
}

/** @hidden */
export function fromTasks(tasks: ITasks): string {
let str = '';

Expand All @@ -61,6 +62,7 @@ export function fromTasks(tasks: ITasks): string {
return str;
}

/** @hidden */
export async function fromScopes(): Promise<string> {
const cwd = await core.cwd();
const root = await core.root();
Expand Down
3 changes: 3 additions & 0 deletions src/public/kpo/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

0 comments on commit 55541aa

Please sign in to comment.