<commit_before>// Type definitions for facebook-instant-games 6.1
// Project: https://developers.facebook.com/docs/games/instant-games
// Definitions by: <NAME> <https://github.com/menushka>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

declare namespace FBInstant {
    let player: Player;
    let context: Context;
    let payments: Payments;

    function getLocale(): string;
    function getPlatform(): string;
    function getSDKVersion(): string;
    function initializeAsync(): Promise<any>;
    function setLoadingProgress(progress: number): void;
    function getSupportedAPIs(): string[];
    function getEntryPointData(): any;
    function getEntryPointAsync(): Promise<string>;
    function setSessionData(sessionData: any): void;
    function startGameAsync(): Promise<any>;
    function shareAsync(payload: SharePayload): Promise<void>;
    function updateAsync(payload: UpdatePayload): Promise<void>;
    function switchGameAsync(appID: string, data: string): Promise<void>;
    function canCreateShortcutAsync(): Promise<boolean>;
    function createShortcutAsync(): Promise<void>;
    function quit(): void;
    function logEvent(eventName: string, valueToSum?: number, parameter?: any): APIError;
    function onPause(func: () => void): void;
    function getInterstitialAdAsync(placementID: string): Promise<AdInstance>;
    function getRewardedVideoAsync(placementID: string): Promise<AdInstance>;
    function matchPlayerAsync(matchTag: string, switchContextWhenMatched?: boolean): Promise<void>;
    function checkCanPlayerMatchAsync(): Promise<boolean>;
    function getLeaderboardAsync(name: string): Promise<Leaderboard>;

    interface Player {
        getID(): string;
        getSignedPlayerInfoAsync(requestPayload: string): Promise<SignedPlayerInfo>;
        canSubscribeBotAsync(): Promise<boolean>;
        subscribeBotAsync(): Promise<void>;
        getName(): string;
        getPhoto(): string;
        getDataAsync(keys: string[]): Promise<DataObject>;
        setDataAsync(data: DataObject): Promise<void>;
        flushDataAsync(): Promise<void>;
        getStatsAsync(keys: string[]): Promise<StatsObject>;
        setStatsAsync(stats: StatsObject): Promise<void>;
        incrementStatsAsync(increments: IncrementObject): Promise<StatsObject>;
        getConnectedPlayersAsync(): Promise<ConnectedPlayer[]>;
    }

    interface Context {
        getID(): string;
        getType(): Type;
        isSizeBetween(minSize: number, maxSize: number): ContextSizeResponse;<commit_msg>Added missing optional tags<commit_after>// Type definitions for facebook-instant-games 6.1
// Project: https://developers.facebook.com/docs/games/instant-games
// Definitions by: <NAME> <https://github.com/menushka>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

declare namespace FBInstant {
    let player: Player;
    let context: Context;
    let payments: Payments;

    function getLocale(): string;
    function getPlatform(): string;
    function getSDKVersion(): string;
    function initializeAsync(): Promise<any>;
    function setLoadingProgress(progress: number): void;
    function getSupportedAPIs(): string[];
    function getEntryPointData(): any;
    function getEntryPointAsync(): Promise<string>;
    function setSessionData(sessionData: any): void;
    function startGameAsync(): Promise<any>;
    function shareAsync(payload: SharePayload): Promise<void>;
    function updateAsync(payload: UpdatePayload): Promise<void>;
    function switchGameAsync(appID: string, data?: string): Promise<void>;
    function canCreateShortcutAsync(): Promise<boolean>;
    function createShortcutAsync(): Promise<void>;
    function quit(): void;
    function logEvent(eventName: string, valueToSum?: number, parameter?: any): APIError;
    function onPause(func: () => void): void;
    function getInterstitialAdAsync(placementID: string): Promise<AdInstance>;
    function getRewardedVideoAsync(placementID: string): Promise<AdInstance>;
    function matchPlayerAsync(matchTag?: string, switchContextWhenMatched?: boolean): Promise<void>;
    function checkCanPlayerMatchAsync(): Promise<boolean>;
    function getLeaderboardAsync(name: string): Promise<Leaderboard>;

    interface Player {
        getID(): string;
        getSignedPlayerInfoAsync(requestPayload: string): Promise<SignedPlayerInfo>;
        canSubscribeBotAsync(): Promise<boolean>;
        subscribeBotAsync(): Promise<void>;
        getName(): string;
        getPhoto(): string;
        getDataAsync(keys?: string[]): Promise<DataObject>;
        setDataAsync(data: DataObject): Promise<void>;
        flushDataAsync(): Promise<void>;
        getStatsAsync(keys?: string[]): Promise<StatsObject>;
        setStatsAsync(stats: StatsObject): Promise<void>;
        incrementStatsAsync(increments: IncrementObject): Promise<StatsObject>;
        getConnectedPlayersAsync(): Promise<ConnectedPlayer[]>;
    }

    interface Context {
        getID(): string;
        getType(): Type;
        isSizeBetween(minSize: number, maxSize: number): ContextSizeResponse;
{'fraction_non_alphanumeric': 0.11686274509803922, 'fraction_numerical': 0.000784313725490196, 'mean_word_length': 4.7314606741573035, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 55, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4810070', 'n_tokens_mistral': 1334, 'n_tokens_neox': 1294, 'n_words': 320}