Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix config manifest type #973

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions packages/wxt/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -830,19 +830,21 @@ export type ResolvedPerBrowserOptions<T, TOmitted extends keyof T = never> = {
* Manifest customization available in the `wxt.config.ts` file. You cannot configure entrypoints
* here, they are configured inline.
*/
export type UserManifest = Partial<
Omit<
chrome.runtime.ManifestV3,
export type UserManifest = {
[key in keyof chrome.runtime.ManifestV3 as key extends
| 'action'
| 'background'
| 'chrome_url_overrides'
| 'devtools_page'
| 'manifest_version'
| 'options_page'
| 'options_ui'
| 'permissions'
| 'sandbox'
>
> & {
| 'web_accessible_resources'
? never
: key]?: chrome.runtime.ManifestV3[key];
} & {
// Add any Browser-specific or MV2 properties that WXT supports here
action?: chrome.runtime.ManifestV3['action'] & {
browser_style?: boolean;
Expand All @@ -869,6 +871,13 @@ export type UserManifest = Partial<
strict_max_version?: string;
};
};
permissions?: (
| chrome.runtime.ManifestPermissions
| (string & Record<never, never>)
)[];
web_accessible_resources?:
| string[]
| chrome.runtime.ManifestV3['web_accessible_resources'];
};

export type UserManifestFn = (
Expand Down