This commit is contained in:
tamaina
2023-05-10 17:48:21 +00:00
parent 3324f3fa15
commit ac99cdce8b
8 changed files with 20 additions and 20 deletions

View File

@@ -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;

View File

@@ -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'];