Skip to content

Commit

Permalink
Fix: Verify exported types
Browse files Browse the repository at this point in the history
  • Loading branch information
ChakshuGautam committed Jun 24, 2023
1 parent caa291d commit 39708ba
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
5 changes: 3 additions & 2 deletions examples/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const dsdk = require('digilocker-sdk');
// const dsdk = require('digilocker-sdk');
const { DigiLockerDocumentType } = require('../dist');

console.log(dsdk.sum(10, 5));
console.log(DigiLockerDocumentType);
12 changes: 12 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
export {
Document,
DigiLockerDocumentType,
DocumentMapping,
DocumentSearchFilter,
Issuer,
LoginError,
LoginMetadata,
User,
PersistFunction,
PersistResponse,
} from './types';
export const sum = (a: number, b: number) => {
if ('development' === process.env.NODE_ENV) {
console.log('Testing');
Expand Down
4 changes: 2 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ export interface LoginMetadata {
accessToken: string;
}

type PersistResponse<T> = {
export type PersistResponse<T> = {
status: 'success' | 'error';
data: T;
};

type PersistFunction = (user: User) => Promise<PersistResponse<User>>;
export type PersistFunction = (user: User) => Promise<PersistResponse<User>>;

export interface DocumentSearchFilter {
DigiLockerDocumentType: DigiLockerDocumentType[];
Expand Down

0 comments on commit 39708ba

Please sign in to comment.