mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09:46:28 +08:00
workspace: update eslint rule (#1027)
This commit is contained in:
1 parent
05c3b8f2bd
commit
cee3c00ddb
150 files changed
+1069
-1043
No files matched your search
+114
-113
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable perfectionist/sort-exports */
|
||||
import type { AttestationFormat, CredentialDeviceType } from '@simplewebauthn/server';
|
||||
import type { ParsedAuthenticatorData } from '@simplewebauthn/server/helpers';
|
||||
import type fs from 'fs';
|
||||
@@ -16,43 +17,43 @@ export * from '@hydrooj/common/types';
|
||||
type document = typeof import('./model/document');
|
||||
|
||||
export interface System {
|
||||
_id: string,
|
||||
value: any,
|
||||
_id: string;
|
||||
value: any;
|
||||
}
|
||||
|
||||
export interface SystemKeys {
|
||||
'smtp.user': string,
|
||||
'smtp.from': string,
|
||||
'smtp.pass': string,
|
||||
'smtp.host': string,
|
||||
'smtp.port': number,
|
||||
'smtp.secure': boolean,
|
||||
'installid': string,
|
||||
'server.name': string,
|
||||
'server.url': string,
|
||||
'server.xff': string,
|
||||
'server.xhost': string,
|
||||
'server.host': string,
|
||||
'server.port': number,
|
||||
'server.language': string,
|
||||
'limit.problem_files_max': number,
|
||||
'problem.categories': string,
|
||||
'session.keys': string[],
|
||||
'session.saved_expire_seconds': number,
|
||||
'session.unsaved_expire_seconds': number,
|
||||
'user.quota': number,
|
||||
'smtp.user': string;
|
||||
'smtp.from': string;
|
||||
'smtp.pass': string;
|
||||
'smtp.host': string;
|
||||
'smtp.port': number;
|
||||
'smtp.secure': boolean;
|
||||
installid: string;
|
||||
'server.name': string;
|
||||
'server.url': string;
|
||||
'server.xff': string;
|
||||
'server.xhost': string;
|
||||
'server.host': string;
|
||||
'server.port': number;
|
||||
'server.language': string;
|
||||
'limit.problem_files_max': number;
|
||||
'problem.categories': string;
|
||||
'session.keys': string[];
|
||||
'session.saved_expire_seconds': number;
|
||||
'session.unsaved_expire_seconds': number;
|
||||
'user.quota': number;
|
||||
}
|
||||
|
||||
export interface Setting {
|
||||
family: string,
|
||||
key: string,
|
||||
range: [string, string][] | Record<string, string>,
|
||||
value: any,
|
||||
type: string,
|
||||
subType?: string,
|
||||
name: string,
|
||||
desc: string,
|
||||
flag: number,
|
||||
family: string;
|
||||
key: string;
|
||||
range: [string, string][] | Record<string, string>;
|
||||
value: any;
|
||||
type: string;
|
||||
subType?: string;
|
||||
name: string;
|
||||
desc: string;
|
||||
flag: number;
|
||||
}
|
||||
|
||||
export interface Authenticator {
|
||||
@@ -119,7 +120,7 @@ export interface UserPreferenceDoc {
|
||||
content: string;
|
||||
}
|
||||
|
||||
export type ownerInfo = { owner: number, maintainer?: number[] };
|
||||
export interface OwnerInfo { owner: number, maintainer?: number[] }
|
||||
|
||||
export type User = import('./model/user').User;
|
||||
export type Udict = Record<number, User>;
|
||||
@@ -190,11 +191,11 @@ export type { ProblemDoc } from './model/problem';
|
||||
export type ProblemDict = NumericDictionary<ProblemDoc>;
|
||||
|
||||
export interface StatusDocBase {
|
||||
_id: ObjectId,
|
||||
docId: any,
|
||||
docType: number,
|
||||
domainId: string,
|
||||
uid: number,
|
||||
_id: ObjectId;
|
||||
docId: any;
|
||||
docType: number;
|
||||
domainId: string;
|
||||
uid: number;
|
||||
}
|
||||
|
||||
export interface ProblemStatusDoc extends StatusDocBase {
|
||||
@@ -241,10 +242,10 @@ export type ScoreboardRow = ScoreboardNode[] & { raw?: any };
|
||||
export type PenaltyRules = Dictionary<number>;
|
||||
|
||||
export interface TrainingNode {
|
||||
_id: number,
|
||||
title: string,
|
||||
requireNids: number[],
|
||||
pids: number[],
|
||||
_id: number;
|
||||
title: string;
|
||||
requireNids: number[];
|
||||
pids: number[];
|
||||
}
|
||||
|
||||
export interface Tdoc extends Document {
|
||||
@@ -287,28 +288,28 @@ export interface Tdoc extends Document {
|
||||
}
|
||||
|
||||
export interface TrainingDoc extends Omit<Tdoc, 'docType'> {
|
||||
docType: document['TYPE_TRAINING'],
|
||||
docType: document['TYPE_TRAINING'];
|
||||
description: string;
|
||||
pin?: number;
|
||||
dag: TrainingNode[];
|
||||
}
|
||||
|
||||
export interface DomainDoc extends Record<string, any> {
|
||||
_id: string,
|
||||
owner: number,
|
||||
roles: Dictionary<string>,
|
||||
avatar: string,
|
||||
bulletin: string,
|
||||
_join?: any,
|
||||
host?: string[],
|
||||
_id: string;
|
||||
owner: number;
|
||||
roles: Dictionary<string>;
|
||||
avatar: string;
|
||||
bulletin: string;
|
||||
_join?: any;
|
||||
host?: string[];
|
||||
}
|
||||
|
||||
// Message
|
||||
export interface MessageDoc {
|
||||
from: number,
|
||||
to: number,
|
||||
content: string,
|
||||
flag: number,
|
||||
from: number;
|
||||
to: number;
|
||||
content: string;
|
||||
flag: number;
|
||||
}
|
||||
|
||||
// Blacklist
|
||||
@@ -382,22 +383,22 @@ export interface ContestClarificationDoc extends Document {
|
||||
}
|
||||
|
||||
export interface TokenDoc {
|
||||
_id: string,
|
||||
tokenType: number,
|
||||
createAt: Date,
|
||||
updateAt: Date,
|
||||
expireAt: Date,
|
||||
[key: string]: any,
|
||||
_id: string;
|
||||
tokenType: number;
|
||||
createAt: Date;
|
||||
updateAt: Date;
|
||||
expireAt: Date;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export interface OplogDoc extends Record<string, any> {
|
||||
_id: ObjectId,
|
||||
type: string,
|
||||
_id: ObjectId;
|
||||
type: string;
|
||||
}
|
||||
|
||||
export interface ContestStat extends Record<string, any> {
|
||||
detail: Record<number, Record<string, any>>,
|
||||
unrank?: boolean,
|
||||
detail: Record<number, Record<string, any>>;
|
||||
unrank?: boolean;
|
||||
}
|
||||
|
||||
export interface ScoreboardConfig {
|
||||
@@ -438,9 +439,9 @@ export type ContestRules = Dictionary<ContestRule>;
|
||||
export type ProblemImporter = (url: string, handler: any) => Promise<[ProblemDoc, fs.ReadStream?]> | [ProblemDoc, fs.ReadStream?];
|
||||
|
||||
export interface Script {
|
||||
run: (args: any, report: Function) => any,
|
||||
description: string,
|
||||
validate: any,
|
||||
run: (args: any, report: Function) => any;
|
||||
description: string;
|
||||
validate: any;
|
||||
}
|
||||
|
||||
export interface Task {
|
||||
@@ -528,66 +529,66 @@ export interface LockDoc {
|
||||
|
||||
declare module './service/db' {
|
||||
interface Collections {
|
||||
'blacklist': BlacklistDoc;
|
||||
'domain': DomainDoc;
|
||||
blacklist: BlacklistDoc;
|
||||
domain: DomainDoc;
|
||||
'domain.user': any;
|
||||
'record': RecordDoc;
|
||||
record: RecordDoc;
|
||||
'record.stat': RecordStatDoc;
|
||||
'record.history': RecordHistoryDoc;
|
||||
'document': any;
|
||||
document: any;
|
||||
'document.status': StatusDocBase & {
|
||||
[K in keyof DocStatusType]: { docType: K } & DocStatusType[K];
|
||||
}[keyof DocStatusType];
|
||||
'discussion.history': DiscussionHistoryDoc;
|
||||
'user': Udoc;
|
||||
user: Udoc;
|
||||
'user.preference': UserPreferenceDoc;
|
||||
'vuser': VUdoc;
|
||||
vuser: VUdoc;
|
||||
'user.group': GDoc;
|
||||
'check': System;
|
||||
'message': MessageDoc;
|
||||
'token': TokenDoc;
|
||||
'status': any;
|
||||
'oauth': OauthMap;
|
||||
'system': System;
|
||||
'task': Task;
|
||||
'storage': FileNode;
|
||||
'oplog': OplogDoc;
|
||||
'event': EventDoc;
|
||||
'opcount': OpCountDoc;
|
||||
'schedule': Schedule;
|
||||
check: System;
|
||||
message: MessageDoc;
|
||||
token: TokenDoc;
|
||||
status: any;
|
||||
oauth: OauthMap;
|
||||
system: System;
|
||||
task: Task;
|
||||
storage: FileNode;
|
||||
oplog: OplogDoc;
|
||||
event: EventDoc;
|
||||
opcount: OpCountDoc;
|
||||
schedule: Schedule;
|
||||
'contest.balloon': ContestBalloonDoc;
|
||||
'lock': LockDoc;
|
||||
lock: LockDoc;
|
||||
}
|
||||
}
|
||||
|
||||
export interface Model {
|
||||
blacklist: typeof import('./model/blacklist').default,
|
||||
builtin: typeof import('./model/builtin'),
|
||||
contest: typeof import('./model/contest'),
|
||||
discussion: typeof import('./model/discussion'),
|
||||
document: Omit<typeof import('./model/document'), 'apply'>,
|
||||
domain: typeof import('./model/domain').default,
|
||||
message: typeof import('./model/message').default,
|
||||
opcount: typeof import('./model/opcount'),
|
||||
problem: typeof import('./model/problem').default,
|
||||
record: typeof import('./model/record').default,
|
||||
setting: typeof import('./model/setting'),
|
||||
solution: typeof import('./model/solution').default,
|
||||
system: typeof import('./model/system'),
|
||||
task: typeof import('./model/task').default,
|
||||
blacklist: typeof import('./model/blacklist').default;
|
||||
builtin: typeof import('./model/builtin');
|
||||
contest: typeof import('./model/contest');
|
||||
discussion: typeof import('./model/discussion');
|
||||
document: Omit<typeof import('./model/document'), 'apply'>;
|
||||
domain: typeof import('./model/domain').default;
|
||||
message: typeof import('./model/message').default;
|
||||
opcount: typeof import('./model/opcount');
|
||||
problem: typeof import('./model/problem').default;
|
||||
record: typeof import('./model/record').default;
|
||||
setting: typeof import('./model/setting');
|
||||
solution: typeof import('./model/solution').default;
|
||||
system: typeof import('./model/system');
|
||||
task: typeof import('./model/task').default;
|
||||
schedule: typeof import('./model/schedule').default;
|
||||
oplog: typeof import('./model/oplog'),
|
||||
token: typeof import('./model/token').default,
|
||||
training: typeof import('./model/training'),
|
||||
user: typeof import('./model/user').default,
|
||||
oauth: typeof import('./model/oauth').default,
|
||||
storage: typeof import('./model/storage').default,
|
||||
rp: typeof import('./script/rating').RpTypes,
|
||||
oplog: typeof import('./model/oplog');
|
||||
token: typeof import('./model/token').default;
|
||||
training: typeof import('./model/training');
|
||||
user: typeof import('./model/user').default;
|
||||
oauth: typeof import('./model/oauth').default;
|
||||
storage: typeof import('./model/storage').default;
|
||||
rp: typeof import('./script/rating').RpTypes;
|
||||
}
|
||||
|
||||
export interface GeoIP {
|
||||
provider: string,
|
||||
lookup: (ip: string, locale?: string) => any,
|
||||
provider: string;
|
||||
lookup: (ip: string, locale?: string) => any;
|
||||
}
|
||||
|
||||
export interface ProblemSearchResponse {
|
||||
@@ -604,9 +605,9 @@ export type ProblemSearch = (domainId: string, q: string, options?: ProblemSearc
|
||||
|
||||
export type UIInjectableFields = 'ProblemAdd' | 'Notification' | 'Nav' | 'UserDropdown' | 'DomainManage' | 'ControlPanel';
|
||||
export interface UI {
|
||||
nodes: Record<UIInjectableFields, any[]>,
|
||||
getNodes: typeof import('./lib/ui').getNodes,
|
||||
inject: typeof import('./lib/ui').inject,
|
||||
nodes: Record<UIInjectableFields, any[]>;
|
||||
getNodes: typeof import('./lib/ui').getNodes;
|
||||
inject: typeof import('./lib/ui').inject;
|
||||
}
|
||||
|
||||
export interface ModuleInterfaces {
|
||||
@@ -629,8 +630,8 @@ export interface HydroGlobal {
|
||||
declare global {
|
||||
namespace NodeJS {
|
||||
interface Global {
|
||||
Hydro: HydroGlobal,
|
||||
addons: string[],
|
||||
Hydro: HydroGlobal;
|
||||
addons: string[];
|
||||
}
|
||||
}
|
||||
/** @deprecated */
|
||||
|
||||
Reference in new issue
Block a user