mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-22 04:03:49 +01:00
parent
2f620530b2
commit
1d9ef8cc99
@ -21,7 +21,7 @@ export type Partial<T> = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
type ArrayValue<T> = {
|
type ArrayValue<T> = {
|
||||||
[P in keyof T]: T[P] extends number ? Array<T[P]> : ArrayValue<T[P]>;
|
[P in keyof T]: T[P] extends number ? T[P][] : ArrayValue<T[P]>;
|
||||||
};
|
};
|
||||||
|
|
||||||
type Span = 'day' | 'hour';
|
type Span = 'day' | 'hour';
|
||||||
|
@ -27,11 +27,11 @@ export interface IReversiGame {
|
|||||||
isEnded: boolean;
|
isEnded: boolean;
|
||||||
winnerId: mongo.ObjectID;
|
winnerId: mongo.ObjectID;
|
||||||
surrendered: mongo.ObjectID;
|
surrendered: mongo.ObjectID;
|
||||||
logs: Array<{
|
logs: {
|
||||||
at: Date;
|
at: Date;
|
||||||
color: boolean;
|
color: boolean;
|
||||||
pos: number;
|
pos: number;
|
||||||
}>;
|
}[];
|
||||||
settings: {
|
settings: {
|
||||||
map: string[];
|
map: string[];
|
||||||
bw: string | number;
|
bw: string | number;
|
||||||
|
@ -52,11 +52,11 @@ export type INote = {
|
|||||||
repliesCount: number;
|
repliesCount: number;
|
||||||
reactionCounts: any;
|
reactionCounts: any;
|
||||||
mentions: mongo.ObjectID[];
|
mentions: mongo.ObjectID[];
|
||||||
mentionedRemoteUsers: Array<{
|
mentionedRemoteUsers: {
|
||||||
uri: string;
|
uri: string;
|
||||||
username: string;
|
username: string;
|
||||||
host: string;
|
host: string;
|
||||||
}>;
|
}[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* public ... 公開
|
* public ... 公開
|
||||||
|
@ -29,22 +29,22 @@ export default define(meta, (ps) => new Promise(async (res, rej) => {
|
|||||||
$group: {
|
$group: {
|
||||||
_id: { tag: '$tagsLower', userId: '$userId' }
|
_id: { tag: '$tagsLower', userId: '$userId' }
|
||||||
}
|
}
|
||||||
}]) as Array<{
|
}]) as {
|
||||||
_id: {
|
_id: {
|
||||||
tag: string;
|
tag: string;
|
||||||
userId: any;
|
userId: any;
|
||||||
}
|
}
|
||||||
}>;
|
}[];
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
if (data.length == 0) {
|
if (data.length == 0) {
|
||||||
return res([]);
|
return res([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
let tags: Array<{
|
let tags: {
|
||||||
name: string;
|
name: string;
|
||||||
count: number;
|
count: number;
|
||||||
}> = [];
|
}[] = [];
|
||||||
|
|
||||||
// カウント
|
// カウント
|
||||||
for (const x of data.map(x => x._id).filter(x => !hidedTags.includes(x.tag))) {
|
for (const x of data.map(x => x._id).filter(x => !hidedTags.includes(x.tag))) {
|
||||||
|
@ -40,22 +40,22 @@ export default define(meta, () => new Promise(async (res, rej) => {
|
|||||||
$group: {
|
$group: {
|
||||||
_id: { tag: '$tagsLower', userId: '$userId' }
|
_id: { tag: '$tagsLower', userId: '$userId' }
|
||||||
}
|
}
|
||||||
}]) as Array<{
|
}]) as {
|
||||||
_id: {
|
_id: {
|
||||||
tag: string;
|
tag: string;
|
||||||
userId: any;
|
userId: any;
|
||||||
}
|
}
|
||||||
}>;
|
}[];
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
if (data.length == 0) {
|
if (data.length == 0) {
|
||||||
return res([]);
|
return res([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
const tags: Array<{
|
const tags: {
|
||||||
name: string;
|
name: string;
|
||||||
count: number;
|
count: number;
|
||||||
}> = [];
|
}[] = [];
|
||||||
|
|
||||||
// カウント
|
// カウント
|
||||||
for (const x of data.map(x => x._id).filter(x => !hidedTags.includes(x.tag))) {
|
for (const x of data.map(x => x._id).filter(x => !hidedTags.includes(x.tag))) {
|
||||||
@ -108,7 +108,7 @@ export default define(meta, () => new Promise(async (res, rej) => {
|
|||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
//#region 2(または3)で話題と判定されたタグそれぞれについて過去の投稿数グラフを取得する
|
//#region 2(または3)で話題と判定されたタグそれぞれについて過去の投稿数グラフを取得する
|
||||||
const countPromises: Array<Promise<any[]>> = [];
|
const countPromises: Promise<any[]>[] = [];
|
||||||
|
|
||||||
const range = 20;
|
const range = 20;
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ export default class extends Channel {
|
|||||||
const mute = this.user ? await Mute.find({ muterId: this.user._id }) : null;
|
const mute = this.user ? await Mute.find({ muterId: this.user._id }) : null;
|
||||||
const mutedUserIds = mute ? mute.map(m => m.muteeId.toString()) : [];
|
const mutedUserIds = mute ? mute.map(m => m.muteeId.toString()) : [];
|
||||||
|
|
||||||
const q: Array<string[]> = params.q;
|
const q: string[][] = params.q;
|
||||||
|
|
||||||
if (q == null) return;
|
if (q == null) return;
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ const parsePropDefinition = (key: string, prop: any) => {
|
|||||||
return prop;
|
return prop;
|
||||||
};
|
};
|
||||||
|
|
||||||
const sortParams = (params: Array<{ name: string }>) => {
|
const sortParams = (params: { name: string }[]) => {
|
||||||
return params;
|
return params;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -429,7 +429,7 @@ export default async function(
|
|||||||
|
|
||||||
const properties: {[key: string]: any} = {};
|
const properties: {[key: string]: any} = {};
|
||||||
|
|
||||||
let propPromises: Array<Promise<void>> = [];
|
let propPromises: Promise<void>[] = [];
|
||||||
|
|
||||||
const isImage = ['image/jpeg', 'image/gif', 'image/png', 'image/webp'].includes(mime);
|
const isImage = ['image/jpeg', 'image/gif', 'image/png', 'image/webp'].includes(mime);
|
||||||
|
|
||||||
|
@ -38,10 +38,10 @@ type NotificationType = 'reply' | 'renote' | 'quote' | 'mention';
|
|||||||
class NotificationManager {
|
class NotificationManager {
|
||||||
private notifier: IUser;
|
private notifier: IUser;
|
||||||
private note: INote;
|
private note: INote;
|
||||||
private queue: Array<{
|
private queue: {
|
||||||
target: ILocalUser['_id'];
|
target: ILocalUser['_id'];
|
||||||
reason: NotificationType;
|
reason: NotificationType;
|
||||||
}>;
|
}[];
|
||||||
|
|
||||||
constructor(notifier: IUser, note: INote) {
|
constructor(notifier: IUser, note: INote) {
|
||||||
this.notifier = notifier;
|
this.notifier = notifier;
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
"no-empty":false,
|
"no-empty":false,
|
||||||
"ordered-imports": [false],
|
"ordered-imports": [false],
|
||||||
"arrow-parens": false,
|
"arrow-parens": false,
|
||||||
"array-type": false,
|
"array-type": [true, "array"],
|
||||||
"object-literal-shorthand": false,
|
"object-literal-shorthand": false,
|
||||||
"object-literal-key-quotes": false,
|
"object-literal-key-quotes": false,
|
||||||
"triple-equals": [false],
|
"triple-equals": [false],
|
||||||
|
Loading…
Reference in New Issue
Block a user