@code-plate/iran-cities 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,27 @@
1
+ interface City {
2
+ /** شناسه انگلیسی/لاتین شهر (kebab-case) - یکتا در سطح کل کشور نیست، در سطح استان یکتاست */
3
+ en: string;
4
+ /** نام فارسی شهر */
5
+ fa: string;
6
+ }
7
+ interface Province {
8
+ /** شناسه انگلیسی/لاتین استان (kebab-case) - یکتا در سطح کشور */
9
+ en: string;
10
+ /** نام فارسی استان */
11
+ fa: string;
12
+ cities: City[];
13
+ }
14
+ /** خروجی مسطح‌شده؛ برای جستجو و لیست‌های ساده مفید است */
15
+ interface FlatCity extends City {
16
+ provinceEn: string;
17
+ provinceFa: string;
18
+ }
19
+ type Locale = 'en' | 'fa';
20
+ interface SearchOptions {
21
+ /** تعداد بیشینه نتایج (پیش‌فرض: بدون محدودیت) */
22
+ limit?: number;
23
+ /** جستجو فقط در فارسی، فقط در انگلیسی یا هر دو (پیش‌فرض: both) */
24
+ locale?: Locale | 'both';
25
+ }
26
+
27
+ export type { City as C, FlatCity as F, Locale as L, Province as P, SearchOptions as S };
@@ -0,0 +1,27 @@
1
+ interface City {
2
+ /** شناسه انگلیسی/لاتین شهر (kebab-case) - یکتا در سطح کل کشور نیست، در سطح استان یکتاست */
3
+ en: string;
4
+ /** نام فارسی شهر */
5
+ fa: string;
6
+ }
7
+ interface Province {
8
+ /** شناسه انگلیسی/لاتین استان (kebab-case) - یکتا در سطح کشور */
9
+ en: string;
10
+ /** نام فارسی استان */
11
+ fa: string;
12
+ cities: City[];
13
+ }
14
+ /** خروجی مسطح‌شده؛ برای جستجو و لیست‌های ساده مفید است */
15
+ interface FlatCity extends City {
16
+ provinceEn: string;
17
+ provinceFa: string;
18
+ }
19
+ type Locale = 'en' | 'fa';
20
+ interface SearchOptions {
21
+ /** تعداد بیشینه نتایج (پیش‌فرض: بدون محدودیت) */
22
+ limit?: number;
23
+ /** جستجو فقط در فارسی، فقط در انگلیسی یا هر دو (پیش‌فرض: both) */
24
+ locale?: Locale | 'both';
25
+ }
26
+
27
+ export type { City as C, FlatCity as F, Locale as L, Province as P, SearchOptions as S };
package/package.json ADDED
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "@code-plate/iran-cities",
3
+ "version": "1.0.0",
4
+ "description": "لیست کامل استان‌ها و شهرهای ایران (فارسی/انگلیسی) به‌همراه ابزارهای جستجو - بدون وابستگی، سازگار با هر فریمورک جاوااسکریپتی (React, Next.js, Vue, Angular, Node.js/Express و ...)",
5
+ "keywords": [
6
+ "iran",
7
+ "province",
8
+ "city",
9
+ "استان",
10
+ "شهر",
11
+ "ایران",
12
+ "persian",
13
+ "farsi",
14
+ "location",
15
+ "cities-list"
16
+ ],
17
+ "author": "code-plate",
18
+ "license": "MIT",
19
+ "sideEffects": false,
20
+ "main": "./dist/index.cjs",
21
+ "module": "./dist/index.mjs",
22
+ "types": "./dist/index.d.ts",
23
+ "exports": {
24
+ ".": {
25
+ "types": "./dist/index.d.ts",
26
+ "import": "./dist/index.mjs",
27
+ "require": "./dist/index.cjs"
28
+ },
29
+ "./react": {
30
+ "types": "./dist/react.d.ts",
31
+ "import": "./dist/react.mjs",
32
+ "require": "./dist/react.cjs"
33
+ },
34
+ "./package.json": "./package.json"
35
+ },
36
+ "files": [
37
+ "dist"
38
+ ],
39
+ "peerDependencies": {
40
+ "react": ">=16.8.0"
41
+ },
42
+ "peerDependenciesMeta": {
43
+ "react": {
44
+ "optional": true
45
+ }
46
+ },
47
+ "devDependencies": {
48
+ "@types/react": "^19.2.17",
49
+ "react": "^19.2.7",
50
+ "tsup": "^8.5.1",
51
+ "typescript": "^5.9.3"
52
+ },
53
+ "scripts": {
54
+ "build": "tsup",
55
+ "dev": "tsup --watch",
56
+ "typecheck": "tsc --noEmit"
57
+ },
58
+ "engines": {
59
+ "node": ">=14"
60
+ },
61
+ "publishConfig": {
62
+ "access": "public"
63
+ }
64
+ }