Files
NapCatQQ/packages/napcat-types/test-dist.ts
T
手瓜一十雪 974528fe7e Apply formatting and minor style fixes across repo
Normalize code style across multiple packages: whitespace cleanup, consistent commas and trailing commas in arrays/enums/objects, fix table markdown lines in CI comment template, ensure newline at EOF, normalize header/object property quoting and spacing, remove stray blank lines and minor non-functional comment tweaks. These are formatting-only changes and small type/annotation spacing adjustments; no functional behavior changes intended.
2026-03-05 18:45:50 +08:00

37 lines
1.1 KiB
TypeScript

import {
ChatType,
ElementType,
NapCatCore,
NTQQMsgApi,
NapCatOneBot11Adapter,
OB11Message,
OB11BaseMessageEvent,
OB11BaseMetaEvent,
} from './dist/napcat-types/index';
console.log('--- NapCat Comprehensive Type Test ---');
// 1. 测试枚举 (Core)
console.log('ChatType.KCHATTYPEGROUP:', ChatType.KCHATTYPEGROUP); // 应输出 2
console.log('ElementType.TEXT:', ElementType.TEXT); // 应输出 1
// 2. 测试类型 (Core)
const coreStub = {} as NapCatCore;
const apiStub = {} as NTQQMsgApi;
console.log('Core types access check: OK');
// 3. 测试类和类型 (OneBot)
const obAdapterStub = {} as NapCatOneBot11Adapter;
const obMsgStub = {} as OB11Message;
const baseMessageEventStub = {} as OB11BaseMessageEvent;
const baseMetaEventStub = {} as OB11BaseMetaEvent;
console.log('OneBot types and events access check: OK');
// 4. 验证导出完整性
if (ChatType.KCHATTYPEGROUP === 2 && ElementType.TEXT === 1) {
console.log('\n✅ ALL TESTS PASSED: Types, Enums and Events are correctly exported and accessible.');
} else {
console.error('\n❌ TESTS FAILED: Enum value mismatch.');
throw new Error('Test Failed');
}