Skip to content

Commit

Permalink
add interfaces for dataSafety function (#664)
Browse files Browse the repository at this point in the history
* add interfaces for dataSafety function

* modify the return type of the reviews function
  • Loading branch information
ElhoussinRazouki authored Oct 2, 2023
1 parent b7afb7d commit ca910fa
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,13 @@ export interface IPermissionItem {
type: string
}

export interface IDataSafetyItem {
data : string
optional : string
purpose : string
type : string
}

// functions

interface IOptions {
Expand Down Expand Up @@ -259,8 +266,14 @@ export interface IFnReviewsOptions extends IOptions {
nextPaginationToken?: string
}


export interface IReviewsResult{
reviews : IReviewsItem[]
nextPaginationToken? : string
}

export interface IFnReviews {
(options: IFnReviewsOptions): Promise<IReviewsItem[]>
(options: IFnReviewsOptions): Promise<IReviewsResult>
}

// -- similar
Expand Down Expand Up @@ -293,8 +306,16 @@ export interface IFnCategories {
(options?: IFnCategoriesOptions): Promise<string[]>
}

// memoization
// datasafety
export interface IFnDatasafetyOptions extends IOptions {
appId: string
lang?: string
}
export interface IFnDataSafety {
(options?: IFnDatasafetyOptions): Promise<IDataSafetyItem[]>
}

// memoization
export interface IMemoizedResult {
category: category,
collection: collection,
Expand All @@ -310,6 +331,7 @@ export interface IMemoizedResult {
similar: IFnSimilar
permissions: IFnPermissions
categories: IFnCategories
datasafety: IFnDataSafety
}

export interface IFnMemoized {
Expand All @@ -325,4 +347,5 @@ export const reviews: IFnReviews
export const similar: IFnSimilar
export const permissions: IFnPermissions
export const categories: IFnCategories
export const datasafety : IFnDataSafety
export const memoized: IFnMemoized

0 comments on commit ca910fa

Please sign in to comment.