Skip to content

Commit

Permalink
Clean up docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Feb 14, 2025
1 parent 8bba7ad commit f7862cb
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
9 changes: 5 additions & 4 deletions README.id-ID.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Mendukung penjelajah (browser) modern, IE [dengan Babel](https://developer.epage
- [PouchDB dan CouchDB](#pouchdb-dan-couchdb)
- [Web Workers](#web-workers)
- [CLI](#cli)
- [TypeScript](#typescript)
- [Bahasa Pemrograman Lainnya](#bahasa-pemrograman-lainnya)
- [Alat](#alat)

Expand Down Expand Up @@ -308,8 +309,11 @@ Nano ID memungkinkan untuk mengubah string yang dihasilkan menjadi string opak
dalam TypeScript. Sebagai contoh:

```ts
type UserId = string & { [userIdBrand]: true }
declare const userIdBrand: unique symbol
type UserId = string & { [userIdBrand]: true }

// Gunakan parameter tipe secara eksplisit:
mockUser(nanoid<UserId>())

interface User {
id: UserId
Expand All @@ -321,9 +325,6 @@ const user: User = {
id: nanoid(),
name: 'Alice'
}

// Gunakan parameter tipe secara eksplisit:
mockUser(nanoid<UserId>())
```

### Bahasa Pemrograman Lainnya
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ model.id = nanoid() //=> "V1StGXR8_Z5jdHi6B-myT"
- [PouchDB and CouchDB](#pouchdb-and-couchdb)
- [Web Workers](#web-workers)
- [CLI](#cli)
- [TypeScript](#typescript)
- [Other Programming Languages](#other-programming-languages)
- [Tools](#tools)

Expand Down Expand Up @@ -422,8 +423,11 @@ Nano ID allows casting generated strings into opaque strings in TypeScript.
For example:

```ts
type UserId = string & { [userIdBrand]: true }
declare const userIdBrand: unique symbol
type UserId = string & { [userIdBrand]: true }

// Use explicit type parameter:
mockUser(nanoid<UserId>())

interface User {
id: UserId
Expand All @@ -435,9 +439,6 @@ const user: User = {
id: nanoid(),
name: 'Alice'
}

// Use explicit type parameter:
mockUser(nanoid<UserId>())
```

### Other Programming Languages
Expand Down
9 changes: 5 additions & 4 deletions README.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ model.id = nanoid() //=> "V1StGXR8_Z5jdHi6B-myT"
- [PouchDB и CouchDB](#pouchdb-и-couchdb)
- [Веб-воркеры](#веб-воркеры)
- [Терминал](#терминал)
- [TypeScript](#typescript)
- [Другие языки программирования](#другие-языки-программирования)
- [Инструменты](#инструменты)

Expand Down Expand Up @@ -402,8 +403,11 @@ Nano ID позволяет приводить сгенерированные с
TypeScript. Например:

```ts
type UserId = string & { [userIdBrand]: true }
declare const userIdBrand: unique symbol
type UserId = string & { [userIdBrand]: true }

// Используйте явный параметр типа:
mockUser(nanoid<UserId>())

interface User {
id: UserId
Expand All @@ -415,9 +419,6 @@ const user: User = {
id: nanoid(),
name: 'Alice'
}

// Используйте явный параметр типа:
mockUser(nanoid<UserId>())
```

### Другие языки программирования
Expand Down
9 changes: 5 additions & 4 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ model.id = nanoid() //=> "V1StGXR8_Z5jdHi6B-myT"
- [PouchDB and CouchDB](#pouchdb-and-couchdb)
- [Web Workers](#web-workers)
- [CLI](#cli)
- [TypeScript](#typescript)
- [其他编程语言](#其他编程语言)
- [工具](#工具)

Expand Down Expand Up @@ -375,8 +376,11 @@ bccbcabaabaccab
Nano ID 允许将生成的字符串转换为 TypeScript 中的不透明字符串。 例如:

```ts
type UserId = string & { [userIdBrand]: true }
declare const userIdBrand: unique symbol
type UserId = string & { [userIdBrand]: true }

// 使用显式类型参数:
mockUser(nanoid<UserId>())

interface User {
id: UserId
Expand All @@ -388,9 +392,6 @@ const user: User = {
id: nanoid(),
name: 'Alice'
}

// 使用显式类型参数:
mockUser(nanoid<UserId>())
```

### 其他编程语言
Expand Down

0 comments on commit f7862cb

Please sign in to comment.