chore: update deps

This commit is contained in:
鲁树人
2025-09-03 21:27:38 +09:00
parent c41e5ae531
commit 62e49804a5
9 changed files with 1222 additions and 1256 deletions

View File

@@ -25,7 +25,7 @@ export interface DecipherNotOK {
export interface DecipherOK {
status: Status.OK;
message?: string;
data: Uint8Array;
data: Uint8Array<ArrayBuffer>;
overrideExtension?: string;
cipherName: string;
}

View File

@@ -3,7 +3,7 @@ import { DecipherInstance, DecipherOK, DecipherResult, Status } from '~/decrypt-
export class TransparentDecipher implements DecipherInstance {
cipherName = 'none';
async decrypt(buffer: Uint8Array): Promise<DecipherResult | DecipherOK> {
async decrypt(buffer: Uint8Array<ArrayBuffer>): Promise<DecipherResult | DecipherOK> {
return {
cipherName: 'None',
status: Status.OK,

View File

@@ -1,6 +1,5 @@
export const toArrayBuffer = async (src: Blob | ArrayBuffer | Uint8Array<ArrayBufferLike>) =>
src instanceof Blob ? await src.arrayBuffer() : src;
export const toBlob = (src: Blob | ArrayBuffer | Uint8Array<ArrayBufferLike>, mimeType?: string) =>
export const toArrayBuffer = async (src: Blob | BlobPart) => (src instanceof Blob ? await src.arrayBuffer() : src);
export const toBlob = (src: Blob | BlobPart, mimeType?: string) =>
src instanceof Blob ? src : new Blob([src], { type: mimeType ?? 'application/octet-stream' });
export function* chunkBuffer(buffer: Uint8Array, blockLen = 4096): Generator<[Uint8Array, number], void> {

View File

@@ -5,7 +5,7 @@ export class MMKVParser {
private offset = 4;
private length: number;
constructor(private view: DataView) {
constructor(private view: DataView<ArrayBuffer>) {
const payloadLength = view.getUint32(0, true);
this.length = 4 + payloadLength;

View File

@@ -1,7 +1,7 @@
import type { StagingKugouKey } from '~/features/settings/keyFormats';
import { MMKVParser } from '../MMKVParser';
export function parseAndroidKugouMMKV(view: DataView): Omit<StagingKugouKey, 'id'>[] {
export function parseAndroidKugouMMKV(view: DataView<ArrayBuffer>): Omit<StagingKugouKey, 'id'>[] {
const mmkv = new MMKVParser(view);
const result: Omit<StagingKugouKey, 'id'>[] = [];
while (!mmkv.eof) {

View File

@@ -1,7 +1,7 @@
import type { StagingKWMv2Key } from '~/features/settings/keyFormats';
import { MMKVParser } from '../MMKVParser';
export function parseAndroidKuwoEKey(view: DataView): Omit<StagingKWMv2Key, 'id'>[] {
export function parseAndroidKuwoEKey(view: DataView<ArrayBuffer>): Omit<StagingKWMv2Key, 'id'>[] {
const mmkv = new MMKVParser(view);
const result: Omit<StagingKWMv2Key, 'id'>[] = [];
while (!mmkv.eof) {
@@ -21,7 +21,7 @@ export function parseAndroidKuwoEKey(view: DataView): Omit<StagingKWMv2Key, 'id'
return result;
}
export function parseIosKuwoEKey(view: DataView): Omit<StagingKWMv2Key, 'id'>[] {
export function parseIosKuwoEKey(view: DataView<ArrayBuffer>): Omit<StagingKWMv2Key, 'id'>[] {
const mmkv = new MMKVParser(view);
const result: Omit<StagingKWMv2Key, 'id'>[] = [];
while (!mmkv.eof) {

View File

@@ -1,6 +1,6 @@
import { MMKVParser } from '../MMKVParser';
export function parseAndroidQmEKey(view: DataView): Map<string, string> {
export function parseAndroidQmEKey(view: DataView<ArrayBuffer>): Map<string, string> {
const mmkv = new MMKVParser(view);
const result = new Map<string, string>();
while (!mmkv.eof) {