Expose GK api on client
Summary: Make sure that GKs can be used in pure sandy plugins. Reviewed By: jknoxville Differential Revision: D25368358 fbshipit-source-id: c7c6aa4ecf0443cb3b5d90e22e8aca9a73a69389
This commit is contained in:
committed by
Facebook GitHub Bot
parent
031cec299b
commit
698df77553
@@ -15,4 +15,5 @@ import {NormalizedMenuEntry} from './MenuEntry';
|
||||
export interface FlipperLib {
|
||||
enableMenuEntries(menuEntries: NormalizedMenuEntry[]): void;
|
||||
createPaste(input: string): Promise<string | undefined>;
|
||||
GK(gatekeeper: string): boolean;
|
||||
}
|
||||
|
||||
@@ -48,6 +48,12 @@ export interface BasePluginClient {
|
||||
* Facebook only function. Resolves to undefined if creating a paste failed.
|
||||
*/
|
||||
createPaste(input: string): Promise<string | undefined>;
|
||||
|
||||
/**
|
||||
* Returns true if the user is taking part in the given gatekeeper.
|
||||
* Always returns `false` in open source.
|
||||
*/
|
||||
GK(gkName: string): boolean;
|
||||
}
|
||||
|
||||
let currentPluginInstance: BasePluginInstance | undefined = undefined;
|
||||
@@ -155,6 +161,7 @@ export abstract class BasePluginInstance {
|
||||
}
|
||||
},
|
||||
createPaste: this.flipperLib.createPaste,
|
||||
GK: this.flipperLib.GK,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user