docs: convert code examples to TypeScript
All code examples in installation.md and quick-start.md were tagged as javascript — converted to typescript throughout. quick-start.md also gets explicit type annotations: - reactId/nextId declared as string (return type of brain.add) - results declared as FindResult[] - results[0].data and results[0].score shown in console.log example
This commit is contained in:
parent
fae88d0fdd
commit
791cacc6c0
2 changed files with 15 additions and 13 deletions
|
|
@ -34,7 +34,7 @@ pnpm add @soulcraft/brainy
|
|||
|
||||
## Verify
|
||||
|
||||
```javascript
|
||||
```typescript
|
||||
import { Brainy } from '@soulcraft/brainy'
|
||||
|
||||
const brain = new Brainy()
|
||||
|
|
@ -51,7 +51,7 @@ For production workloads, add Cortex for Rust-accelerated SIMD distance calculat
|
|||
npm install @soulcraft/cortex
|
||||
```
|
||||
|
||||
```javascript
|
||||
```typescript
|
||||
import { Brainy } from '@soulcraft/brainy'
|
||||
import { registerCortex } from '@soulcraft/cortex'
|
||||
|
||||
|
|
@ -67,7 +67,7 @@ Cortex delivers a **5.2x geometric mean speedup** — see [Brainy vs Cortex](/do
|
|||
|
||||
Brainy works in the browser using the Origin Private File System:
|
||||
|
||||
```javascript
|
||||
```typescript
|
||||
import { Brainy } from '@soulcraft/brainy'
|
||||
|
||||
const brain = new Brainy({ storage: 'opfs' })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue