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
Provenance
- Commit
f7862cb- Tree
df0ce7e- Author
Andrey Sitnik <andrey@sitnik.ru>- Committer
Andrey Sitnik <andrey@sitnik.ru>- Parent
8bba7ad
4 files changed+20 added−16 removed
modified:README.id-ID.md+5 added-4 removed
45 unmodified lines46 - [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)53 54 253 unmodified lines308 Nano ID memungkinkan untuk mengubah string yang dihasilkan menjadi string opak309 dalam TypeScript. Sebagai contoh:310 311 ```ts311-type UserId = string & { [userIdBrand]: true }312 declare const userIdBrand: unique symbol313+type UserId = string & { [userIdBrand]: true }314 315+// Gunakan parameter tipe secara eksplisit:316+mockUser(nanoid<UserId>())317+318 interface User {319 id: UserId320 name: string321 }2 unmodified lines324 // Secara otomatis diubah menjadi UserId:325 id: nanoid(),326 name: 'Alice'327 }324-325-// Gunakan parameter tipe secara eksplisit:326-mockUser(nanoid<UserId>())328 ```329 330 ### Bahasa Pemrograman Lainnya331 41 unmodified linesmodified:README.md+5 added-4 removed
53 unmodified lines54 - [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)61 62 359 unmodified lines422 Nano ID allows casting generated strings into opaque strings in TypeScript.423 For example:424 425 ```ts425-type UserId = string & { [userIdBrand]: true }426 declare const userIdBrand: unique symbol427+type UserId = string & { [userIdBrand]: true }428 429+// Use explicit type parameter:430+mockUser(nanoid<UserId>())431+432 interface User {433 id: UserId434 name: string435 }2 unmodified lines438 // Automatically casts to UserId:439 id: nanoid(),440 name: 'Alice'441 }438-439-// Use explicit type parameter:440-mockUser(nanoid<UserId>())442 ```443 444 ### Other Programming Languages445 53 unmodified linesmodified:README.ru.md+5 added-4 removed
57 unmodified lines58 - [React Native](#react-native)59 - [PouchDB и CouchDB](#pouchdb-и-couchdb)60 - [Веб-воркеры](#веб-воркеры)61 - [Терминал](#терминал)62+ - [TypeScript](#typescript)63 - [Другие языки программирования](#другие-языки-программирования)64 - [Инструменты](#инструменты)65 66 335 unmodified lines402 Nano ID позволяет приводить сгенерированные строки к непрозрачным строкам в403 TypeScript. Например:404 405 ```ts405-type UserId = string & { [userIdBrand]: true }406 declare const userIdBrand: unique symbol407+type UserId = string & { [userIdBrand]: true }408 409+// Используйте явный параметр типа:410+mockUser(nanoid<UserId>())411+412 interface User {413 id: UserId414 name: string415 }2 unmodified lines418 // Автоматически приводится к типу UserId:419 id: nanoid(),420 name: 'Alice'421 }418-419-// Используйте явный параметр типа:420-mockUser(nanoid<UserId>())422 ```423 424 ### Другие языки программирования425 50 unmodified linesmodified:README.zh-CN.md+5 added-4 removed
47 unmodified lines48 - [React Native](#react-native)49 - [PouchDB and CouchDB](#pouchdb-and-couchdb)50 - [Web Workers](#web-workers)51 - [CLI](#cli)52+ - [TypeScript](#typescript)53 - [其他编程语言](#其他编程语言)54 - [工具](#工具)55 56 318 unmodified lines375 376 Nano ID 允许将生成的字符串转换为 TypeScript 中的不透明字符串。 例如:377 378 ```ts378-type UserId = string & { [userIdBrand]: true }379 declare const userIdBrand: unique symbol380+type UserId = string & { [userIdBrand]: true }381 382+// 使用显式类型参数:383+mockUser(nanoid<UserId>())384+385 interface User {386 id: UserId387 name: string388 }2 unmodified lines391 // 自动转换为 UserId:392 id: nanoid(),393 name: 'Alice'394 }391-392-// 使用显式类型参数:393-mockUser(nanoid<UserId>())395 ```396 397 ### 其他编程语言398 49 unmodified lines