client: add return types to functions

This commit is contained in:
Norm 2022-09-04 19:31:11 -04:00
parent db5019d3ec
commit 19f8f095c7
Signed by untrusted user: norm
GPG key ID: 7123E30E441E80DE
3 changed files with 9 additions and 9 deletions

View file

@ -12,7 +12,7 @@ export const instance: Misskey.entities.InstanceMetadata = reactive(instanceData
// TODO: set default values // TODO: set default values
}); });
export async function fetchInstance() { export async function fetchInstance(): Promise<void> {
const meta = await api('meta', { const meta = await api('meta', {
detail: false, detail: false,
}); });

View file

@ -163,7 +163,7 @@ export class Router extends EventEmitter<{
return null; return null;
} }
private navigate(path: string, key: string | null | undefined, initial = false) { private navigate(path: string, key: string | null | undefined, initial = false): void {
const beforePath = this.currentPath; const beforePath = this.currentPath;
this.currentPath = path; this.currentPath = path;
@ -195,23 +195,23 @@ export class Router extends EventEmitter<{
} }
} }
public getCurrentComponent() { public getCurrentComponent(): Component | null {
return this.currentComponent; return this.currentComponent;
} }
public getCurrentProps() { public getCurrentProps(): Map<string, string> | null {
return this.currentProps; return this.currentProps;
} }
public getCurrentPath() { public getCurrentPath(): string {
return this.currentPath; return this.currentPath;
} }
public getCurrentKey() { public getCurrentKey(): string {
return this.currentKey; return this.currentKey;
} }
public push(path: string) { public push(path: string): void {
const beforePath = this.currentPath; const beforePath = this.currentPath;
if (path === beforePath) { if (path === beforePath) {
this.emit('same'); this.emit('same');
@ -231,7 +231,7 @@ export class Router extends EventEmitter<{
}); });
} }
public change(path: string, key?: string | null) { public change(path: string, key?: string | null): void {
this.navigate(path, key); this.navigate(path, key);
} }
} }

View file

@ -130,7 +130,7 @@ export class Storage<T extends StateDef> {
this.set(key, [...currentState, value]); this.set(key, [...currentState, value]);
} }
public reset(key: keyof T) { public reset(key: keyof T): void {
this.set(key, this.def[key].default); this.set(key, this.def[key].default);
} }