-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
04082df
commit ec91ffc
Showing
22 changed files
with
620 additions
and
1,525 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import {MultiStageOutput} from '../src/components/multi-stage-output.js' | ||
|
||
const SLEEP_TIME = Number.parseInt(process.env.SLEEP ?? '100', 10) ?? 100 | ||
|
||
async function sleep(ms: number): Promise<void> { | ||
return new Promise((resolve) => { | ||
setTimeout(resolve, ms) | ||
}) | ||
} | ||
|
||
const ms = new MultiStageOutput({ | ||
jsonEnabled: false, | ||
stages: ['one', 'two', 'three'], | ||
title: 'Example', | ||
}) | ||
|
||
ms.goto('one') | ||
await sleep(SLEEP_TIME) | ||
|
||
ms.goto('two') | ||
await sleep(SLEEP_TIME) | ||
|
||
ms.goto('three') | ||
await sleep(SLEEP_TIME) | ||
|
||
ms.stop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {MultiStageOutput} from '../src/components/multi-stage-output.js' | ||
|
||
const SLEEP_TIME = Number.parseInt(process.env.SLEEP ?? '100', 10) ?? 100 | ||
|
||
async function sleep(ms: number): Promise<void> { | ||
return new Promise((resolve) => { | ||
setTimeout(resolve, ms) | ||
}) | ||
} | ||
|
||
const ms = new MultiStageOutput({ | ||
jsonEnabled: false, | ||
stages: ['one', 'two', 'three'], | ||
title: 'Example', | ||
}) | ||
|
||
ms.goto('one') | ||
await sleep(SLEEP_TIME) | ||
|
||
ms.goto('two') | ||
await sleep(SLEEP_TIME) | ||
|
||
ms.stop(new Error('An error occurred')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import {MultiStageOutput} from '../src/components/multi-stage-output.js' | ||
|
||
const SLEEP_TIME = Number.parseInt(process.env.SLEEP ?? '100', 10) ?? 100 | ||
|
||
async function sleep(ms: number): Promise<void> { | ||
return new Promise((resolve) => { | ||
setTimeout(resolve, ms) | ||
}) | ||
} | ||
|
||
const ms = new MultiStageOutput<{message: string; staticValue: string; dynamicValue: string}>({ | ||
jsonEnabled: false, | ||
postStagesBlock: [ | ||
{ | ||
get: (data) => data?.message, | ||
type: 'message', | ||
}, | ||
{ | ||
get: (data) => data?.staticValue, | ||
label: 'Static', | ||
type: 'static-key-value', | ||
}, | ||
{ | ||
get: (data) => data?.dynamicValue, | ||
label: 'Dynamic', | ||
type: 'dynamic-key-value', | ||
}, | ||
], | ||
stages: ['one', 'two', 'three'], | ||
title: 'Example', | ||
}) | ||
|
||
ms.goto('one', {message: 'This is a message', staticValue: 'This is a static key:value pair'}) | ||
await sleep(SLEEP_TIME) | ||
|
||
ms.goto('two', {dynamicValue: 'This is a dynamic key:value pair'}) | ||
await sleep(SLEEP_TIME) | ||
|
||
ms.goto('three') | ||
await sleep(SLEEP_TIME) | ||
|
||
ms.stop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import {MultiStageOutput} from '../src/components/multi-stage-output.js' | ||
|
||
const SLEEP_TIME = Number.parseInt(process.env.SLEEP ?? '100', 10) ?? 100 | ||
|
||
async function sleep(ms: number): Promise<void> { | ||
return new Promise((resolve) => { | ||
setTimeout(resolve, ms) | ||
}) | ||
} | ||
|
||
const ms = new MultiStageOutput<{message: string; staticValue: string; dynamicValue: string}>({ | ||
jsonEnabled: false, | ||
preStagesBlock: [ | ||
{ | ||
get: (data) => data?.message, | ||
type: 'message', | ||
}, | ||
{ | ||
get: (data) => data?.staticValue, | ||
label: 'Static', | ||
type: 'static-key-value', | ||
}, | ||
{ | ||
get: (data) => data?.dynamicValue, | ||
label: 'Dynamic', | ||
type: 'dynamic-key-value', | ||
}, | ||
], | ||
stages: ['one', 'two', 'three'], | ||
title: 'Example', | ||
}) | ||
|
||
ms.goto('one', {message: 'This is a message', staticValue: 'This is a static key:value pair'}) | ||
await sleep(SLEEP_TIME) | ||
|
||
ms.goto('two', {dynamicValue: 'This is a dynamic key:value pair'}) | ||
await sleep(SLEEP_TIME) | ||
|
||
ms.goto('three') | ||
await sleep(SLEEP_TIME) | ||
|
||
ms.stop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {MultiStageOutput} from '../src/components/multi-stage-output.js' | ||
|
||
const SLEEP_TIME = Number.parseInt(process.env.SLEEP ?? '100', 10) ?? 100 | ||
|
||
async function sleep(ms: number): Promise<void> { | ||
return new Promise((resolve) => { | ||
setTimeout(resolve, ms) | ||
}) | ||
} | ||
|
||
const ms = new MultiStageOutput({ | ||
jsonEnabled: false, | ||
stages: ['one', 'two', 'three'], | ||
title: 'Example', | ||
}) | ||
|
||
ms.goto('one') | ||
await sleep(SLEEP_TIME) | ||
|
||
ms.goto('three') | ||
await sleep(SLEEP_TIME) | ||
|
||
ms.stop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import {MultiStageOutput} from '../src/components/multi-stage-output.js' | ||
|
||
const SLEEP_TIME = Number.parseInt(process.env.SLEEP ?? '100', 10) ?? 100 | ||
|
||
async function sleep(ms: number): Promise<void> { | ||
return new Promise((resolve) => { | ||
setTimeout(resolve, ms) | ||
}) | ||
} | ||
|
||
const ms = new MultiStageOutput<{message: string; staticValue: string; dynamicValue: string}>({ | ||
jsonEnabled: false, | ||
stageSpecificBlock: [ | ||
{ | ||
get: (data) => data?.message, | ||
stage: 'one', | ||
type: 'message', | ||
}, | ||
{ | ||
get: (data) => data?.staticValue, | ||
label: 'Static', | ||
stage: 'two', | ||
type: 'static-key-value', | ||
}, | ||
{ | ||
get: (data) => data?.dynamicValue, | ||
label: 'Dynamic', | ||
stage: 'one', | ||
type: 'dynamic-key-value', | ||
}, | ||
], | ||
stages: ['one', 'two', 'three'], | ||
title: 'Example', | ||
}) | ||
|
||
ms.goto('one', {message: 'This is a message', staticValue: 'This is a static key:value pair'}) | ||
await sleep(SLEEP_TIME) | ||
|
||
ms.goto('two', {dynamicValue: 'This is a dynamic key:value pair'}) | ||
await sleep(SLEEP_TIME) | ||
|
||
ms.goto('three') | ||
await sleep(SLEEP_TIME) | ||
|
||
ms.stop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.