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
Logger
proposal with .d.ts
File
#3067
Conversation
For JS API with intended `Logger` functionality
@nex3, I assume you want the |
Logger
proposal with '.d.ts' FileLogger
proposal with .d.ts
File
Yes, let's make the |
Done |
FYI, I've added a TypeScript formatter and run it on your |
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.
Thanks for taking the time to write out the entire API!
index.d.ts
Outdated
export function renderSync(options: Options): Result; | ||
|
||
export namespace types { | ||
abstract class SassType {} |
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.
Dart Sass doesn't export any object with this name, and I don't think Node Sass does either.
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.
This way just an easy way to add it to the functions
parameter - it's not actually exported.
The alternative is types.Null | types.Number | types.String | ....
How would you like to proceed?
index.d.ts
Outdated
setA(value: number): void; | ||
} | ||
|
||
class List<T extends SassType = SassType> implements SassType { |
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.
Sass doesn't consider its lists or maps to be typed, so I don't think this API should either.
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.
So they should just be List<unknown>
and Map<unknown>
, is that right?
Commenting/documenting everything Dropped unnecessary exports Added exports to types Various other changes - highlighted by @nex3
Resolved sass#3067 (comment)
Did you want the interfaces to be types? It's the same but they're more strict (reference) |
Thanks @glenn2223! I can take it from here, starting with splitting out the TS definition of the existing API into the |
Closing this out in favor of #3074. |
A proposal for a JS
Logging
mechanism plus a.d.ts
file for shipping with the npm packageRefs: #2979, sass/dart-sass#13