warehouse icon indicating copy to clipboard operation
warehouse copied to clipboard

Better typescript types

Open D-Sketon opened this issue 1 month ago • 1 comments

Check List

  • [X] I have already read README.
  • [X] I have already searched existing issues.
  • [X] I have already searched existing pull requrests.

Feature Request

There are still some problems with the current type labeling for warehouses. For example: https://github.com/hexojs/warehouse/blob/83df5a1c54fd0d7e3249988dbb4718c6b08120ef/src/types/virtual.ts#L17 Actually, it should be:

get(fn: (this: Document<T>) => any): SchemaTypeVirtual<T> {}

However, it is difficult to refactor the type due to the following implementations: https://github.com/hexojs/warehouse/blob/83df5a1c54fd0d7e3249988dbb4718c6b08120ef/src/document.ts#L19-L23

Additional context

No response

D-Sketon avatar May 16 '24 15:05 D-Sketon