track-cli 3.0.0-rc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +7 -0
- package/README.md +3 -0
- package/esm/_dnt.polyfills.d.ts +6 -0
- package/esm/_dnt.polyfills.js +1 -0
- package/esm/_dnt.shims.d.ts +19 -0
- package/esm/_dnt.shims.js +78 -0
- package/esm/deps/deno.land/std@0.170.0/fmt/colors.d.ts +270 -0
- package/esm/deps/deno.land/std@0.170.0/fmt/colors.js +473 -0
- package/esm/deps/deno.land/std@0.195.0/_util/os.d.ts +4 -0
- package/esm/deps/deno.land/std@0.195.0/_util/os.js +18 -0
- package/esm/deps/deno.land/std@0.195.0/assert/assert.d.ts +2 -0
- package/esm/deps/deno.land/std@0.195.0/assert/assert.js +8 -0
- package/esm/deps/deno.land/std@0.195.0/assert/assertion_error.d.ts +4 -0
- package/esm/deps/deno.land/std@0.195.0/assert/assertion_error.js +12 -0
- package/esm/deps/deno.land/std@0.195.0/datetime/_common.d.ts +50 -0
- package/esm/deps/deno.land/std@0.195.0/datetime/_common.js +545 -0
- package/esm/deps/deno.land/std@0.195.0/datetime/constants.d.ts +55 -0
- package/esm/deps/deno.land/std@0.195.0/datetime/constants.js +57 -0
- package/esm/deps/deno.land/std@0.195.0/datetime/day_of_year.d.ts +26 -0
- package/esm/deps/deno.land/std@0.195.0/datetime/day_of_year.js +45 -0
- package/esm/deps/deno.land/std@0.195.0/datetime/difference.d.ts +38 -0
- package/esm/deps/deno.land/std@0.195.0/datetime/difference.js +93 -0
- package/esm/deps/deno.land/std@0.195.0/datetime/format.d.ts +22 -0
- package/esm/deps/deno.land/std@0.195.0/datetime/format.js +28 -0
- package/esm/deps/deno.land/std@0.195.0/datetime/is_leap.d.ts +49 -0
- package/esm/deps/deno.land/std@0.195.0/datetime/is_leap.js +60 -0
- package/esm/deps/deno.land/std@0.195.0/datetime/mod.d.ts +43 -0
- package/esm/deps/deno.land/std@0.195.0/datetime/mod.js +45 -0
- package/esm/deps/deno.land/std@0.195.0/datetime/parse.d.ts +21 -0
- package/esm/deps/deno.land/std@0.195.0/datetime/parse.js +29 -0
- package/esm/deps/deno.land/std@0.195.0/datetime/to_imf.d.ts +17 -0
- package/esm/deps/deno.land/std@0.195.0/datetime/to_imf.js +44 -0
- package/esm/deps/deno.land/std@0.195.0/datetime/week_of_year.d.ts +13 -0
- package/esm/deps/deno.land/std@0.195.0/datetime/week_of_year.js +38 -0
- package/esm/deps/deno.land/std@0.195.0/fmt/colors.d.ts +270 -0
- package/esm/deps/deno.land/std@0.195.0/fmt/colors.js +474 -0
- package/esm/deps/deno.land/std@0.195.0/fmt/duration.d.ts +15 -0
- package/esm/deps/deno.land/std@0.195.0/fmt/duration.js +96 -0
- package/esm/deps/deno.land/std@0.195.0/fs/_util.d.ts +35 -0
- package/esm/deps/deno.land/std@0.195.0/fs/_util.js +80 -0
- package/esm/deps/deno.land/std@0.195.0/fs/copy.d.ts +51 -0
- package/esm/deps/deno.land/std@0.195.0/fs/copy.js +244 -0
- package/esm/deps/deno.land/std@0.195.0/fs/empty_dir.d.ts +31 -0
- package/esm/deps/deno.land/std@0.195.0/fs/empty_dir.js +74 -0
- package/esm/deps/deno.land/std@0.195.0/fs/ensure_dir.d.ts +27 -0
- package/esm/deps/deno.land/std@0.195.0/fs/ensure_dir.js +55 -0
- package/esm/deps/deno.land/std@0.195.0/fs/ensure_file.d.ts +33 -0
- package/esm/deps/deno.land/std@0.195.0/fs/ensure_file.js +75 -0
- package/esm/deps/deno.land/std@0.195.0/fs/ensure_link.d.ts +31 -0
- package/esm/deps/deno.land/std@0.195.0/fs/ensure_link.js +43 -0
- package/esm/deps/deno.land/std@0.195.0/fs/ensure_symlink.d.ts +17 -0
- package/esm/deps/deno.land/std@0.195.0/fs/ensure_symlink.js +68 -0
- package/esm/deps/deno.land/std@0.195.0/fs/eol.d.ts +40 -0
- package/esm/deps/deno.land/std@0.195.0/fs/eol.js +53 -0
- package/esm/deps/deno.land/std@0.195.0/fs/exists.d.ts +102 -0
- package/esm/deps/deno.land/std@0.195.0/fs/exists.js +163 -0
- package/esm/deps/deno.land/std@0.195.0/fs/expand_glob.d.ts +37 -0
- package/esm/deps/deno.land/std@0.195.0/fs/expand_glob.js +216 -0
- package/esm/deps/deno.land/std@0.195.0/fs/mod.d.ts +16 -0
- package/esm/deps/deno.land/std@0.195.0/fs/mod.js +17 -0
- package/esm/deps/deno.land/std@0.195.0/fs/move.d.ts +29 -0
- package/esm/deps/deno.land/std@0.195.0/fs/move.js +88 -0
- package/esm/deps/deno.land/std@0.195.0/fs/walk.d.ts +40 -0
- package/esm/deps/deno.land/std@0.195.0/fs/walk.js +158 -0
- package/esm/deps/deno.land/std@0.195.0/path/_constants.d.ts +39 -0
- package/esm/deps/deno.land/std@0.195.0/path/_constants.js +46 -0
- package/esm/deps/deno.land/std@0.195.0/path/_interface.d.ts +26 -0
- package/esm/deps/deno.land/std@0.195.0/path/_interface.js +3 -0
- package/esm/deps/deno.land/std@0.195.0/path/_util.d.ts +11 -0
- package/esm/deps/deno.land/std@0.195.0/path/_util.js +161 -0
- package/esm/deps/deno.land/std@0.195.0/path/common.d.ts +13 -0
- package/esm/deps/deno.land/std@0.195.0/path/common.js +36 -0
- package/esm/deps/deno.land/std@0.195.0/path/glob.d.ts +83 -0
- package/esm/deps/deno.land/std@0.195.0/path/glob.js +361 -0
- package/esm/deps/deno.land/std@0.195.0/path/mod.d.ts +9 -0
- package/esm/deps/deno.land/std@0.195.0/path/mod.js +33 -0
- package/esm/deps/deno.land/std@0.195.0/path/posix.d.ts +86 -0
- package/esm/deps/deno.land/std@0.195.0/path/posix.js +442 -0
- package/esm/deps/deno.land/std@0.195.0/path/separator.d.ts +2 -0
- package/esm/deps/deno.land/std@0.195.0/path/separator.js +5 -0
- package/esm/deps/deno.land/std@0.195.0/path/win32.d.ts +91 -0
- package/esm/deps/deno.land/std@0.195.0/path/win32.js +909 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/_utils/distance.d.ts +1 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/_utils/distance.js +26 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/_errors.d.ts +76 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/_errors.js +154 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/_utils.d.ts +32 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/_utils.js +105 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/command.d.ts +831 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/command.js +1701 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/completions/_bash_completions_generator.d.ts +17 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/completions/_bash_completions_generator.js +201 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/completions/_fish_completions_generator.d.ts +14 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/completions/_fish_completions_generator.js +141 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/completions/_zsh_completions_generator.d.ts +21 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/completions/_zsh_completions_generator.js +285 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/completions/bash.d.ts +6 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/completions/bash.js +38 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/completions/complete.d.ts +8 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/completions/complete.js +32 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/completions/fish.d.ts +6 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/completions/fish.js +38 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/completions/mod.d.ts +6 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/completions/mod.js +46 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/completions/zsh.d.ts +6 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/completions/zsh.js +38 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/deprecated.d.ts +45 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/deprecated.js +2 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/deps.d.ts +1 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/deps.js +1 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/help/_help_generator.d.ts +27 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/help/_help_generator.js +323 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/help/mod.d.ts +6 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/help/mod.js +34 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/mod.d.ts +18 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/mod.js +17 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/type.d.ts +41 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/type.js +24 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/types/action_list.d.ts +9 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/types/action_list.js +20 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/types/boolean.d.ts +9 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/types/boolean.js +13 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/types/child_command.d.ts +9 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/types/child_command.js +27 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/types/command.d.ts +7 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/types/command.js +9 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/types/enum.d.ts +10 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/types/enum.js +29 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/types/file.d.ts +5 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/types/file.js +12 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/types/integer.d.ts +7 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/types/integer.js +9 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/types/number.d.ts +7 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/types/number.js +9 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/types/string.d.ts +7 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/types/string.js +9 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/types.d.ts +118 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/types.js +2 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/upgrade/mod.d.ts +5 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/upgrade/mod.js +5 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/upgrade/provider/deno_land.d.ts +14 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/upgrade/provider/deno_land.js +46 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/upgrade/provider/github.d.ts +26 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/upgrade/provider/github.js +118 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/upgrade/provider/nest_land.d.ts +14 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/upgrade/provider/nest_land.js +55 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/upgrade/provider.d.ts +27 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/upgrade/provider.js +102 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/upgrade/upgrade_command.d.ts +17 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/command/upgrade/upgrade_command.js +75 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/flags/_errors.d.ts +60 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/flags/_errors.js +117 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/flags/_utils.d.ts +18 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/flags/_utils.js +106 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/flags/_validate_flags.d.ts +10 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/flags/_validate_flags.js +157 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/flags/deprecated.d.ts +24 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/flags/deprecated.js +9 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/flags/flags.d.ts +33 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/flags/flags.js +402 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/flags/types/boolean.d.ts +3 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/flags/types/boolean.js +11 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/flags/types/integer.d.ts +3 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/flags/types/integer.js +9 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/flags/types/number.d.ts +3 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/flags/types/number.js +9 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/flags/types/string.d.ts +3 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/flags/types/string.js +4 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/flags/types.d.ts +59 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/flags/types.js +1 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/table/border.d.ts +20 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/table/border.js +18 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/table/cell.d.ts +78 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/table/cell.js +128 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/table/deps.d.ts +1 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/table/deps.js +1 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/table/layout.d.ts +99 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/table/layout.js +529 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/table/row.d.ts +49 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/table/row.js +74 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/table/table.d.ts +135 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/table/table.js +237 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/table/utils.d.ts +13 -0
- package/esm/deps/deno.land/x/cliffy@v0.25.7/table/utils.js +60 -0
- package/esm/package.json +3 -0
- package/esm/src/action/add.d.ts +1 -0
- package/esm/src/action/add.js +57 -0
- package/esm/src/action/clone.d.ts +6 -0
- package/esm/src/action/clone.js +108 -0
- package/esm/src/action/lang.d.ts +1 -0
- package/esm/src/action/lang.js +40 -0
- package/esm/src/action/pull.d.ts +1 -0
- package/esm/src/action/pull.js +22 -0
- package/esm/src/action/remove.d.ts +4 -0
- package/esm/src/action/remove.js +67 -0
- package/esm/src/action/reset.d.ts +1 -0
- package/esm/src/action/reset.js +21 -0
- package/esm/src/action/run.d.ts +4 -0
- package/esm/src/action/run.js +163 -0
- package/esm/src/action/status.d.ts +1 -0
- package/esm/src/action/status.js +5 -0
- package/esm/src/main.d.ts +2 -0
- package/esm/src/main.js +96 -0
- package/esm/src/meta.d.ts +3 -0
- package/esm/src/meta.js +51 -0
- package/esm/src/orca/client.d.ts +20 -0
- package/esm/src/orca/client.js +152 -0
- package/esm/src/orca/types.d.ts +54 -0
- package/esm/src/orca/types.js +12 -0
- package/esm/src/shared/config.d.ts +24 -0
- package/esm/src/shared/config.js +24 -0
- package/esm/src/shared/errors.d.ts +82 -0
- package/esm/src/shared/errors.js +228 -0
- package/esm/src/shared/file.d.ts +30 -0
- package/esm/src/shared/file.js +110 -0
- package/esm/src/shared/mod.d.ts +40 -0
- package/esm/src/shared/mod.js +383 -0
- package/esm/src/shared/types.d.ts +12 -0
- package/esm/src/shared/types.js +1 -0
- package/esm/src/track/client.d.ts +60 -0
- package/esm/src/track/client.js +268 -0
- package/esm/src/track/types.d.ts +210 -0
- package/esm/src/track/types.js +40 -0
- package/package.json +35 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/** Cell representation. */
|
|
2
|
+
export class Cell {
|
|
3
|
+
/** Get cell length. */
|
|
4
|
+
get length() {
|
|
5
|
+
return this.toString().length;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Create a new cell. If value is a cell, the value and all options of the cell
|
|
9
|
+
* will be copied to the new cell.
|
|
10
|
+
* @param value Cell or cell value.
|
|
11
|
+
*/
|
|
12
|
+
static from(value) {
|
|
13
|
+
const cell = new this(value);
|
|
14
|
+
if (value instanceof Cell) {
|
|
15
|
+
cell.options = { ...value.options };
|
|
16
|
+
}
|
|
17
|
+
return cell;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Cell constructor.
|
|
21
|
+
* @param value Cell value.
|
|
22
|
+
*/
|
|
23
|
+
constructor(value) {
|
|
24
|
+
Object.defineProperty(this, "value", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
configurable: true,
|
|
27
|
+
writable: true,
|
|
28
|
+
value: value
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(this, "options", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
configurable: true,
|
|
33
|
+
writable: true,
|
|
34
|
+
value: {}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
/** Get cell value. */
|
|
38
|
+
toString() {
|
|
39
|
+
return this.value.toString();
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Set cell value.
|
|
43
|
+
* @param value Cell or cell value.
|
|
44
|
+
*/
|
|
45
|
+
setValue(value) {
|
|
46
|
+
this.value = value;
|
|
47
|
+
return this;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Clone cell with all options.
|
|
51
|
+
* @param value Cell or cell value.
|
|
52
|
+
*/
|
|
53
|
+
clone(value) {
|
|
54
|
+
const cell = new Cell(value ?? this);
|
|
55
|
+
cell.options = { ...this.options };
|
|
56
|
+
return cell;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Setter:
|
|
60
|
+
*/
|
|
61
|
+
/**
|
|
62
|
+
* Enable/disable cell border.
|
|
63
|
+
* @param enable Enable/disable cell border.
|
|
64
|
+
* @param override Override existing value.
|
|
65
|
+
*/
|
|
66
|
+
border(enable, override = true) {
|
|
67
|
+
if (override || typeof this.options.border === "undefined") {
|
|
68
|
+
this.options.border = enable;
|
|
69
|
+
}
|
|
70
|
+
return this;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Set col span.
|
|
74
|
+
* @param span Number of cols to span.
|
|
75
|
+
* @param override Override existing value.
|
|
76
|
+
*/
|
|
77
|
+
colSpan(span, override = true) {
|
|
78
|
+
if (override || typeof this.options.colSpan === "undefined") {
|
|
79
|
+
this.options.colSpan = span;
|
|
80
|
+
}
|
|
81
|
+
return this;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Set row span.
|
|
85
|
+
* @param span Number of rows to span.
|
|
86
|
+
* @param override Override existing value.
|
|
87
|
+
*/
|
|
88
|
+
rowSpan(span, override = true) {
|
|
89
|
+
if (override || typeof this.options.rowSpan === "undefined") {
|
|
90
|
+
this.options.rowSpan = span;
|
|
91
|
+
}
|
|
92
|
+
return this;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Align cell content.
|
|
96
|
+
* @param direction Align direction.
|
|
97
|
+
* @param override Override existing value.
|
|
98
|
+
*/
|
|
99
|
+
align(direction, override = true) {
|
|
100
|
+
if (override || typeof this.options.align === "undefined") {
|
|
101
|
+
this.options.align = direction;
|
|
102
|
+
}
|
|
103
|
+
return this;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Getter:
|
|
107
|
+
*/
|
|
108
|
+
/** Check if cell has border. */
|
|
109
|
+
getBorder() {
|
|
110
|
+
return this.options.border === true;
|
|
111
|
+
}
|
|
112
|
+
/** Get col span. */
|
|
113
|
+
getColSpan() {
|
|
114
|
+
return typeof this.options.colSpan === "number" && this.options.colSpan > 0
|
|
115
|
+
? this.options.colSpan
|
|
116
|
+
: 1;
|
|
117
|
+
}
|
|
118
|
+
/** Get row span. */
|
|
119
|
+
getRowSpan() {
|
|
120
|
+
return typeof this.options.rowSpan === "number" && this.options.rowSpan > 0
|
|
121
|
+
? this.options.rowSpan
|
|
122
|
+
: 1;
|
|
123
|
+
}
|
|
124
|
+
/** Get row span. */
|
|
125
|
+
getAlign() {
|
|
126
|
+
return this.options.align ?? "left";
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { stripColor } from "../../../std@0.170.0/fmt/colors.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { stripColor } from "../../../std@0.170.0/fmt/colors.js";
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { Cell, ICell } from "./cell.js";
|
|
2
|
+
import { IRow, Row } from "./row.js";
|
|
3
|
+
import type { ITableSettings, Table } from "./table.js";
|
|
4
|
+
/** Layout render settings. */
|
|
5
|
+
interface IRenderSettings {
|
|
6
|
+
padding: number[];
|
|
7
|
+
width: number[];
|
|
8
|
+
columns: number;
|
|
9
|
+
hasBorder: boolean;
|
|
10
|
+
hasHeaderBorder: boolean;
|
|
11
|
+
hasBodyBorder: boolean;
|
|
12
|
+
rows: Row<Cell>[];
|
|
13
|
+
}
|
|
14
|
+
/** Table layout renderer. */
|
|
15
|
+
export declare class TableLayout {
|
|
16
|
+
#private;
|
|
17
|
+
private table;
|
|
18
|
+
private options;
|
|
19
|
+
/**
|
|
20
|
+
* Table layout constructor.
|
|
21
|
+
* @param table Table instance.
|
|
22
|
+
* @param options Render options.
|
|
23
|
+
*/
|
|
24
|
+
constructor(table: Table, options: ITableSettings);
|
|
25
|
+
/** Generate table string. */
|
|
26
|
+
toString(): string;
|
|
27
|
+
/**
|
|
28
|
+
* Generates table layout including row and col span, converts all none
|
|
29
|
+
* Cell/Row values to Cells and Rows and returns the layout rendering
|
|
30
|
+
* settings.
|
|
31
|
+
*/
|
|
32
|
+
protected createLayout(): IRenderSettings;
|
|
33
|
+
/**
|
|
34
|
+
* Fills rows and cols by specified row/col span with a reference of the
|
|
35
|
+
* original cell.
|
|
36
|
+
*/
|
|
37
|
+
protected spanRows(rows: Array<IRow>): Row<Cell>[];
|
|
38
|
+
protected getDeleteCount(rows: Array<Array<unknown>>, rowIndex: number, colIndex: number): 0 | 1;
|
|
39
|
+
/**
|
|
40
|
+
* Create a new row from existing row or cell array.
|
|
41
|
+
* @param row Original row.
|
|
42
|
+
*/
|
|
43
|
+
protected createRow(row: IRow): Row<Cell>;
|
|
44
|
+
/**
|
|
45
|
+
* Create a new cell from existing cell or cell value.
|
|
46
|
+
* @param cell Original cell.
|
|
47
|
+
* @param row Parent row.
|
|
48
|
+
*/
|
|
49
|
+
protected createCell(cell: ICell | null | undefined, row: Row): Cell;
|
|
50
|
+
/**
|
|
51
|
+
* Render table layout.
|
|
52
|
+
* @param opts Render options.
|
|
53
|
+
*/
|
|
54
|
+
protected renderRows(opts: IRenderSettings): string;
|
|
55
|
+
/**
|
|
56
|
+
* Render row.
|
|
57
|
+
* @param rowSpan Current row span.
|
|
58
|
+
* @param rowIndex Current row index.
|
|
59
|
+
* @param opts Render options.
|
|
60
|
+
* @param isMultiline Is multiline row.
|
|
61
|
+
*/
|
|
62
|
+
protected renderRow(rowSpan: number[], rowIndex: number, opts: IRenderSettings, isMultiline?: boolean): string;
|
|
63
|
+
/**
|
|
64
|
+
* Render cell.
|
|
65
|
+
* @param colIndex Current col index.
|
|
66
|
+
* @param row Current row.
|
|
67
|
+
* @param opts Render options.
|
|
68
|
+
* @param noBorder Disable border.
|
|
69
|
+
*/
|
|
70
|
+
protected renderCell(colIndex: number, row: Row<Cell>, opts: IRenderSettings, noBorder?: boolean): string;
|
|
71
|
+
/**
|
|
72
|
+
* Render specified length of cell. Returns the rendered value and a new cell
|
|
73
|
+
* with the rest value.
|
|
74
|
+
* @param cell Cell to render.
|
|
75
|
+
* @param maxLength Max length of content to render.
|
|
76
|
+
*/
|
|
77
|
+
protected renderCellValue(cell: Cell, maxLength: number): {
|
|
78
|
+
current: string;
|
|
79
|
+
next: Cell;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Render border row.
|
|
83
|
+
* @param prevRow Previous row.
|
|
84
|
+
* @param nextRow Next row.
|
|
85
|
+
* @param rowSpan Current row span.
|
|
86
|
+
* @param opts Render options.
|
|
87
|
+
*/
|
|
88
|
+
protected renderBorderRow(prevRow: Row<Cell> | undefined, nextRow: Row<Cell> | undefined, rowSpan: number[], opts: IRenderSettings): string;
|
|
89
|
+
/**
|
|
90
|
+
* Render border cell.
|
|
91
|
+
* @param colIndex Current index.
|
|
92
|
+
* @param prevRow Previous row.
|
|
93
|
+
* @param nextRow Next row.
|
|
94
|
+
* @param rowSpan Current row span.
|
|
95
|
+
* @param opts Render options.
|
|
96
|
+
*/
|
|
97
|
+
protected renderBorderCell(colIndex: number, prevRow: Row<Cell> | undefined, nextRow: Row<Cell> | undefined, rowSpan: number[], opts: IRenderSettings): string;
|
|
98
|
+
}
|
|
99
|
+
export {};
|