mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-21 13:01:01 +08:00
docs(localStorage): update docs to use correct types
References https://github.com/driftyco/ionic-site/issues/546
This commit is contained in:
@ -22,7 +22,7 @@ import {StorageEngine} from './storage';
|
|||||||
* export class MyClass{
|
* export class MyClass{
|
||||||
* constructor(){
|
* constructor(){
|
||||||
* this.local = new Storage(LocalStorage);
|
* this.local = new Storage(LocalStorage);
|
||||||
* this.local.set('didTutorial', true);
|
* this.local.set('didTutorial', 'true');
|
||||||
* }
|
* }
|
||||||
*}
|
*}
|
||||||
*```
|
*```
|
||||||
@ -36,7 +36,7 @@ export class LocalStorage extends StorageEngine {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the value of a key in LocalStorage
|
* Get the value of a key in LocalStorage
|
||||||
* @param {String} key the key you want to lookup in LocalStorage
|
* @param {string} key the key you want to lookup in LocalStorage
|
||||||
*/
|
*/
|
||||||
get(key: string): Promise<string> {
|
get(key: string): Promise<string> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
@ -51,8 +51,8 @@ export class LocalStorage extends StorageEngine {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a key value pair and save it to LocalStorage
|
* Set a key value pair and save it to LocalStorage
|
||||||
* @param {String} key the key you want to save to LocalStorage
|
* @param {string} key the key you want to save to LocalStorage
|
||||||
* @param {Any} value the value of the key you're saving
|
* @param {string} value the value of the key you're saving
|
||||||
*/
|
*/
|
||||||
set(key: string, value: string): Promise<any> {
|
set(key: string, value: string): Promise<any> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
@ -67,7 +67,7 @@ export class LocalStorage extends StorageEngine {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove a key from LocalStorage
|
* Remove a key from LocalStorage
|
||||||
* @param {String} key the key you want to remove from LocalStorage
|
* @param {string} key the key you want to remove from LocalStorage
|
||||||
*/
|
*/
|
||||||
remove(key: string): Promise<any> {
|
remove(key: string): Promise<any> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
Reference in New Issue
Block a user