Matteo Scandolo | fc4b37b | 2017-02-02 12:18:47 -0800 | [diff] [blame^] | 1 | // Generated by typings |
| 2 | // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/angularjs/angular-cookies.d.ts |
| 3 | declare module "angular-cookies" { |
| 4 | var _: string; |
| 5 | export = _; |
| 6 | } |
| 7 | |
| 8 | /** |
| 9 | * ngCookies module (angular-cookies.js) |
| 10 | */ |
| 11 | declare namespace angular.cookies { |
| 12 | |
| 13 | /** |
| 14 | * Cookies options |
| 15 | * see https://docs.angularjs.org/api/ngCookies/provider/$cookiesProvider#defaults |
| 16 | */ |
| 17 | interface ICookiesOptions { |
| 18 | /** |
| 19 | * The cookie will be available only for this path and its sub-paths. |
| 20 | * By default, this would be the URL that appears in your base tag. |
| 21 | */ |
| 22 | path?: string; |
| 23 | /** |
| 24 | * The cookie will be available only for this domain and its sub-domains. |
| 25 | * For obvious security reasons the user agent will not accept the cookie if the |
| 26 | * current domain is not a sub domain or equals to the requested domain. |
| 27 | */ |
| 28 | domain?: string; |
| 29 | /** |
| 30 | * String of the form "Wdy, DD Mon YYYY HH:MM:SS GMT" or a Date object |
| 31 | * indicating the exact date/time this cookie will expire. |
| 32 | */ |
| 33 | expires?: string|Date; |
| 34 | /** |
| 35 | * The cookie will be available only in secured connection. |
| 36 | */ |
| 37 | secure?: boolean; |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * CookieService |
| 42 | * see http://docs.angularjs.org/api/ngCookies.$cookies |
| 43 | */ |
| 44 | interface ICookiesService { |
| 45 | [index: string]: any; |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * CookieStoreService |
| 50 | * see http://docs.angularjs.org/api/ngCookies.$cookieStore |
| 51 | */ |
| 52 | interface ICookiesService { |
| 53 | get(key: string): string; |
| 54 | getObject(key: string): any; |
| 55 | getObject<T>(key: string): T; |
| 56 | getAll(): any; |
| 57 | put(key: string, value: string, options?: ICookiesOptions): void; |
| 58 | putObject(key: string, value: any, options?: ICookiesOptions): void; |
| 59 | remove(key: string, options?: ICookiesOptions): void; |
| 60 | } |
| 61 | |
| 62 | /** |
| 63 | * CookieStoreService DEPRECATED |
| 64 | * see https://code.angularjs.org/1.2.26/docs/api/ngCookies/service/$cookieStore |
| 65 | */ |
| 66 | interface ICookieStoreService { |
| 67 | /** |
| 68 | * Returns the value of given cookie key |
| 69 | * @param key Id to use for lookup |
| 70 | */ |
| 71 | get(key: string): any; |
| 72 | /** |
| 73 | * Sets a value for given cookie key |
| 74 | * @param key Id for the value |
| 75 | * @param value Value to be stored |
| 76 | */ |
| 77 | put(key: string, value: any): void; |
| 78 | /** |
| 79 | * Remove given cookie |
| 80 | * @param key Id of the key-value pair to delete |
| 81 | */ |
| 82 | remove(key: string): void; |
| 83 | } |
| 84 | |
| 85 | } |