Fix various minor typescript errors

This commit is contained in:
Oliver Blanthorn 2021-05-01 14:25:38 +02:00
parent 4e50ab4866
commit afda42e7f9
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3
3 changed files with 10 additions and 6 deletions

View file

@ -29,7 +29,7 @@ export abstract class CompletionOption {
/** What to fill into cmdline */
value: string
/** Control presentation of the option */
state: OptionState
abstract state: OptionState
}
export abstract class CompletionSource {
@ -94,7 +94,7 @@ export abstract class CompletionSource {
/** Update [[node]] to display completions relevant to exstr */
public abstract filter(exstr: string): Promise<void>
abstract async next(inc?: number): Promise<boolean>
abstract next(inc?: number): Promise<boolean>
}
// Default classes

View file

@ -402,8 +402,8 @@ interface Hintables {
export function hintPage(
hintableElements: Hintables[],
onSelect: HintSelectedCallback,
resolve = () => {}, // eslint-disable-line @typescript-eslint/no-empty-function
reject = () => {}, // eslint-disable-line @typescript-eslint/no-empty-function
resolve: (x?) => void = () => {}, // eslint-disable-line @typescript-eslint/no-empty-function
reject: (x?) => void = () => {}, // eslint-disable-line @typescript-eslint/no-empty-function
rapid = false,
) {
const buildHints: HintBuilder = defaultHintBuilder()

View file

@ -3274,7 +3274,7 @@ export async function fillcmdline_tmp(ms: number, ...strarr: string[]) {
const str = strarr.join(" ")
showcmdline(false)
Messaging.messageOwnTab("commandline_frame", "fillcmdline", [strarr.join(" "), false, false])
return new Promise(resolve =>
return new Promise<void>(resolve =>
setTimeout(async () => {
if ((await Messaging.messageOwnTab("commandline_frame", "getContent", [])) === str) {
CommandLineContent.hide_and_blur()
@ -4762,7 +4762,11 @@ export function buildFilterConfigs(filters: string[]): Perf.StatsFilterConfig[]
} else if (filter === ":measure") {
return { kind: "eventType", eventType: "measure" }
} else {
return { kind: "functionName", functionName: name }
// This used to say `functionName: name`
// which didn't seem to exist anywhere
//
// So at least we return something now
return { kind: "functionName", functionName: filter }
}
},
)