@juzi/wechaty
Version:
Wechaty is a RPA SDK for Chatbot Makers.
114 lines • 4.55 kB
TypeScript
/**
* Wechaty Chatbot SDK - https://github.com/wechaty/wechaty
*
* @copyright 2016 Huan LI (李卓桓) <https://github.com/huan>, and
* Wechaty Contributors <https://github.com/wechaty>.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import * as PUPPET from '@juzi/wechaty-puppet';
import type { TagQueryFilter } from '@juzi/wechaty-puppet/dist/esm/src/schemas/tag.js';
import type { Constructor } from 'clone-class';
import type { ContactInterface } from './contact.js';
import type { TagGroupInterface } from './tag-group.js';
declare const MixinBase: ((abstract new (...args: any[]) => {
readonly wechaty: import("../wechaty/wechaty-impl.js").WechatyInterface;
}) & {
readonly wechaty: import("../wechaty/wechaty-impl.js").WechatyInterface;
}) & ((abstract new (...args: any[]) => {}) & {
_pool?: Map<string, TagImplInterface> | undefined;
readonly pool: Map<string, TagImplInterface>;
load<L extends import("clone-class/dist/esm/src/constructor.js").ClassInterface<{}> & {
new (...args: any[]): TagImplInterface;
prototype: TagImplInterface;
} & import("../user-mixins/poolify.js").PoolifyMixin<TagImplInterface>>(this: L, id: string): TagImplInterface;
}) & ObjectConstructor;
declare class TagMixin extends MixinBase {
readonly id: string;
/**
*
* Instance properties
* @ignore
*
*/
payload?: PUPPET.payloads.Tag;
/**
* @hideconstructor
*/
constructor(id: string);
type(): PUPPET.types.Tag;
name(): string;
groupId(): string;
group(): Promise<TagGroupInterface | undefined>;
static list(): Promise<TagInterface[]>;
static find(filter: TagQueryFilter): Promise<TagInterface | undefined>;
static findMulti(filters: TagQueryFilter[]): Promise<TagInterface[] | undefined>;
/**
* Force reload data for Tag, Sync data from low-level API again.
*
* @returns {Promise<this>}
* @example
* await tag.sync()
*/
sync(): Promise<void>;
/**
* @ignore
*/
isReady(): boolean;
/**
* `ready()` is For FrameWork ONLY!
*
* Please not to use `ready()` at the user land.
* If you want to sync data, use `sync()` instead.
*
* @ignore
*/
ready(forceSync?: boolean): Promise<void>;
contactList(): Promise<ContactInterface[]>;
tag(contacts: ContactInterface | ContactInterface[]): Promise<void>;
static createTag(name: string, tagGroup?: TagGroupInterface): Promise<TagInterface | void>;
static createMultiTag(nameList: string[], tagGroup?: TagGroupInterface): Promise<TagInterface[] | void>;
static deleteTag(tagInstance: TagInterface): Promise<void>;
static deleteMultiTag(tagInstances: TagInterface[]): Promise<void>;
static modifyTag(tagInstance: TagInterface, tagNewName: string): Promise<TagInterface | void>;
static modifyMultiTag(tagInfos: Array<{
tag: TagInterface;
newName: string;
}>): Promise<TagInterface[] | void>;
toString(): string;
}
declare const TagImplBase_base: {
new (...args: any[]): {};
valid: (o: any) => o is TagImplInterface;
validInstance: (target: any) => target is TagMixin;
validInterface: (target: any) => target is TagImplInterface;
} & typeof TagMixin;
declare class TagImplBase extends TagImplBase_base {
}
interface TagImplInterface extends TagImplBase {
}
declare type TagProtectedProperty = 'ready';
declare type TagInterface = Omit<TagImplInterface, TagProtectedProperty>;
declare const TagImpl_base: {
new (...args: any[]): {};
valid: (o: any) => o is TagInterface;
validInstance: (target: any) => target is TagImplBase;
validInterface: (target: any) => target is TagInterface;
} & typeof TagImplBase;
declare class TagImpl extends TagImpl_base {
}
declare type TagConstructor = Constructor<TagImplInterface, Omit<typeof TagImpl, 'load'>>;
export type { TagConstructor, TagProtectedProperty, TagInterface, };
export { TagImpl, };
//# sourceMappingURL=tag.d.ts.map