From b7e9dd2a986d1186fa413b694ca0471c3c0061bc Mon Sep 17 00:00:00 2001 From: Ryota Kameoka Date: Wed, 27 Sep 2017 03:22:50 +0900 Subject: [PATCH] [chrome] Add and utilize ColorArray type (#19836) * Add and utilize ColorArray type * fixup! Add and utilize ColorArray type --- types/chrome/index.d.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/types/chrome/index.d.ts b/types/chrome/index.d.ts index 42ba4c1804..5104ab7ca1 100644 --- a/types/chrome/index.d.ts +++ b/types/chrome/index.d.ts @@ -436,7 +436,7 @@ declare namespace chrome.bookmarks { declare namespace chrome.browserAction { interface BadgeBackgroundColorDetails { /** An array of four integers in the range [0,255] that make up the RGBA color of the badge. For example, opaque red is [255, 0, 0, 255]. Can also be a string with a CSS value, with opaque red being #FF0000 or #F00. */ - color: any; + color: string | ColorArray; /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */ tabId?: number; } @@ -448,6 +448,8 @@ declare namespace chrome.browserAction { tabId?: number; } + type ColorArray = [number, number, number, number]; + interface TitleDetails { /** The string the browser action should display when moused over. */ title: string; @@ -518,7 +520,7 @@ declare namespace chrome.browserAction { * @param callback The callback parameter should be a function that looks like this: * function( ColorArray result) {...}; */ - export function getBadgeBackgroundColor(details: TabDetails, callback: (result: number[]) => void): void; + export function getBadgeBackgroundColor(details: TabDetails, callback: (result: ColorArray) => void): void; /** * Since Chrome 19. * Gets the html document set as the popup for this browser action.