Skip to content

Commit

Permalink
Modify typescript code style
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex1990 committed Oct 30, 2018
1 parent b532c5e commit 29cc7bd
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions types/index.d.ts
@@ -1,5 +1,5 @@
type Decoder<T = string> = (value : string) => T;
type Encoder<T = string> = (value : T) => string;
type Decoder<T = string> = (value: string) => T;
type Encoder<T = string> = (value: T) => string;

interface Cookies<T = string> {
[key: string] : T
Expand All @@ -19,7 +19,7 @@ declare function isEnabled() : boolean;
/**
* Get the cookie value by key.
*/
declare function get<T = string>(key : string, decoder?: Decoder<T>) : T | null;
declare function get<T = string>(key: string, decoder?: Decoder<T>) : T | null;

/**
* Get all cookies
Expand All @@ -29,27 +29,27 @@ declare function getAll<T = string>(decoder?: Decoder<T>) : Cookies<T>;
/**
* Set a cookie.
*/
declare function set<T = string>(key : string, value : T, encoder : Encoder<T>, options?: CookieOptions) : void;
declare function set<T = string>(key: string, value: T, encoder : Encoder<T>, options?: CookieOptions) : void;

/**
* Set a cookie.
*/
declare function set(key : string, value : string, options?: CookieOptions) : void;
declare function set(key: string, value: string, options?: CookieOptions) : void;

/**
* Remove a cookie by the specified key.
*/
declare function remove(key : string, options?: CookieOptions) : void;
declare function remove(key: string, options?: CookieOptions) : void;

/**
* Get the cookie's value without decoding.
*/
declare function getRaw(key : string) : string | null;
declare function getRaw(key: string) : string | null;

/**
* Set a cookie without encoding the value.
*/
declare function setRaw(key : string, value : string, options?: CookieOptions) : void;
declare function setRaw(key: string, value: string, options?: CookieOptions) : void;

export {
isEnabled,
Expand Down

0 comments on commit 29cc7bd

Please sign in to comment.