From d8919bf92a718ae5f955eaec02ba29729cda2124 Mon Sep 17 00:00:00 2001 From: sho Date: Fri, 28 Feb 2020 03:23:51 +0900 Subject: [PATCH] feat: add types for getContext function --- index.d.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/index.d.ts b/index.d.ts index 6ae7c05..f317790 100644 --- a/index.d.ts +++ b/index.d.ts @@ -104,6 +104,15 @@ declare interface Friendship { friendFlag: boolean } +declare type LiffContextData = { + type: 'utou' | 'room' | 'group' | 'none', + viewType: 'compact' | 'tall' | 'full', + userId?: string, + utouId?: string, + roomId?: string, + groupId?: string, + } + declare global { namespace liff { /** @@ -156,6 +165,11 @@ declare global { */ function logout(): void + /** + * Gets the screen type (1-on-1 chat, group, or room) and the ID that identifies the screen from which the LIFF application is launched. + */ + function getContext(): LiffContextData + /** * Opens the specified URL in the in-app browser of LINE or external browser. */