summaryrefslogtreecommitdiff
path: root/packages/frontend/src/nirax.ts
diff options
context:
space:
mode:
authorかっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>2024-10-31 13:46:42 +0900
committerGitHub <noreply@github.com>2024-10-31 13:46:42 +0900
commit17d9aca5a7ec6149a8dbf0c1607c81ab188e7015 (patch)
tree78752526e76f518be29ebe5bdbd0176cd2087796 /packages/frontend/src/nirax.ts
parentfix(frontend): 一部のノート表示で設定にかかわらずセンシ... (diff)
downloadsharkey-17d9aca5a7ec6149a8dbf0c1607c81ab188e7015.tar.gz
sharkey-17d9aca5a7ec6149a8dbf0c1607c81ab188e7015.tar.bz2
sharkey-17d9aca5a7ec6149a8dbf0c1607c81ab188e7015.zip
refactor(frontend): asとanyをすぐなおせる範囲で除去 (#14848)
* refactor(frontend): できるだけanyを除去 * refactor * lint * fix * remove unused * Update packages/frontend/src/components/MkReactionsViewer.details.vue * Update packages/frontend/src/components/MkUsersTooltip.vue --------- Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
Diffstat (limited to 'packages/frontend/src/nirax.ts')
-rw-r--r--packages/frontend/src/nirax.ts12
1 files changed, 7 insertions, 5 deletions
diff --git a/packages/frontend/src/nirax.ts b/packages/frontend/src/nirax.ts
index 25f853453a..965bd6f0bc 100644
--- a/packages/frontend/src/nirax.ts
+++ b/packages/frontend/src/nirax.ts
@@ -36,6 +36,8 @@ interface RouteDefWithRedirect extends RouteDefBase {
export type RouteDef = RouteDefWithComponent | RouteDefWithRedirect;
+export type RouterFlag = 'forcePage';
+
type ParsedPath = (string | {
name: string;
startsWith?: string;
@@ -107,7 +109,7 @@ export interface IRouter extends EventEmitter<RouterEvent> {
current: Resolved;
currentRef: ShallowRef<Resolved>;
currentRoute: ShallowRef<RouteDef>;
- navHook: ((path: string, flag?: any) => boolean) | null;
+ navHook: ((path: string, flag?: RouterFlag) => boolean) | null;
/**
* ルートの初期化(eventListenerの定義後に必ず呼び出すこと)
@@ -116,11 +118,11 @@ export interface IRouter extends EventEmitter<RouterEvent> {
resolve(path: string): Resolved | null;
- getCurrentPath(): any;
+ getCurrentPath(): string;
getCurrentKey(): string;
- push(path: string, flag?: any): void;
+ push(path: string, flag?: RouterFlag): void;
replace(path: string, key?: string | null): void;
@@ -197,7 +199,7 @@ export class Router extends EventEmitter<RouterEvent> implements IRouter {
private currentKey = Date.now().toString();
private redirectCount = 0;
- public navHook: ((path: string, flag?: any) => boolean) | null = null;
+ public navHook: ((path: string, flag?: RouterFlag) => boolean) | null = null;
constructor(routes: Router['routes'], currentPath: Router['currentPath'], isLoggedIn: boolean, notFoundPageComponent: Component) {
super();
@@ -404,7 +406,7 @@ export class Router extends EventEmitter<RouterEvent> implements IRouter {
return this.currentKey;
}
- public push(path: string, flag?: any) {
+ public push(path: string, flag?: RouterFlag) {
const beforePath = this.currentPath;
if (path === beforePath) {
this.emit('same');