Skip to content

Commit 00959d2

Browse files
author
Akos Kitta
committed
Lib search API
Signed-off-by: Akos Kitta <[email protected]>
1 parent 34a7fdb commit 00959d2

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

arduino-ide-extension/src/common/protocol/library-service.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export interface LibraryService
88
extends Installable<LibraryPackage>,
99
Searchable<LibraryPackage> {
1010
list(options: LibraryService.List.Options): Promise<LibraryPackage[]>;
11+
search(options: LibrarySearch): Promise<LibraryPackage[]>;
1112
/**
1213
* When `installDependencies` is not set, it is `true` by default. If you want to skip the installation of required dependencies, set it to `false`.
1314
*/
@@ -38,6 +39,38 @@ export interface LibraryService
3839
}): Promise<LibraryDependency[]>;
3940
}
4041

42+
export interface LibrarySearch extends Searchable.Options {
43+
readonly type?: LibrarySearch.Type;
44+
readonly topic?: LibrarySearch.Topic;
45+
}
46+
export namespace LibrarySearch {
47+
export const TypeLiterals = [
48+
'All',
49+
'Updatable',
50+
'Installed',
51+
'Arduino',
52+
'Partner',
53+
'Recommended',
54+
'Contributed',
55+
'Retired',
56+
] as const;
57+
export type Type = typeof TypeLiterals[number];
58+
export const TopicLiterals = [
59+
'All',
60+
'Communication',
61+
'Data Processing',
62+
'Data Storage',
63+
'Device Control',
64+
'Display',
65+
'Others',
66+
'Sensors',
67+
'Signal Input/Output',
68+
'Timing',
69+
'Uncategorized',
70+
];
71+
export type Topic = typeof TopicLiterals[number];
72+
}
73+
4174
export namespace LibraryService {
4275
export namespace List {
4376
export interface Options {

0 commit comments

Comments
 (0)