-
Notifications
You must be signed in to change notification settings - Fork 20
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
Export interfaces for function signatures #1161
base: main
Are you sure you want to change the base?
Conversation
} | { | ||
startValue: T; | ||
endValue?: T; | ||
}; |
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.
Previously startValue
and endValue
were both typed as being required, but this isn't strictly the case -- either the start value or the end value can be omitted from the range.
endValue?: T; | ||
}; | ||
|
||
export type AllowedBucketTypes = string | number | boolean; |
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.
General question: when a query returns an aggregation through a client(myQuery).executeFunction
call, at what point do these get narrowed based on the exact types in the query definition? From the looks of it I still need to switch on the string case, the number case and the boolean case to properly handle the output.
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.
If I am understanding the question, the generated types reflect the reality? e.g. https://github.com/palantir/osdk-ts/blob/main/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/queries/queryTakesAllParameterTypes.ts
export type Integer<T extends number = number> = T; | ||
export type Float<T extends number = number> = T; | ||
export type Double<T extends number = number> = T; | ||
export type Long<T extends string = string> = T; |
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.
I wonder if we should brand these? (Truly a question, Im wondering without a brand do the aliases get erased making the static analysis harder?)
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.
For analysis purpose branding these strings would definitely be nice to prevent the compiler from interning the types.
Export interfaces for the following:
Would a new package
@osdk/functions
be a better place to export these types?