-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Export types used in the public interface (#22) #51
Conversation
Any type (class, interface, literal type, etc) that's used by Lambda Express' public API as a method return type, parameter type, or property type must be exported on `src/index.ts` so that it's available to be used in client code.
1 similar comment
StringUnknownMap, | ||
KeyValueStringObject, | ||
StringArrayOfStringsMap, | ||
} from '@silvermine/toolbox'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first glance, it may seem odd to just re-export types from '@silvermine/toolbox'
, but I did this for two reasons:
- If we don't, then we'd be forcing clients of
lambda-express
to depend on'@silvermine/toolbox'
directly if they want access to those types. - A client may already depend on
'@silvermine/toolbox'
in their code, but at a different version with a different API. This would allow them to use the types from'@silvermine/toolbox'
that their version oflambda-express
uses internally as needed, and the types from their version of'@silvermine/toolbox'
.
@@ -9,3 +9,37 @@ export { | |||
Response, | |||
Router, | |||
}; | |||
|
|||
// We need to export only types that are used in public interfaces (e.g. those used in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, I doubled-checked this list against the output from Microsoft's API Extractor tool to ensure that all of the types used in the public API are exported here, but I opened #49 to make considering integrating that tool a separate task. Integrating it will not be simple, and I'm not certain it will even completely meet our needs (it doesn't support literal type
definitions, etc).
Any type (class, interface, literal type, etc) that's used by Lambda
Express' public API as a method return type, parameter type, or property
type must be exported on
src/index.ts
so that it's available to beused in client code.