@laplace.live/internal 1.3.20 → 1.3.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/namespaces/danmakus.d.ts +142 -0
package/package.json
CHANGED
|
@@ -583,4 +583,146 @@ export declare namespace Danmakus {
|
|
|
583
583
|
totalLives: number
|
|
584
584
|
loadedDanmakus: number
|
|
585
585
|
}
|
|
586
|
+
|
|
587
|
+
/* ----------------------------------------------------------------------------
|
|
588
|
+
* v3 msgpack endpoints (`application/x-msgpack`)
|
|
589
|
+
*
|
|
590
|
+
* `/full`, `/delta`, `/result` and `/meta/index-background` respond with
|
|
591
|
+
* MessagePack-encoded binary, NOT JSON. The OpenAPI spec only declares them as
|
|
592
|
+
* `{ type: string, format: binary }` with no decoded object schema, so the
|
|
593
|
+
* tuple types below are reverse-engineered from real responses. Decode the
|
|
594
|
+
* binary body (e.g. `@msgpack/msgpack`'s `decode`) before applying them.
|
|
595
|
+
*
|
|
596
|
+
* The payload is a **positional tuple** (array), not a keyed object. Verified
|
|
597
|
+
* positions are named; positions that can't be resolved by inspection alone
|
|
598
|
+
* are marked `inferred`.
|
|
599
|
+
* -------------------------------------------------------------------------- */
|
|
600
|
+
|
|
601
|
+
/** Channel tuple in `LiveFullV3` — `[uId, uName, roomId]` */
|
|
602
|
+
export type ChannelTupleV3 = [uId: number, uName: string, roomId: number]
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* Live tuple in `LiveFullV3`.
|
|
606
|
+
*
|
|
607
|
+
* Note: in the merged `/full` view, counts aggregate every contributed
|
|
608
|
+
* version, so they differ from the `/api/v3/lives/{liveId}` JSON view.
|
|
609
|
+
*/
|
|
610
|
+
export type LiveTupleV3 = [
|
|
611
|
+
liveId: string,
|
|
612
|
+
title: string,
|
|
613
|
+
coverUrl: string,
|
|
614
|
+
startDate: number,
|
|
615
|
+
/** 0 while still ongoing */
|
|
616
|
+
stopDate: number,
|
|
617
|
+
isFinish: boolean,
|
|
618
|
+
isFull: boolean,
|
|
619
|
+
isMerged: boolean,
|
|
620
|
+
danmakusCount: number,
|
|
621
|
+
/** inferred — commentCount */
|
|
622
|
+
commentCount: number,
|
|
623
|
+
interactionCount: number,
|
|
624
|
+
watchCount: number,
|
|
625
|
+
/** integer milli-units; divide by 1000 for 元 (e.g. 1200 → 1.2) */
|
|
626
|
+
totalIncomeMilli: number,
|
|
627
|
+
maxOnlineCount: number,
|
|
628
|
+
/** inferred — onlineRank */
|
|
629
|
+
onlineRank: number,
|
|
630
|
+
area: string,
|
|
631
|
+
parentArea: string,
|
|
632
|
+
/** extra data when `include=extra`: `[onlineRankHistory, wordCloud]` (maps of `ts → value`, either may be null) */
|
|
633
|
+
extra: [
|
|
634
|
+
onlineRank: { [ts: number]: number } | null,
|
|
635
|
+
wordCloud: { [word: string]: number } | null,
|
|
636
|
+
],
|
|
637
|
+
versions: LiveVersionTupleV3[],
|
|
638
|
+
/** inferred — total record count */
|
|
639
|
+
totalCount: number,
|
|
640
|
+
]
|
|
641
|
+
|
|
642
|
+
/** Version tuple in `LiveTupleV3.versions` */
|
|
643
|
+
export type LiveVersionTupleV3 = [
|
|
644
|
+
liveId: string,
|
|
645
|
+
startDate: number,
|
|
646
|
+
stopDate: number,
|
|
647
|
+
rangeDanmakusCount: number,
|
|
648
|
+
userName: string,
|
|
649
|
+
/** 0 for the official ("本站") version */
|
|
650
|
+
userId: number,
|
|
651
|
+
isOfficial: boolean,
|
|
652
|
+
isFull: boolean,
|
|
653
|
+
danmakusCount: number,
|
|
654
|
+
]
|
|
655
|
+
|
|
656
|
+
/** Actor tuple in `DanmakuFrameTupleV3.actors` — `[uid, name]` */
|
|
657
|
+
export type ActorTupleV3 = [uid: number, name: string]
|
|
658
|
+
|
|
659
|
+
/** Room-emoji tuple in `DanmakuFrameTupleV3.roomEmojis` — `[resource]` */
|
|
660
|
+
export type RoomEmojiTupleV3 = [resource: string]
|
|
661
|
+
|
|
662
|
+
/**
|
|
663
|
+
* Danmaku record tuple in `DanmakuFrameTupleV3.records`.
|
|
664
|
+
*
|
|
665
|
+
* `payload` shape depends on `payloadKind`:
|
|
666
|
+
* - `null` — no payload (e.g. enter / live stop / continue)
|
|
667
|
+
* - text kinds → `[text]`
|
|
668
|
+
* - 上舰 → `[guardLevel]`
|
|
669
|
+
* - 礼物 / SC → `[name, count, price, ...]`
|
|
670
|
+
* - 标题/分区变动 → `[current, previous]`
|
|
671
|
+
*/
|
|
672
|
+
export type DanmakuRecordTupleV3 = [
|
|
673
|
+
/** ms offset from `startDate` */
|
|
674
|
+
ts: number,
|
|
675
|
+
type: DanmakuTypeV3,
|
|
676
|
+
/** index into `DanmakuFrameTupleV3.actors` */
|
|
677
|
+
actorIndex: number,
|
|
678
|
+
/** contributor account id; 0 = 本站直接采集 */
|
|
679
|
+
uploadAccountId: number,
|
|
680
|
+
payloadKind: DanmakuPayloadKindV3,
|
|
681
|
+
payload: Array<string | number | null> | null,
|
|
682
|
+
]
|
|
683
|
+
|
|
684
|
+
/** Frame tuple in `LiveFullV3` — `[serverTs, actors, roomEmojis, records]` */
|
|
685
|
+
export type DanmakuFrameTupleV3 = [
|
|
686
|
+
serverTs: number,
|
|
687
|
+
actors: ActorTupleV3[],
|
|
688
|
+
roomEmojis: RoomEmojiTupleV3[],
|
|
689
|
+
records: DanmakuRecordTupleV3[],
|
|
690
|
+
]
|
|
691
|
+
|
|
692
|
+
/**
|
|
693
|
+
* 单场直播完整数据(msgpack 二进制)
|
|
694
|
+
*
|
|
695
|
+
* 解码后为 `[channel, live, frame]` 三元组(无 code/message/data 信封)。
|
|
696
|
+
* `/delta` 返回相同结构(仅 `records` 为增量)。
|
|
697
|
+
* @link https://ukamnads.icu/api/v3/lives/{liveId}/full
|
|
698
|
+
* @link https://ukamnads.icu/api/v3/lives/{liveId}/delta
|
|
699
|
+
*/
|
|
700
|
+
export type LiveFullV3 = [
|
|
701
|
+
channel: ChannelTupleV3,
|
|
702
|
+
live: LiveTupleV3,
|
|
703
|
+
frame: DanmakuFrameTupleV3,
|
|
704
|
+
]
|
|
705
|
+
|
|
706
|
+
/** Alias of {@link LiveFullV3} for the incremental `/delta` endpoint */
|
|
707
|
+
export type LiveDeltaV3 = LiveFullV3
|
|
708
|
+
|
|
709
|
+
/** Item tuple in `IndexBackgroundV3` */
|
|
710
|
+
export type IndexBackgroundItemTupleV3 = [
|
|
711
|
+
/** composite key `liveIdHex:ts:uId:seq` */
|
|
712
|
+
key: string,
|
|
713
|
+
liveId: string,
|
|
714
|
+
uId: number,
|
|
715
|
+
title: string,
|
|
716
|
+
/** highlighted danmaku message */
|
|
717
|
+
message: string,
|
|
718
|
+
ts: number,
|
|
719
|
+
]
|
|
720
|
+
|
|
721
|
+
/**
|
|
722
|
+
* 首页背景轮播条目(msgpack 二进制)
|
|
723
|
+
*
|
|
724
|
+
* 解码后为单元素数组,包裹条目列表:`[items]`。
|
|
725
|
+
* @link https://ukamnads.icu/api/v3/meta/index-background
|
|
726
|
+
*/
|
|
727
|
+
export type IndexBackgroundV3 = [items: IndexBackgroundItemTupleV3[]]
|
|
586
728
|
}
|