@types/google.picker
Advanced tools
Comparing version 0.0.35 to 0.0.36
@@ -1,8 +0,14 @@ | ||
// Type definitions for Google Picker API | ||
// Type definitions for non-npm package Google Picker API 0.0 | ||
// Project: https://developers.google.com/picker/ | ||
// Definitions by: grapswiz <https://github.com/grapswiz> | ||
// Chives <https://github.com/chivesrs> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
type DOMDocument = Document; | ||
declare namespace google { | ||
namespace picker { | ||
/** | ||
* https://developers.google.com/picker/docs/reference#picker-builder | ||
*/ | ||
export class PickerBuilder { | ||
@@ -12,85 +18,135 @@ constructor(); | ||
// Add a View to the navigation pane. | ||
addView(viewOrId:any):PickerBuilder; | ||
addView(viewOrViewId: DocsView | DocsUploadView | ViewId): PickerBuilder; | ||
// Add a ViewGroup to the top-level navigation pane. | ||
addViewGroup(viewGroup:any):PickerBuilder; | ||
addViewGroup(viewGroup: ViewGroup): PickerBuilder; | ||
// Construct the Picker object. The Picker object is returned. | ||
build(): Picker; | ||
// Disable a picker feature. | ||
disableFeature(feature:string):PickerBuilder; | ||
disableFeature(feature: Feature): PickerBuilder; | ||
// Enable a picker feature. | ||
enableFeature(feature:string):PickerBuilder; | ||
enableFeature(feature: Feature): PickerBuilder; | ||
// Get the relay URL, used for gadgets.rpc. | ||
getRelayUrl():string; | ||
getRelayUrl(): string; | ||
// Get the dialog title. | ||
getTitle():string; | ||
getTitle(): string; | ||
// Disable the title bar from being shown. To re-enable, call setTitle with a non-empty title or undefined. | ||
hideTitleBar():PickerBuilder; | ||
hideTitleBar(): PickerBuilder; | ||
// Check if a picker Feature is enabled. | ||
isFeatureEnabled(feature:string):boolean; | ||
isFeatureEnabled(feature: Feature): boolean; | ||
// Sets the Google Drive App ID needed to allow application to access the user's files via the Google Drive API. | ||
setAppId(appId:string):PickerBuilder; | ||
setAppId(appId: string): PickerBuilder; | ||
// Set the callback method called when the user picks and item (or items), or cancels. The callback method receives a single callback object. The structure of the callback object is described in the JSON Guide. | ||
setCallback(method:Function):PickerBuilder; | ||
setCallback(method: (result: ResponseObject) => void): PickerBuilder; | ||
// Sets the Browser API key obtained from Google Developers Console. See the Developer's Guide for details on how to obtain the Browser API key. | ||
setDeveloperKey(key:string):PickerBuilder; | ||
setDeveloperKey(key: string): PickerBuilder; | ||
// Set the document. | ||
setDocument(document:string):PickerBuilder; | ||
setDocument(document: DOMDocument): PickerBuilder; | ||
// ISO 639 language code. If the language is not supported, en-US is used. This method provides an alternative to setting the locale at google.load() time. See the Developer's Guide for a list of supported locales. | ||
setLocale(locale:string):PickerBuilder; | ||
setLocale(locale: string): PickerBuilder; | ||
// Sets the maximum number of items a user can pick. | ||
setMaxItems(max: number):PickerBuilder; | ||
setMaxItems(max: number): PickerBuilder; | ||
// Sets an OAuth token to use for authenticating the current user. Depending on the scope of the token, only certain views will display data. Valid scopes are Google Docs, Drive, Photos, YouTube. | ||
setOAuthToken(token:string):PickerBuilder; | ||
setOAuthToken(token: string): PickerBuilder; | ||
// Sets the origin of picker dialog. The origin should be set to the window.location.protocol + '//' + window.location.host of the top-most page, if your application is running in an iframe. | ||
setOrigin(origin:string):PickerBuilder; | ||
setOrigin(origin: string): PickerBuilder; | ||
// Set the relay URL, used for gadgets.rpc. | ||
setRelayUrl(url:string):PickerBuilder; | ||
setRelayUrl(url: string): PickerBuilder; | ||
// Set the list of MIME types which will be selectable. Use commas to separate MIME types if more than one is required. | ||
setSelectableMimeTypes(type:string):PickerBuilder; | ||
setSelectableMimeTypes(type: string): PickerBuilder; | ||
// Set the preferred dialog size. The dialog will be auto-centered. It has a minimum size of (566,350) and a maximum size of (1051,650). | ||
setSize(width:number, height:number):PickerBuilder; | ||
setSize(width: number, height: number): PickerBuilder; | ||
// Set the dialog title. | ||
setTitle(title:string):PickerBuilder; | ||
setTitle(title: string): PickerBuilder; | ||
// Specify an album ID for photo uploads. See Picasa Web Albums Data API documentation for more information about albums. | ||
setUploadToAlbumId(albumId:string):PickerBuilder; | ||
// Returns the URI generated by this builder. | ||
toUri():string; | ||
// Construct the Picker object. The Picker object is returned. | ||
build():Picker; | ||
toUri(): string; | ||
} | ||
/** | ||
* Picker is the top level object representing the UI action with the user. These objects are not created directly, but instead use the PickerBuilder object. | ||
* https://developers.google.com/picker/docs/reference#picker. | ||
*/ | ||
export interface Picker { | ||
isVisible(): boolean; | ||
setCallback(method:Function):Picker; | ||
setRelayUrl(url:string):Picker; | ||
setVisible(visible:boolean):Picker; | ||
dispose():void; | ||
setCallback(method: (result: ResponseObject) => void): Picker; | ||
setRelayUrl(url: string): Picker; | ||
setVisible(visible: boolean): Picker; | ||
dispose(): void; | ||
} | ||
/** | ||
* Use DocsUploadView to upload documents to Google Drive. | ||
* https://developers.google.com/picker/docs/results | ||
*/ | ||
export interface ResponseObject { | ||
[Response.ACTION]: Action; | ||
[Response.DOCUMENTS]: DocumentObject[]; | ||
[Response.PARENTS]?: ParentDocumentObject[]; | ||
[Response.VIEW]: [ViewId, undefined, { query?: string; parent?: string }]; | ||
} | ||
export interface DocumentObject { | ||
[Document.ADDRESS_LINES]: string[]; | ||
[Document.AUDIENCE]: { [key: string]: string }; | ||
[Document.DESCRIPTION]: string; | ||
[Document.DURATION]: any; | ||
[Document.EMBEDDABLE_URL]: string; | ||
[Document.ICON_URL]: string; | ||
[Document.ID]: string; | ||
[Document.IS_NEW]: boolean; | ||
[Document.LAST_EDITED_UTC]: number; | ||
[Document.LATITUDE]: any; | ||
[Document.LONGITUDE]: any; | ||
[Document.MIME_TYPE]: string; | ||
[Document.NAME]: string; | ||
[Document.PARENT_ID]: string; | ||
[Document.PHONE_NUMBERS]: Array<{ type: string; number: any }>; | ||
[Document.SERVICE_ID]: ServiceId; | ||
[Document.THUMBNAILS]: DocumentThumbnailObject[]; | ||
[Document.TYPE]: Type; | ||
[Document.URL]: string; | ||
} | ||
export interface DocumentThumbnailObject { | ||
[Thumbnail.URL]: string; | ||
[Thumbnail.WIDTH]: number; | ||
[Thumbnail.HEIGHT]: number; | ||
} | ||
export interface ParentDocumentObject { | ||
[Document.AUDIENCE]: { [key: string]: string }; | ||
[Document.DESCRIPTION]: string; | ||
[Document.LAST_EDITED_UTC]: number; | ||
[Document.MIME_TYPE]: string; | ||
[Document.NAME]: string; | ||
[Document.ICON_URL]: string; | ||
[Document.ID]: string; | ||
[Document.IS_NEW]: boolean; | ||
[Document.SERVICE_ID]: ServiceId; | ||
[Document.THUMBNAILS]: DocumentThumbnailObject[]; | ||
[Document.TYPE]: Type; | ||
[Document.URL]: string; | ||
} | ||
/** | ||
* https://developers.google.com/picker/docs/reference#docs-upload-view. | ||
*/ | ||
export class DocsUploadView { | ||
@@ -100,140 +156,199 @@ constructor(); | ||
// Allows the user to select a folder in Google Drive to upload to. | ||
setIncludeFolders(included:boolean):DocsUploadView; | ||
setIncludeFolders(included: boolean): DocsUploadView; | ||
// Sets the upload destination to the specified folder. This overrides ".setIncludeFolders" to false. | ||
setParent(parentId:string):DocsUploadView; | ||
// Sets the upload destination to the specified folder. This overrides `.setIncludeFolders` to false. | ||
setParent(parentId: string): DocsUploadView; | ||
} | ||
/** | ||
* DocsView is a subclass of View that can be used for Google Drive views. | ||
* https://developers.google.com/picker/docs/reference#docs-view | ||
*/ | ||
export class DocsView { | ||
// Constructor. The ViewId must be one of the Google Drive views. Default is ViewId.DOCS. | ||
constructor(viewId?:string); | ||
constructor(viewId?: ViewId); | ||
// Show folders in the view items. | ||
setIncludeFolders(included:boolean):DocsView; | ||
setIncludeFolders(included: boolean): DocsView; | ||
// Allows the user to select a folder in Google Drive. | ||
setSelectFolderEnabled(enabled:boolean):DocsView; | ||
setSelectFolderEnabled(enabled: boolean): DocsView; | ||
// Selects which mode the view will use to display the documents. | ||
setMode(mode:string):DocsView; | ||
setMode(mode: DocsViewMode): DocsView; | ||
// Filters the documents based on whether they are owned by the user, or shared with the user. | ||
setOwnedByMe(me?:boolean):DocsView; | ||
setOwnedByMe(me?: boolean): DocsView; | ||
// Sets the initial parent folder to display. | ||
setParent(parentId:string):DocsView; | ||
setParent(parentId: string): DocsView; | ||
// Filters the documents based on whether they are starred by the user. | ||
setStarred(starred:boolean):DocsView; | ||
setStarred(starred: boolean): DocsView; | ||
// Allows the user to select folders from Shared Drives. | ||
setEnableDrives(enabled:boolean):DocsView; | ||
setEnableDrives(enabled: boolean): DocsView; | ||
// Set the MIME types which will be included in the view. Use commas to separate MIME types if more than one is required. | ||
setMimeTypes(mimeTypes:string):DocsView; | ||
setMimeTypes(mimeTypes: string): DocsView; | ||
} | ||
/** | ||
* DocsViewMode is an enumerated type for displaying data within a DocsView. Use these values in calls to DocsView.setMode. | ||
* https://developers.google.com/picker/docs/reference#view-group | ||
*/ | ||
export var DocsViewMode:{ | ||
export class ViewGroup { | ||
// Constructor. A ViewGroup is a visual grouping of Views in the navigation pane. The root item of the ViewGroup itself must be View. | ||
constructor(viewOrId: DocsView | ViewId); | ||
// Add a label to this ViewGroup. | ||
addLabel(label: string): ViewGroup; | ||
// Add a view to the ViewGroup. The View can be represented by a view-derived object, or simply by ViewId. | ||
addView(viewOrId: DocsView | ViewId): ViewGroup; | ||
// Nest a ViewGroup within the current ViewGroup. | ||
addViewGroup(viewGroup: ViewGroup): ViewGroup; | ||
} | ||
/** | ||
* https://developers.google.com/picker/docs/reference#docs-view-mode | ||
*/ | ||
export enum DocsViewMode { | ||
// Display documents in a thumbnail grid. | ||
GRID: string; | ||
GRID = "grid", | ||
// Display documents in a detailed list. | ||
LIST: string; | ||
}; | ||
LIST = "list", | ||
} | ||
export var Feature:{ | ||
/** | ||
* https://developers.google.com/picker/docs/reference#feature | ||
*/ | ||
export enum Feature { | ||
// Show only documents owned by the user when showing items from Google Drive. | ||
MINE_ONLY: string; | ||
MINE_ONLY = "mineOnly", | ||
// Allow user to choose more than one item. | ||
MULTISELECT_ENABLED: string; | ||
MULTISELECT_ENABLED = "multiselectEnabled", | ||
// Hide the navigation pane. If the navigation pane is hidden, users can only select from the first view chosen. | ||
NAV_HIDDEN: string; | ||
NAV_HIDDEN = "navHidden", | ||
// For photo uploads, controls whether per-photo selection (as opposed to per-album) selection is enabled. | ||
SIMPLE_UPLOAD_ENABLED: string; | ||
SIMPLE_UPLOAD_ENABLED = "simpleUploadEnabled", | ||
// Whether Shared Drive items should be included in results. | ||
SUPPORT_DRIVES: string; | ||
}; | ||
SUPPORT_DRIVES = "sdr", | ||
} | ||
export var ViewId:{ | ||
DOCS: string; | ||
DOCS_IMAGES: string; | ||
DOCS_IMAGES_AND_VIDEOS: string; | ||
DOCS_VIDEOS: string; | ||
DOCUMENTS: string; | ||
DRAWINGS: string; | ||
FOLDERS: string; | ||
FORMS: string; | ||
IMAGE_SEARCH: string; | ||
MAPS: string; | ||
PDFS: string; | ||
PHOTOS: string; | ||
PHOTO_ALBUMS: string; | ||
PHOTO_UPLOAD: string; | ||
PRESENTATIONS: string; | ||
RECENTLY_PICKED: string; | ||
SPREADSHEETS: string; | ||
VIDEO_SEARCH: string; | ||
WEBCAM: string; | ||
YOUTUBE: string; | ||
}; | ||
/** | ||
* https://developers.google.com/picker/docs/reference#view-id | ||
*/ | ||
export enum ViewId { | ||
DOCS = "all", | ||
DOCS_IMAGES = "docs-images", | ||
DOCS_IMAGES_AND_VIDEOS = "docs-images-and-videos", | ||
DOCS_VIDEOS = "docs-videos", | ||
DOCUMENTS = "documents", | ||
DRAWINGS = "drawings", | ||
FOLDERS = "folders", | ||
FORMS = "forms", | ||
/** @deprecated */ | ||
IMAGE_SEARCH = "image-search", | ||
PDFS = "pdfs", | ||
/** @deprecated */ | ||
PHOTO_ALBUMS = "photo-albums", | ||
/** @deprecated */ | ||
PHOTO_UPLOAD = "photo-upload", | ||
/** @deprecated */ | ||
PHOTOS = "photos", | ||
PRESENTATIONS = "presentations", | ||
/** @deprecated */ | ||
RECENTLY_PICKED = "recently-picked", | ||
SPREADSHEETS = "spreadsheets", | ||
/** @deprecated */ | ||
VIDEO_SEARCH = "video-search", | ||
/** @deprecated */ | ||
WEBCAM = "webcam", | ||
/** @deprecated */ | ||
YOUTUBE = "youtube", | ||
} | ||
export var Action:{ | ||
CANCEL: string; | ||
PICKED: string; | ||
}; | ||
/** | ||
* https://developers.google.com/picker/docs/reference#action | ||
*/ | ||
export enum Action { | ||
CANCEL = "cancel", | ||
PICKED = "picked", | ||
} | ||
/** | ||
* Document is an enumerated type used to convey information about a specific picked item. Only fields which are relevant to the selected item are returned. This value will be in the Response.DOCUMENTS field in the callback data. | ||
* https://developers.google.com/picker/docs/reference#document | ||
*/ | ||
export var Document:{ | ||
ADDRESS_LINES: string; | ||
AUDIENCE: string; | ||
DESCRIPTION: string; | ||
DURATION: string; | ||
EMBEDDABLE_URL: string; | ||
ICON_URL: string; | ||
ID: string; | ||
IS_NEW: string; | ||
LAST_EDITED_UTC: string; | ||
LATITUDE: string; | ||
LONGITUDE: string; | ||
MIME_TYPE: string; | ||
NAME: string; | ||
NUM_CHILDREN: string; | ||
PARENT_ID: string; | ||
PHONE_NUMBERS: string; | ||
SERVICE_ID: string; | ||
THUMBNAILS: string; | ||
TYPE: string; | ||
URL: string; | ||
}; | ||
export enum Document { | ||
ADDRESS_LINES = "addressLines", | ||
/** @deprecated */ | ||
AUDIENCE = "audience", | ||
DESCRIPTION = "description", | ||
DURATION = "duration", | ||
EMBEDDABLE_URL = "embedUrl", | ||
ICON_URL = "iconUrl", | ||
ID = "id", | ||
IS_NEW = "isNew", | ||
LAST_EDITED_UTC = "lastEditedUtc", | ||
LATITUDE = "latitude", | ||
LONGITUDE = "longitude", | ||
MIME_TYPE = "mimeType", | ||
NAME = "name", | ||
NUM_CHILDREN = "numChildren", | ||
PARENT_ID = "parentId", | ||
PHONE_NUMBERS = "phoneNumbers", | ||
SERVICE_ID = "serviceId", | ||
THUMBNAILS = "thumbnails", | ||
TYPE = "type", | ||
URL = "url", | ||
} | ||
/** | ||
* Response is an enumerated type used to convey information about the user's picked items. | ||
* https://developers.google.com/picker/docs/reference#response | ||
*/ | ||
export var Response:{ | ||
ACTION: string; | ||
DOCUMENTS: string; | ||
PARENTS: string; | ||
VIEW: string; | ||
}; | ||
export enum Response { | ||
ACTION = "action", | ||
DOCUMENTS = "docs", | ||
PARENTS = "parents", | ||
VIEW = "viewToken", | ||
} | ||
export var Type:{ | ||
ALBUM: string; | ||
DOCUMENT: string; | ||
LOCATION: string; | ||
PHOTO: string; | ||
URL: string; | ||
VIDEO: string; | ||
}; | ||
/** | ||
* https://developers.google.com/picker/docs/reference#service-id | ||
*/ | ||
export enum ServiceId { | ||
DOCS = "docs", | ||
MAPS = "maps", | ||
PHOTOS = "picasa", | ||
SEARCH_API = "search-api", | ||
URL = "url", | ||
YOUTUBE = "youtube", | ||
} | ||
/** | ||
* https://developers.google.com/picker/docs/reference#thumbnail | ||
*/ | ||
export enum Thumbnail { | ||
HEIGHT = "height", | ||
WIDTH = "width", | ||
URL = "url", | ||
} | ||
/** | ||
* https://developers.google.com/picker/docs/reference#type | ||
*/ | ||
export enum Type { | ||
/** @deprecated */ | ||
ALBUM = "album", | ||
DOCUMENT = "document", | ||
LOCATION = "location", | ||
PHOTO = "photo", | ||
URL = "url", | ||
VIDEO = "video", | ||
} | ||
} | ||
} |
{ | ||
"name": "@types/google.picker", | ||
"version": "0.0.35", | ||
"version": "0.0.36", | ||
"description": "TypeScript definitions for Google Picker API", | ||
@@ -11,2 +11,7 @@ "license": "MIT", | ||
"githubUsername": "grapswiz" | ||
}, | ||
{ | ||
"name": "Chives", | ||
"url": "https://github.com/chivesrs", | ||
"githubUsername": "chivesrs" | ||
} | ||
@@ -23,4 +28,4 @@ ], | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "8e34921dd68e3edb92bc5acd7b3377883aedc9415cd31af89fd19057e56b1907", | ||
"typesPublisherContentHash": "1fe5eee0e2b11bd32a8c296cd3e8eae81789aa004180043ea6d417027656693d", | ||
"typeScriptVersion": "3.5" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Mon, 15 Mar 2021 18:54:33 GMT | ||
* Last updated: Fri, 19 Mar 2021 06:41:06 GMT | ||
* Dependencies: none | ||
@@ -17,2 +17,2 @@ * Global values: `google` | ||
# Credits | ||
These definitions were written by [grapswiz](https://github.com/grapswiz). | ||
These definitions were written by [grapswiz](https://github.com/grapswiz), and [Chives](https://github.com/chivesrs). |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
16071
294
1