adobe / adobe/cc-ext-uxp-types

Fix Setup Types

Open
#5 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
No language data
Stars
15
Forks
5
PR merge metrics
No merged PRs in 30d

Description

Setup Types need to be corrected so that:
- Panels and Commands should be keyed by string values (e.g. the id)
- All methods are optional
- menuItems has all optional parameters
- Additionally argument types need to be specified.

Here is an example of what it should look like:

```ts
setup(entrypoints: {
plugin?: {
create?: (...params: any[]) => any;
destroy?: (...params: any[]) => any;
};
panels?: {
[key:string]:{
create?: (rootNode: HTMLElement) => any;
show?: (rootNode: HTMLElement, data: any) => any;
hide?: (rootNode: HTMLElement, data: any) => any;
destroy?: (rootNode: HTMLElement) => any;
invokeMenu?: (id: string) => any;
customEntrypoint?: (...params: any[]) => any;
menuItems?: {
id: string;
label: string;
enabled?: boolean;
checked?: boolean;
submenu?: any[];
}[];
};
};
commands?: {
[key:string]:{
run: (...params: any[]) => any;
cancel?: (...params: any[]) => any;
};
};
}): void;
```

Contributor guide

Open the contributing guide

Research direction

Start by locating the TypeScript declaration for the setup entrypoint and inspect the existing Panels, Commands, and menuItems types. Update the declarations to match the example: string-keyed entries, optional methods and menu parameters, and specified argument types; done means the setup signature matches these requirements and type-checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, developer-experience
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.