0

I am using a package in my TS application and I need to modify s particular interface in the typing.ts from the package.

the typings.d.ts of the package has this

export interface CreateSessionOptions {
            id: string;
            role?: 'user' | 'admin';
            sessionDuration?: number;
            data?: any;
        }

but I need to add an extra role super-admin. How can I modify this CreateSessionOptions

Any info would be supplied on request.

King
  • 1,885
  • 3
  • 27
  • 84

1 Answers1

0

Based on this you can't extend the interface that defined in d.ts file.

But instead create custom.d.ts file and add your extended interface. This is another example that shows how to extend interface in external library

Alireza Ahmadi
  • 8,579
  • 5
  • 15
  • 42