mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-12-19 13:10:16 +08:00
Refactor imports to use package names instead of aliases
Replaced all path alias imports (e.g., '@/napcat-core') with direct package imports (e.g., 'napcat-core/index') across napcat-common, napcat-core, and napcat-webui-backend. This improves compatibility with tooling and workspace resolution, and aligns with standard TypeScript/Node.js import practices.
This commit is contained in:
parent
6e9f448a0c
commit
c8fd66fa9b
@ -1,6 +1,6 @@
|
|||||||
import { NodeIQQNTWrapperSession } from '@/napcat-core/wrapper';
|
import { NodeIQQNTWrapperSession } from 'napcat-core/wrapper';
|
||||||
import { randomUUID } from 'crypto';
|
import { randomUUID } from 'crypto';
|
||||||
import { ListenerNamingMapping, ServiceNamingMapping } from '@/napcat-core';
|
import { ListenerNamingMapping, ServiceNamingMapping } from 'napcat-core/index';
|
||||||
|
|
||||||
interface InternalMapKey {
|
interface InternalMapKey {
|
||||||
timeout: number;
|
timeout: number;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { Peer } from '@/napcat-core';
|
import { Peer } from 'napcat-core/index';
|
||||||
import { randomUUID } from 'crypto';
|
import { randomUUID } from 'crypto';
|
||||||
|
|
||||||
class TimeBasedCache<K, V> {
|
class TimeBasedCache<K, V> {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import * as crypto from 'node:crypto';
|
import * as crypto from 'node:crypto';
|
||||||
import { PacketMsg } from '@/napcat-core/packet/message/message';
|
import { PacketMsg } from 'napcat-core/packet/message/message';
|
||||||
|
|
||||||
interface ForwardMsgJson {
|
interface ForwardMsgJson {
|
||||||
app: string
|
app: string
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import os from 'node:os';
|
import os from 'node:os';
|
||||||
import { QQLevel } from '@/napcat-core';
|
import { QQLevel } from 'napcat-core/index';
|
||||||
import { QQVersionConfigType } from './types';
|
import { QQVersionConfigType } from './types';
|
||||||
|
|
||||||
export async function solveProblem<T extends (...arg: any[]) => any> (func: T, ...args: Parameters<T>): Promise<ReturnType<T> | undefined> {
|
export async function solveProblem<T extends (...arg: any[]) => any> (func: T, ...args: Parameters<T>): Promise<ReturnType<T> | undefined> {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { Peer } from '@/napcat-core';
|
import { Peer } from 'napcat-core/index';
|
||||||
import crypto from 'crypto';
|
import crypto from 'crypto';
|
||||||
|
|
||||||
export class LimitedHashTable<K, V> {
|
export class LimitedHashTable<K, V> {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { FriendRequest, FriendV2 } from '@/napcat-core/types';
|
import { FriendRequest, FriendV2 } from 'napcat-core/types';
|
||||||
import { BuddyListReqType, InstanceContext, NapCatCore } from '@/napcat-core/index';
|
import { BuddyListReqType, InstanceContext, NapCatCore } from 'napcat-core/index';
|
||||||
import { LimitedHashTable } from 'napcat-common/src/message-unique';
|
import { LimitedHashTable } from 'napcat-common/src/message-unique';
|
||||||
|
|
||||||
export class NTQQFriendApi {
|
export class NTQQFriendApi {
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import {
|
|||||||
NTQQSystemApi,
|
NTQQSystemApi,
|
||||||
NTQQUserApi,
|
NTQQUserApi,
|
||||||
NTQQWebApi,
|
NTQQWebApi,
|
||||||
} from '@/napcat-core/apis';
|
} from 'napcat-core/apis';
|
||||||
import { NTQQCollectionApi } from '@/napcat-core/apis/collection';
|
import { NTQQCollectionApi } from '@/napcat-core/apis/collection';
|
||||||
import {
|
import {
|
||||||
NodeIQQNTWrapperSession,
|
NodeIQQNTWrapperSession,
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ChatType, KickedOffLineInfo, RawMessage } from '@/napcat-core/types';
|
import { ChatType, KickedOffLineInfo, RawMessage } from '@/napcat-core/types';
|
||||||
import { CommonFileInfo } from '@/napcat-core';
|
import { CommonFileInfo } from 'napcat-core/index';
|
||||||
|
|
||||||
export interface OnRichMediaDownloadCompleteParams {
|
export interface OnRichMediaDownloadCompleteParams {
|
||||||
fileModelId: string,
|
fileModelId: string,
|
||||||
|
|||||||
@ -19,6 +19,7 @@
|
|||||||
"@sinclair/typebox": "^0.34.38",
|
"@sinclair/typebox": "^0.34.38",
|
||||||
"file-type": "^21.0.0",
|
"file-type": "^21.0.0",
|
||||||
"napcat-image-size": "workspace:*",
|
"napcat-image-size": "workspace:*",
|
||||||
|
"napcat-core": "workspace:*",
|
||||||
"napcat-common": "workspace:*",
|
"napcat-common": "workspace:*",
|
||||||
"napcat-onebot": "workspace:*"
|
"napcat-onebot": "workspace:*"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import {
|
|||||||
PacketMsgReplyElement,
|
PacketMsgReplyElement,
|
||||||
PacketMsgVideoElement,
|
PacketMsgVideoElement,
|
||||||
} from '@/napcat-core/packet/message/element';
|
} from '@/napcat-core/packet/message/element';
|
||||||
import { ChatType, MsgSourceType, NTMsgType, RawMessage } from '@/napcat-core';
|
import { ChatType, MsgSourceType, NTMsgType, RawMessage } from 'napcat-core/index';
|
||||||
import { MiniAppRawData, MiniAppReqParams } from '@/napcat-core/packet/entities/miniApp';
|
import { MiniAppRawData, MiniAppReqParams } from '@/napcat-core/packet/entities/miniApp';
|
||||||
import { AIVoiceChatType } from '@/napcat-core/packet/entities/aiChat';
|
import { AIVoiceChatType } from '@/napcat-core/packet/entities/aiChat';
|
||||||
import { NapProtoDecodeStructType, NapProtoEncodeStructType, NapProtoMsg } from '@napneko/nap-proto-core';
|
import { NapProtoDecodeStructType, NapProtoEncodeStructType, NapProtoMsg } from '@napneko/nap-proto-core';
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { PacketHighwayContext } from '@/napcat-core/packet/highway/highwayContext';
|
import { PacketHighwayContext } from '@/napcat-core/packet/highway/highwayContext';
|
||||||
import { NapCatCore } from '@/napcat-core';
|
import { NapCatCore } from 'napcat-core/index';
|
||||||
import { PacketLogger } from '@/napcat-core/packet/context/loggerContext';
|
import { PacketLogger } from '@/napcat-core/packet/context/loggerContext';
|
||||||
import { NapCoreContext } from '@/napcat-core/packet/context/napCoreContext';
|
import { NapCoreContext } from '@/napcat-core/packet/context/napCoreContext';
|
||||||
import { PacketClientContext } from '@/napcat-core/packet/context/clientContext';
|
import { PacketClientContext } from '@/napcat-core/packet/context/clientContext';
|
||||||
|
|||||||
@ -32,7 +32,7 @@ import {
|
|||||||
SendTextElement,
|
SendTextElement,
|
||||||
SendVideoElement,
|
SendVideoElement,
|
||||||
Peer,
|
Peer,
|
||||||
} from '@/napcat-core';
|
} from 'napcat-core/index';
|
||||||
import { ForwardMsgBuilder } from 'napcat-common/src/forward-msg-builder';
|
import { ForwardMsgBuilder } from 'napcat-common/src/forward-msg-builder';
|
||||||
import { PacketMsg, PacketSendMsgElement } from '@/napcat-core/packet/message/message';
|
import { PacketMsg, PacketSendMsgElement } from '@/napcat-core/packet/message/message';
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { IPacketMsgElement } from '@/napcat-core/packet/message/element';
|
import { IPacketMsgElement } from '@/napcat-core/packet/message/element';
|
||||||
import { SendMessageElement, SendMultiForwardMsgElement } from '@/napcat-core';
|
import { SendMessageElement, SendMultiForwardMsgElement } from 'napcat-core/index';
|
||||||
|
|
||||||
export type PacketSendMsgElement = SendMessageElement | SendMultiForwardMsgElement;
|
export type PacketSendMsgElement = SendMessageElement | SendMultiForwardMsgElement;
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { AnyCnameRecord } from 'node:dns';
|
import { AnyCnameRecord } from 'node:dns';
|
||||||
import { BizKey, ModifyProfileParams, NodeIKernelProfileListener, ProfileBizType, SimpleInfo, UserDetailInfoByUin, UserDetailInfoListenerArg, UserDetailSource } from '@/napcat-core';
|
import { BizKey, ModifyProfileParams, NodeIKernelProfileListener, ProfileBizType, SimpleInfo, UserDetailInfoByUin, UserDetailInfoListenerArg, UserDetailSource } from 'napcat-core/index';
|
||||||
import { GeneralCallResult } from '@/napcat-core/services/common';
|
import { GeneralCallResult } from '@/napcat-core/services/common';
|
||||||
|
|
||||||
export interface NodeIKernelProfileService {
|
export interface NodeIKernelProfileService {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import type { LoginListItem, SelfInfo } from '@/napcat-core';
|
import type { LoginListItem, SelfInfo } from 'napcat-core';
|
||||||
import type { OneBotConfig } from '@/napcat-onebot/config/config';
|
import type { OneBotConfig } from 'napcat-onebot/config/config';
|
||||||
|
|
||||||
interface LoginRuntimeType {
|
interface LoginRuntimeType {
|
||||||
LoginCurrentTime: number;
|
LoginCurrentTime: number;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user