From 7dffc69add75294e173b250d4fc9b2b96728d0c5 Mon Sep 17 00:00:00 2001 From: Oleg Valter Date: Sat, 10 Jul 2021 10:28:07 +0300 Subject: [PATCH] added type for common @run-at header options --- .github/workflows/release.yml | 2 +- package.json | 2 +- src/generators.ts | 11 ++++------- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d7b05d0..feb1585 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,5 +13,5 @@ jobs: - uses: actions/checkout@v2 - uses: "marvinpinto/action-automatic-releases@latest" with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" + repo_token: "${{ secrets.PAT }}" prerelease: false diff --git a/package.json b/package.json index c74d356..4cce089 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@userscripters/generate-headers", - "version": "1.6.2", + "version": "1.6.4", "description": "Userscript manager header generator", "icon": "", "scripts": { diff --git a/src/generators.ts b/src/generators.ts index 46855c9..277608b 100644 --- a/src/generators.ts +++ b/src/generators.ts @@ -31,6 +31,8 @@ export type GrantOptions = type CommonGrants = "none"; +type CommonRunAt = "document-start" | "document-end" | "document-idle"; + /** {@link https://wiki.greasespot.net/@grant} */ export type GreasemonkeyGrants = | CommonGrants @@ -76,7 +78,7 @@ type CustomHeaders = { contributors: string }; type GreasemonkeyHeaders = CustomHeaders & CommonHeaders<{ "grant": GreasemonkeyGrants[]; - "run-at": "document-start" | "document-end" | "document-idle"; + "run-at": CommonRunAt; }>; type TampermonkeyHeaders = CustomHeaders & @@ -94,12 +96,7 @@ type TampermonkeyHeaders = CustomHeaders & "downloadURL": string; "supportURL": string; "connect": string[]; - "run-at": - | "context-menu" - | "document-start" - | "document-body" - | "document-end" - | "document-idle"; + "run-at": CommonRunAt | "context-menu" | "document-body"; "grant": TampermonkeyGrants[]; "antifeature": `${"ads" | "tracking" | "miner"} ${string}`[]; "unwrap": "";