Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions docs/content/docs/contributing/api-modelling.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,8 @@ mutable fillStyle: fillStyle
When we wish to read and write the `fillStyle` property, we can use a helper module to lift the type to an actual ReScript variant:

export const fillStyleModule = `
open Prelude
open CanvasAPI
open DOMAPI
open WebApiCanvas
open WebApiDOM
external fromString: string => fillStyle = "%identity"
external fromCanvasGradient: canvasGradient => fillStyle = "%identity"
Expand Down
4 changes: 2 additions & 2 deletions docs/content/docs/philosophy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ let element: element = document->Document.createElement( ~localName = "div")
let node: node = element->Element.asNode
```

Any other conversions can be performed using the `Prelude.unsafeConversation` helper. This should be done with caution, as it can lead to runtime errors.
Any other conversions can be performed using the `Base.unsafeConversation` helper. This should be done with caution, as it can lead to runtime errors.

```ReScript
open WebAPI

let element: element = document->Document.createElement( ~localName = "div")
// This is potentially unsafe, as the type system cannot guarantee the conversion
let divElement: htmlDivElement = element->Prelude.unsafeConversation
let divElement: htmlDivElement = element->Base.unsafeConversation
```
Loading