Skip to content

Commit

Permalink
Add actions field to manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
Exidex committed Mar 27, 2024
1 parent d978c35 commit c818930
Showing 1 changed file with 107 additions and 0 deletions.
107 changes: 107 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,113 @@ const Manifest = z.strictObject({
path: z.string(),
type: z.enum(["command", "view", "inline-view", "command-generator"]),
preferences: z.optional(z.array(preferences)),
actions: z.optional(z.array(z.strictObject({
id: z.string(),
description: z.string(),
shortcut: z.strictObject({
key: z.enum([ // only stuff that is present on 60% keyboard
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"0",
"-",
"=",

"!",
"@",
"#",
"$",
"%",
"^",
"&",
"*",
"(",
")",
"_",
"+",

"a",
"b",
"c",
"d",
"e",
"f",
"g",
"h",
"i",
"j",
"k",
"l",
"m",
"n",
"o",
"p",
"q",
"r",
"s",
"t",
"u",
"v",
"w",
"x",
"y",
"z",

"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
"L",
"M",
"N",
"O",
"P",
"Q",
"R",
"S",
"T",
"U",
"V",
"W",
"X",
"Y",
"Z",

",",
".",
"/",
"[",
"]",
";",
"'",
"\\",

"<",
">",
"?",
"{",
"}",
":",
"\"",
"|"
]),
kind: z.enum(["main", "alternative"]),
})
}))
)
})).refine(
entrypoints => entrypoints.filter(value => value.type === "inline-view").length <= 1,
{ message: "Only single 'inline-view' entrypoint is allowed" }
Expand Down

0 comments on commit c818930

Please sign in to comment.