wip
This commit is contained in:
@@ -2,6 +2,8 @@ import { Endpoints } from './api.types.js';
|
||||
import Stream, { Connection } from './streaming.js';
|
||||
import { Channels } from './streaming.types.js';
|
||||
import { Acct } from './acct.js';
|
||||
import type { Packed, Def } from './schemas.js';
|
||||
import { refs as _refs } from './schemas.js';
|
||||
import * as consts from './consts.js';
|
||||
|
||||
export {
|
||||
@@ -10,8 +12,11 @@ export {
|
||||
Connection as ChannelConnection,
|
||||
Channels,
|
||||
Acct,
|
||||
Packed, Def,
|
||||
};
|
||||
|
||||
export const refs = _refs;
|
||||
|
||||
export const permissions = consts.permissions;
|
||||
export const notificationTypes = consts.notificationTypes;
|
||||
export const obsoleteNotificationTypes = consts.obsoleteNotificationTypes;
|
||||
|
@@ -33,6 +33,8 @@ import { packedFlashSchema } from './schemas/flash.js';
|
||||
import type { JSONSchema7, JSONSchema7Definition, GetDef, GetRefs, GetKeys, UnionToArray } from 'schema-type';
|
||||
|
||||
export const refs = {
|
||||
Id: IdSchema,
|
||||
|
||||
UserLite: packedUserLiteSchema,
|
||||
UserDetailedNotMeOnly: packedUserDetailedNotMeOnlySchema,
|
||||
MeDetailedOnly: packedMeDetailedOnlySchema,
|
||||
@@ -66,17 +68,7 @@ export const refs = {
|
||||
Flash: packedFlashSchema,
|
||||
} as const satisfies { [x: string]: JSONSchema7Definition };
|
||||
|
||||
type Refs = typeof refs[keyof typeof refs];
|
||||
|
||||
export type References = [
|
||||
typeof IdSchema,
|
||||
...UnionToArray<Refs>,
|
||||
];
|
||||
type References = GetRefs<typeof refs>;
|
||||
|
||||
export type Packed<x extends GetKeys<References, 'https://misskey-hub.net/api/schemas/'>> = GetDef<References, x, 'https://misskey-hub.net/api/schemas/'>;
|
||||
export type Def<x extends GetKeys<References>> = GetDef<References, x>;
|
||||
|
||||
export type PackedNote = Packed<'Note'>;
|
||||
export type PackedUser = Packed<'User'>;
|
||||
export type DefNote = Def<'https://misskey-hub.net/api/schemas/Note'>;
|
||||
let renote: PackedNote['reply'];
|
||||
|
Reference in New Issue
Block a user