Skip to content

Commit e31abde

Browse files
committed
chore: add types for numerous and time-delta
1 parent d1061ec commit e31abde

File tree

3 files changed

+47
-34
lines changed

3 files changed

+47
-34
lines changed

src/main.ts

Lines changed: 28 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,50 @@
11
#!/usr/bin/env node
22
/* eslint-disable node/shebang */
33

4-
import { getInput, endGroup, startGroup, notice } from "@actions/core"
4+
import { endGroup, getInput, notice, startGroup } from "@actions/core"
5+
import ciDetect from "@npmcli/ci-detect"
6+
import { error, info, success, warning } from "ci-log"
7+
import mri from "mri"
8+
import * as numerous from "numerous"
9+
import numerousLocale from "numerous/locales/en.js"
10+
import { join } from "patha"
11+
import semverValid from "semver/functions/valid"
12+
import * as timeDelta from "time-delta"
13+
import timeDeltaLocale from "time-delta/locales/en.js"
14+
import { untildifyUser } from "untildify-user"
15+
16+
import { setupBazel } from "./bazel/bazel"
517
import { setupBrew } from "./brew/brew"
618
import { setupCcache } from "./ccache/ccache"
7-
import { setupMake } from "./make/make"
8-
import { setupTask } from "./task/task"
919
import { setupChocolatey } from "./chocolatey/chocolatey"
1020
import { setupCmake } from "./cmake/cmake"
1121
import { setupConan } from "./conan/conan"
1222
import { setupCppcheck } from "./cppcheck/cppcheck"
1323
import { setupDoxygen } from "./doxygen/doxygen"
24+
import { setupGcc } from "./gcc/gcc"
1425
import { activateGcovGCC, activateGcovLLVM, setupGcovr } from "./gcovr/gcovr"
15-
import { setupLLVM, setupClangTools } from "./llvm/llvm"
26+
import { setupGraphviz } from "./graphviz/graphviz"
27+
import { setupKcov } from "./kcov/kcov"
28+
import { setupClangTools, setupLLVM } from "./llvm/llvm"
29+
import { setupMake } from "./make/make"
1630
import { setupMeson } from "./meson/meson"
1731
import { setupMSVC } from "./msvc/msvc"
32+
import { setupNala } from "./nala/nala"
1833
import { setupNinja } from "./ninja/ninja"
1934
import { setupOpencppcoverage } from "./opencppcoverage/opencppcoverage"
35+
import { setupPowershell } from "./powershell/powershell"
2036
import { setupPython } from "./python/python"
21-
import mri from "mri"
22-
import { untildifyUser } from "untildify-user"
23-
import ciDetect from "@npmcli/ci-detect"
24-
import * as timeDelta from "time-delta"
25-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
26-
// @ts-ignore
27-
import timeDeltaLocale from "time-delta/locales/en.js"
28-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
29-
// @ts-ignore
30-
import * as numerous from "numerous"
31-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
32-
// @ts-ignore
33-
import numerousLocale from "numerous/locales/en.js"
37+
import { setupSccache } from "./sccache/sccache"
38+
import { setupSevenZip } from "./sevenzip/sevenzip"
39+
import { setupTask } from "./task/task"
40+
import { addEnv, finalizeCpprc } from "./utils/env/addEnv"
41+
import { isArch } from "./utils/env/isArch"
3442
import { ubuntuVersion } from "./utils/env/ubuntu_version"
35-
36-
import semverValid from "semver/functions/valid"
37-
import { getVersion, syncVersions } from "./versions/versions"
38-
import { setupGcc } from "./gcc/gcc"
3943
import { InstallationInfo } from "./utils/setup/setupBin"
40-
import { error, info, success, warning } from "ci-log"
44+
import { setupPacmanPack } from "./utils/setup/setupPacmanPack"
4145
import { setupVcpkg } from "./vcpkg/vcpkg"
42-
import { join } from "patha"
4346
import { setupVCVarsall } from "./vcvarsall/vcvarsall"
44-
import { setupKcov } from "./kcov/kcov"
45-
import { addEnv, finalizeCpprc } from "./utils/env/addEnv"
46-
import { setupSevenZip } from "./sevenzip/sevenzip"
47-
import { setupGraphviz } from "./graphviz/graphviz"
48-
import { setupNala } from "./nala/nala"
49-
import { setupBazel } from "./bazel/bazel"
50-
import { setupPowershell } from "./powershell/powershell"
51-
import { isArch } from "./utils/env/isArch"
52-
import { setupPacmanPack } from "./utils/setup/setupPacmanPack"
53-
import { setupSccache } from "./sccache/sccache"
47+
import { getVersion, syncVersions } from "./versions/versions"
5448

5549
/** The setup functions */
5650
const setups = {
@@ -119,7 +113,7 @@ export async function main(args: string[]): Promise<number> {
119113

120114
const timeFormatter = timeDelta.create({ autoloadLocales: true })
121115
timeDelta.addLocale(timeDeltaLocale as timeDelta.Locale)
122-
numerous.addLocale(numerousLocale)
116+
numerous.addLocale(numerousLocale as numerous.Locale)
123117
let time1: number
124118
let time2: number
125119

src/types/numerous.d.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
declare module "numerous" {
2+
export type Locale = unknown
3+
4+
/** Adds pluralization data for the specified locale. Should be called in browser. */
5+
export function addLocale(localeData: Locale | Locale[])
6+
}
7+
8+
declare module "numerous/locales/en.js" {
9+
import { Locale } from "numerous"
10+
11+
declare const En = Locale
12+
export = En
13+
}

src/types/time-delta.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
declare module "time-delta/locales/en.js" {
2+
import { Locale } from "time-delta"
3+
4+
declare const En = Locale
5+
export = En
6+
}

0 commit comments

Comments
 (0)