Skip to content
Myr

Clean up docs

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Andrey Sitnik · committed by Andrey Sitnik · parent 8bba7ad · Browse files · 4 files+20 added−16 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+20 added−16 removed

  • other:+20 added−16 removed

4 files+20 added−16 removed

modified:README.id-ID.md+5 added-4 removed
45 unmodified lines
46 - [React Native](#react-native)47 - [PouchDB dan CouchDB](#pouchdb-dan-couchdb)48 - [Web Workers](#web-workers)49 - [CLI](#cli)50 - [TypeScript](#typescript)51 - [Bahasa Pemrograman Lainnya](#bahasa-pemrograman-lainnya)52- [Alat](#alat)5354
253 unmodified lines
308Nano ID memungkinkan untuk mengubah string yang dihasilkan menjadi string opak309dalam TypeScript. Sebagai contoh:310311```ts311type UserId = string & { [userIdBrand]: true }312declare const userIdBrand: unique symbol313type UserId = string & { [userIdBrand]: true }314315// Gunakan parameter tipe secara eksplisit:316mockUser(nanoid<UserId>())317318interface User {319 id: UserId320 name: string321}
2 unmodified lines
324 // Secara otomatis diubah menjadi UserId:325 id: nanoid(),326 name: 'Alice'327}324325// Gunakan parameter tipe secara eksplisit:326mockUser(nanoid<UserId>())328```329330### Bahasa Pemrograman Lainnya331
41 unmodified lines
modified:README.md+5 added-4 removed
53 unmodified lines
54 - [React Native](#react-native)55 - [PouchDB and CouchDB](#pouchdb-and-couchdb)56 - [Web Workers](#web-workers)57 - [CLI](#cli)58 - [TypeScript](#typescript)59 - [Other Programming Languages](#other-programming-languages)60- [Tools](#tools)6162
359 unmodified lines
422Nano ID allows casting generated strings into opaque strings in TypeScript.423For example:424425```ts425type UserId = string & { [userIdBrand]: true }426declare const userIdBrand: unique symbol427type UserId = string & { [userIdBrand]: true }428429// Use explicit type parameter:430mockUser(nanoid<UserId>())431432interface User {433 id: UserId434 name: string435}
2 unmodified lines
438 // Automatically casts to UserId:439 id: nanoid(),440 name: 'Alice'441}438439// Use explicit type parameter:440mockUser(nanoid<UserId>())442```443444### Other Programming Languages445
53 unmodified lines
modified:README.ru.md+5 added-4 removed
57 unmodified lines
58 - [React Native](#react-native)59 - [PouchDB и CouchDB](#pouchdb-и-couchdb)60 - [Веб-воркеры](#веб-воркеры)61 - [Терминал](#терминал)62 - [TypeScript](#typescript)63 - [Другие языки программирования](#другие-языки-программирования)64- [Инструменты](#инструменты)6566
335 unmodified lines
402Nano ID позволяет приводить сгенерированные строки к непрозрачным строкам в403TypeScript. Например:404405```ts405type UserId = string & { [userIdBrand]: true }406declare const userIdBrand: unique symbol407type UserId = string & { [userIdBrand]: true }408409// Используйте явный параметр типа:410mockUser(nanoid<UserId>())411412interface User {413 id: UserId414 name: string415}
2 unmodified lines
418 // Автоматически приводится к типу UserId:419 id: nanoid(),420 name: 'Alice'421}418419// Используйте явный параметр типа:420mockUser(nanoid<UserId>())422```423424### Другие языки программирования425
50 unmodified lines
modified:README.zh-CN.md+5 added-4 removed
47 unmodified lines
48 - [React Native](#react-native)49 - [PouchDB and CouchDB](#pouchdb-and-couchdb)50 - [Web Workers](#web-workers)51 - [CLI](#cli)52 - [TypeScript](#typescript)53 - [其他编程语言](#其他编程语言)54- [工具](#工具)5556
318 unmodified lines
375376Nano ID 允许将生成的字符串转换为 TypeScript 中的不透明字符串。 例如:377378```ts378type UserId = string & { [userIdBrand]: true }379declare const userIdBrand: unique symbol380type UserId = string & { [userIdBrand]: true }381382// 使用显式类型参数:383mockUser(nanoid<UserId>())384385interface User {386 id: UserId387 name: string388}
2 unmodified lines
391 // 自动转换为 UserId:392 id: nanoid(),393 name: 'Alice'394}391392// 使用显式类型参数:393mockUser(nanoid<UserId>())395```396397### 其他编程语言398
49 unmodified lines