Skip to content

Commit

Permalink
feat: Added Features
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Aug 26, 2021
1 parent 7e496c1 commit 51c0c86
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/whatsapp/misc/EventEmitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ type Event = string | symbol;
type Listener = (...args: any[]) => void;

/**
* @moduleID 54783
* @whatsapp 2.2126.14
* @moduleID 14090
* @whatsapp 2.2132.6
*/
export declare class EventEmitter {
/**
Expand Down
72 changes: 72 additions & 0 deletions src/whatsapp/misc/Features.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*!
* Copyright 2021 WPPConnect Team
*
* 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 { exportModule } from '../exportModule';
import { EventEmitter } from './EventEmitter';

/**
* @moduleID 77188
* @whatsapp 2.2132.6
*/
declare class FeatureClass extends EventEmitter {
FEATURE_CHANGE_EVENT: string;
F: { [key: string]: string };
VF: { [key: string]: string };
silenceChangeEvents: boolean;
triggerFeaturesChangedDebounced: any;
features: { [key: string]: true };
proto: [number, number];
setVersion(version: [number, number]): void;
setPlatform(platform: string): void;
setFeatureFromFlags(e?: any, t?: any, r?: any): any;
setFeature(e?: any, t?: any): any;
setFeatures(e?: any): any;
supportsFeature(feature: string): boolean;
supportsFeatureFromFlags(flag: any): boolean;
supportsAllFeatures(...features: string[]): boolean;
supportsAnyFeature(...features: string[]): boolean;
supportsAnyFeature(...features: string[]): boolean;
resetFeatures(): void;
lt(version: [number, number]): boolean;
ltr(version: [number, number]): boolean;
gt(version: [number, number]): boolean;
gte(version: [number, number]): boolean;
gte(version: [number, number]): boolean;
triggerFeaturesChanged(): void;
overwriteDebugGKs(): void;
isThirdPartyStickersEnabled(): boolean;
isRecentStickersEnabled(): boolean;
isStarredStickersEnabled(): boolean;
isCatalogManagerEnabled(): boolean;
isEphemeralAllowGroupMembersEnabled(): boolean;
isEphemeral24HDurationEnabled(): boolean;
isDisappearingModeEnabled(): boolean;
isDropLastNameEnabled(): boolean;
isGroupCatchUpEnabled(): boolean;
isInAppSupportEnabled(): boolean;
}

/**
* @moduleID 77188
* @whatsapp 2.2132.6
*/
export declare const Features: FeatureClass;

exportModule(
exports,
{ Features: 'default' },
(m) => m.default.supportsFeature
);
1 change: 1 addition & 0 deletions src/whatsapp/misc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export * from './ClockSkew';
export * from './Conn';
export * from './Constants';
export * from './EventEmitter';
export * from './Features';
export * from './ImageUtils';
export * from './MediaUtils';
export * from './MsgKey';
Expand Down

0 comments on commit 51c0c86

Please sign in to comment.