@cpany/types
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -125,9 +125,19 @@ declare enum Verdict { | ||
name: string; | ||
handles: Array<RouteKey<IHandle>>; | ||
contests: Array<RouteKey<IContest> & { | ||
key: string; | ||
handles: Array<IHandle>; | ||
contests: Array<Key<IContest & { | ||
author: IAuthor; | ||
}>; | ||
}>>; | ||
} | ||
interface ICPanyConfig { | ||
users?: Record<string, Record<string, string[] | string>>; | ||
interface IRouteUser { | ||
name: string; | ||
key: string; | ||
path: string; | ||
handles: Array<IHandle>; | ||
contests: Array<RouteKey<IContest & { | ||
author: IAuthor; | ||
}>>; | ||
} | ||
interface CPanyOption { | ||
users?: Record<string, Record<string, string | string[] | Record<string, string | string[]>>>; | ||
handles?: string[]; | ||
@@ -137,31 +147,80 @@ contests?: string[]; | ||
static?: string[]; | ||
app?: Partial<AppConfig>; | ||
app?: Partial<AppOption>; | ||
plugins?: string[]; | ||
} | ||
interface IResolvedCPanyConfig { | ||
users: Array<IUser>; | ||
handles: Array<IHandle>; | ||
contests: Array<IContest>; | ||
blogs: Array<{}>; | ||
app: AppConfig; | ||
interface ResolvedCPanyUserOption { | ||
/** | ||
* Username | ||
*/ | ||
name: string; | ||
handle: Array<{ | ||
platform: string; | ||
handle: string; | ||
}>; | ||
} | ||
interface AppConfig { | ||
interface ResolvedCPanyOption { | ||
/** | ||
* Absolute data root path | ||
*/ | ||
dataRoot: string; | ||
/** | ||
* Flattern users option | ||
*/ | ||
users: Array<ResolvedCPanyUserOption>; | ||
static: { | ||
/** | ||
* Absolute directories for external handles | ||
*/ | ||
handles: Array<string>; | ||
/** | ||
* Absolute directories for external contests | ||
*/ | ||
contests: Array<string>; | ||
/** | ||
* Absolute directories for external blog posts | ||
*/ | ||
blogs: Array<{}>; | ||
}; | ||
/** | ||
* App options | ||
*/ | ||
app: AppOption; | ||
} | ||
declare type ICPanyPluginConfig = ResolvedCPanyOption & { | ||
baseUrl: string; | ||
}; | ||
interface AppOption { | ||
/** | ||
* @default "" | ||
*/ | ||
title: string; | ||
/** | ||
* @default 2592000 | ||
*/ | ||
recentTime: number; | ||
/** | ||
* @default 15 | ||
*/ | ||
recentContestsCount: number; | ||
/** | ||
* @default 5 | ||
*/ | ||
recentUserCount: number; | ||
/** | ||
* @default "['members', 'codeforces', 'contests']" | ||
*/ | ||
nav: string[]; | ||
} | ||
declare type ICPanyPluginConfig = Required<ICPanyConfig> & { | ||
basePath: string; | ||
timeout?: number; | ||
declare type Key<T> = T & { | ||
key: string; | ||
}; | ||
declare type RouteKey<T, K = number> = T & { | ||
declare type RouteKey<T> = T & { | ||
type: string; | ||
key: K; | ||
key: string; | ||
path: string; | ||
}; | ||
declare type IContestOverview = Omit<RouteKey<IContest>, 'standings'>; | ||
declare type IContestOverview = Omit<Key<IContest>, 'standings'>; | ||
interface IUserOverview { | ||
name: string; | ||
handles: Array<Omit<RouteKey<IHandle>, 'submissions'>>; | ||
handles: Array<Omit<IHandle, 'submissions'>>; | ||
contests: Array<{ | ||
@@ -186,2 +245,2 @@ type: string; | ||
export { AppConfig, CompressHandleList, IAuthor, ICPanyConfig, ICPanyPluginConfig, IContest, IContestOverview, IContestProblem, IContestStanding, IContestSubmission, IHandle, IProblem, IResolvedCPanyConfig, ISubmission, IUser, IUserOverview, LogLevel, ParticipantType, RouteKey, Verdict, isAtCoder, isCodeforces, isHdu, isLuogu, isNowCoder, isPintia }; | ||
export { AppOption, CPanyOption, CompressHandleList, IAuthor, ICPanyPluginConfig, IContest, IContestOverview, IContestProblem, IContestStanding, IContestSubmission, IHandle, IProblem, IRouteUser, ISubmission, IUser, IUserOverview, Key, LogLevel, ParticipantType, ResolvedCPanyOption, ResolvedCPanyUserOption, RouteKey, Verdict, isAtCoder, isCodeforces, isHdu, isLuogu, isNowCoder, isPintia }; |
{ | ||
"name": "@cpany/types", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "CPany types package", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
105
src/cpany.ts
@@ -6,51 +6,120 @@ import { IHandle, IAuthor } from './handle'; | ||
name: string; | ||
handles: Array<RouteKey<IHandle>>; | ||
contests: Array<RouteKey<IContest> & { author: IAuthor }>; | ||
key: string; | ||
handles: Array<IHandle>; | ||
contests: Array<Key<IContest & { author: IAuthor }>>; | ||
} | ||
export interface ICPanyConfig { | ||
users?: Record<string, Record<string, string[] | string>>; | ||
export interface IRouteUser { | ||
name: string; | ||
key: string; | ||
path: string; | ||
handles: Array<IHandle>; | ||
contests: Array<RouteKey<IContest & { author: IAuthor }>>; | ||
} | ||
export interface CPanyOption { | ||
users?: Record<string, Record<string, string | string[] | Record<string, string | string[]>>>; | ||
handles?: string[]; | ||
contests?: string[]; | ||
fetch?: string[]; | ||
static?: string[]; | ||
app?: Partial<AppConfig>; | ||
app?: Partial<AppOption>; | ||
plugins?: string[]; | ||
} | ||
export interface IResolvedCPanyConfig { | ||
users: Array<IUser>; | ||
export interface ResolvedCPanyUserOption { | ||
/** | ||
* Username | ||
*/ | ||
name: string; | ||
handles: Array<IHandle>; | ||
handle: Array<{ | ||
platform: string; | ||
handle: string; | ||
}>; | ||
} | ||
contests: Array<IContest>; | ||
export interface ResolvedCPanyOption { | ||
/** | ||
* Absolute data root path | ||
*/ | ||
dataRoot: string; | ||
blogs: Array<{}>; | ||
/** | ||
* Flattern users option | ||
*/ | ||
users: Array<ResolvedCPanyUserOption>; | ||
app: AppConfig; | ||
static: { | ||
/** | ||
* Absolute directories for external handles | ||
*/ | ||
handles: Array<string>; | ||
/** | ||
* Absolute directories for external contests | ||
*/ | ||
contests: Array<string>; | ||
/** | ||
* Absolute directories for external blog posts | ||
*/ | ||
blogs: Array<{}>; | ||
}; | ||
/** | ||
* App options | ||
*/ | ||
app: AppOption; | ||
} | ||
export type ICPanyPluginConfig = ResolvedCPanyOption & { baseUrl: string }; | ||
// Action/Cli config interface | ||
export interface AppConfig { | ||
export interface AppOption { | ||
/** | ||
* @default "" | ||
*/ | ||
title: string; | ||
/** | ||
* @default 2592000 | ||
*/ | ||
recentTime: number; | ||
/** | ||
* @default 15 | ||
*/ | ||
recentContestsCount: number; | ||
/** | ||
* @default 5 | ||
*/ | ||
recentUserCount: number; | ||
// default: ['members', 'codeforces', 'contests']; | ||
/** | ||
* @default "['members', 'codeforces', 'contests']" | ||
*/ | ||
nav: string[]; | ||
} | ||
export type ICPanyPluginConfig = Required<ICPanyConfig> & { basePath: string; timeout?: number }; | ||
export type Key<T> = T & { key: string }; | ||
export type RouteKey<T, K = number> = T & { | ||
export type RouteKey<T> = T & { | ||
type: string; | ||
key: K; | ||
key: string; | ||
path: string; | ||
}; | ||
export type IContestOverview = Omit<RouteKey<IContest>, 'standings'>; | ||
export type IContestOverview = Omit<Key<IContest>, 'standings'>; | ||
export interface IUserOverview { | ||
name: string; | ||
handles: Array<Omit<RouteKey<IHandle>, 'submissions'>>; | ||
handles: Array<Omit<IHandle, 'submissions'>>; | ||
@@ -57,0 +126,0 @@ // t: short for participantTime |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21882
747