mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-05-31 18:10:46 +08:00
[skip ci] add iid TS examples
This commit is contained in:
24
packages/iid/lib/index.d.ts
vendored
24
packages/iid/lib/index.d.ts
vendored
@@ -39,6 +39,12 @@ export namespace Iid {
|
||||
*
|
||||
* Once an Instance ID is generated, Firebase periodically sends information about the application
|
||||
* and the device it's running on to the Firebase backend. To stop this, see `delete()`.
|
||||
*
|
||||
* #### Example
|
||||
*
|
||||
* ```js
|
||||
* const id = iid().get();
|
||||
* ```
|
||||
*/
|
||||
get(): Promise<string>;
|
||||
|
||||
@@ -47,12 +53,24 @@ export namespace Iid {
|
||||
* backend that was started when the Instance ID was generated.
|
||||
*
|
||||
* A new Instance ID is asynchronously generated unless auto initialisation is turned off.
|
||||
*
|
||||
* #### Example
|
||||
*
|
||||
* ```js
|
||||
* await iid().delete();
|
||||
* ```
|
||||
*/
|
||||
delete(): Promise<void>;
|
||||
|
||||
/**
|
||||
* Returns a token that authorizes an Entity to perform an action on behalf of the application.
|
||||
*
|
||||
* #### Example
|
||||
*
|
||||
* ```js
|
||||
* const token = await iid().getToken(firebase.app().options.storageBucket, '*');
|
||||
* ```
|
||||
*
|
||||
* @param authorizedEntity Entity authorized by the token. Defaults to the apps `messagingSenderId` option.
|
||||
* @param scope Action authorized for authorizedEntity. Defaults to '*'.
|
||||
*/
|
||||
@@ -61,6 +79,12 @@ export namespace Iid {
|
||||
/**
|
||||
* Revokes access to a scope for an entity previously authorized by `getToken()`.
|
||||
*
|
||||
* #### Example
|
||||
*
|
||||
* ```js
|
||||
* await iid().deleteToken(firebase.app().options.storageBucket, '*');
|
||||
* ```
|
||||
*
|
||||
* @param authorizedEntity Entity authorized by the token. Defaults to the apps' `messagingSenderId` option.
|
||||
* @param scope Action authorized for authorizedEntity. Defaults to '*'.
|
||||
*/
|
||||
|
||||
@@ -26,6 +26,12 @@ export interface Module extends ReactNativeFirebaseModule {
|
||||
*
|
||||
* Once an Instance ID is generated, Firebase periodically sends information about the application
|
||||
* and the device it's running on to the Firebase backend. To stop this, see `delete()`.
|
||||
*
|
||||
* #### Example
|
||||
*
|
||||
* ```js
|
||||
* const id = iid().get();
|
||||
* ```
|
||||
*/
|
||||
get(): Promise<string>;
|
||||
|
||||
@@ -34,12 +40,24 @@ export interface Module extends ReactNativeFirebaseModule {
|
||||
* backend that was started when the Instance ID was generated.
|
||||
*
|
||||
* A new Instance ID is asynchronously generated unless auto initialisation is turned off.
|
||||
*
|
||||
* #### Example
|
||||
*
|
||||
* ```js
|
||||
* await iid().delete();
|
||||
* ```
|
||||
*/
|
||||
delete(): Promise<void>;
|
||||
|
||||
/**
|
||||
* Returns a token that authorizes an Entity to perform an action on behalf of the application.
|
||||
*
|
||||
* #### Example
|
||||
*
|
||||
* ```js
|
||||
* const token = await iid().getToken(firebase.app().options.storageBucket, '*');
|
||||
* ```
|
||||
*
|
||||
* @param authorizedEntity Entity authorized by the token. Defaults to the apps `messagingSenderId` option.
|
||||
* @param scope Action authorized for authorizedEntity. Defaults to '*'.
|
||||
*/
|
||||
@@ -48,6 +66,12 @@ export interface Module extends ReactNativeFirebaseModule {
|
||||
/**
|
||||
* Revokes access to a scope for an entity previously authorized by `getToken()`.
|
||||
*
|
||||
* #### Example
|
||||
*
|
||||
* ```js
|
||||
* await iid().deleteToken(firebase.app().options.storageBucket, '*');
|
||||
* ```
|
||||
*
|
||||
* @param authorizedEntity Entity authorized by the token. Defaults to the apps' `messagingSenderId` option.
|
||||
* @param scope Action authorized for authorizedEntity. Defaults to '*'.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user