@@ -20,6 +20,8 | |||||
20 | "@typescript-eslint" |
|
20 | "@typescript-eslint" | |
21 | ], |
|
21 | ], | |
22 | "rules": { |
|
22 | "rules": { | |
|
23 | "react/react-in-jsx-scope": "off", | |||
|
24 | "react/no-unknown-property": "off", | |||
23 | "@typescript-eslint/no-empty-function": "off", |
|
25 | "@typescript-eslint/no-empty-function": "off", | |
24 | "max-classes-per-file": [ |
|
26 | "max-classes-per-file": [ | |
25 | "error", |
|
27 | "error", |
@@ -18,7 +18,7 | |||||
18 | "@typescript-eslint/eslint-plugin": "^5.23.0", |
|
18 | "@typescript-eslint/eslint-plugin": "^5.23.0", | |
19 | "@typescript-eslint/parser": "^5.23.0", |
|
19 | "@typescript-eslint/parser": "^5.23.0", | |
20 | "dojo": "1.16.0", |
|
20 | "dojo": "1.16.0", | |
21 |
"eslint": "^8. |
|
21 | "eslint": "^8.23.0", | |
22 | "eslint-config-standard": "^17.0.0", |
|
22 | "eslint-config-standard": "^17.0.0", | |
23 | "eslint-plugin-import": "^2.26.0", |
|
23 | "eslint-plugin-import": "^2.26.0", | |
24 | "eslint-plugin-n": "^15.2.0", |
|
24 | "eslint-plugin-n": "^15.2.0", | |
@@ -26,7 +26,6 | |||||
26 | "eslint-plugin-react": "^7.29.4", |
|
26 | "eslint-plugin-react": "^7.29.4", | |
27 | "requirejs": "2.3.6", |
|
27 | "requirejs": "2.3.6", | |
28 | "tap": "16.3.0", |
|
28 | "tap": "16.3.0", | |
29 | "tslint": "^6.1.3", |
|
|||
30 | "typescript": "4.8.3", |
|
29 | "typescript": "4.8.3", | |
31 | "yaml": "~1.7.2" |
|
30 | "yaml": "~1.7.2" | |
32 | }, |
|
31 | }, | |
@@ -1171,15 +1170,6 | |||||
1171 | "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", |
|
1170 | "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", | |
1172 | "dev": true |
|
1171 | "dev": true | |
1173 | }, |
|
1172 | }, | |
1174 | "node_modules/builtin-modules": { |
|
|||
1175 | "version": "1.1.1", |
|
|||
1176 | "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", |
|
|||
1177 | "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", |
|
|||
1178 | "dev": true, |
|
|||
1179 | "engines": { |
|
|||
1180 | "node": ">=0.10.0" |
|
|||
1181 | } |
|
|||
1182 | }, |
|
|||
1183 | "node_modules/builtins": { |
|
1173 | "node_modules/builtins": { | |
1184 | "version": "5.0.1", |
|
1174 | "version": "5.0.1", | |
1185 | "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", |
|
1175 | "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", | |
@@ -1351,12 +1341,6 | |||||
1351 | "color-support": "bin.js" |
|
1341 | "color-support": "bin.js" | |
1352 | } |
|
1342 | } | |
1353 | }, |
|
1343 | }, | |
1354 | "node_modules/commander": { |
|
|||
1355 | "version": "2.20.3", |
|
|||
1356 | "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", |
|
|||
1357 | "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", |
|
|||
1358 | "dev": true |
|
|||
1359 | }, |
|
|||
1360 | "node_modules/commondir": { |
|
1344 | "node_modules/commondir": { | |
1361 | "version": "1.0.1", |
|
1345 | "version": "1.0.1", | |
1362 | "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", |
|
1346 | "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", | |
@@ -3407,18 +3391,6 | |||||
3407 | "node": ">=8" |
|
3391 | "node": ">=8" | |
3408 | } |
|
3392 | } | |
3409 | }, |
|
3393 | }, | |
3410 | "node_modules/mkdirp": { |
|
|||
3411 | "version": "0.5.5", |
|
|||
3412 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", |
|
|||
3413 | "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", |
|
|||
3414 | "dev": true, |
|
|||
3415 | "dependencies": { |
|
|||
3416 | "minimist": "^1.2.5" |
|
|||
3417 | }, |
|
|||
3418 | "bin": { |
|
|||
3419 | "mkdirp": "bin/cmd.js" |
|
|||
3420 | } |
|
|||
3421 | }, |
|
|||
3422 | "node_modules/ms": { |
|
3394 | "node_modules/ms": { | |
3423 | "version": "2.1.2", |
|
3395 | "version": "2.1.2", | |
3424 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", |
|
3396 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", | |
@@ -3965,15 +3937,6 | |||||
3965 | "node": ">=0.4.0" |
|
3937 | "node": ">=0.4.0" | |
3966 | } |
|
3938 | } | |
3967 | }, |
|
3939 | }, | |
3968 | "node_modules/resolve": { |
|
|||
3969 | "version": "1.17.0", |
|
|||
3970 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", |
|
|||
3971 | "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", |
|
|||
3972 | "dev": true, |
|
|||
3973 | "dependencies": { |
|
|||
3974 | "path-parse": "^1.0.6" |
|
|||
3975 | } |
|
|||
3976 | }, |
|
|||
3977 | "node_modules/resolve-from": { |
|
3940 | "node_modules/resolve-from": { | |
3978 | "version": "4.0.0", |
|
3941 | "version": "4.0.0", | |
3979 | "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", |
|
3942 | "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", | |
@@ -6386,57 +6349,6 | |||||
6386 | "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", |
|
6349 | "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", | |
6387 | "dev": true |
|
6350 | "dev": true | |
6388 | }, |
|
6351 | }, | |
6389 | "node_modules/tslint": { |
|
|||
6390 | "version": "6.1.3", |
|
|||
6391 | "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.3.tgz", |
|
|||
6392 | "integrity": "sha512-IbR4nkT96EQOvKE2PW/djGz8iGNeJ4rF2mBfiYaR/nvUWYKJhLwimoJKgjIFEIDibBtOevj7BqCRL4oHeWWUCg==", |
|
|||
6393 | "dev": true, |
|
|||
6394 | "dependencies": { |
|
|||
6395 | "@babel/code-frame": "^7.0.0", |
|
|||
6396 | "builtin-modules": "^1.1.1", |
|
|||
6397 | "chalk": "^2.3.0", |
|
|||
6398 | "commander": "^2.12.1", |
|
|||
6399 | "diff": "^4.0.1", |
|
|||
6400 | "glob": "^7.1.1", |
|
|||
6401 | "js-yaml": "^3.13.1", |
|
|||
6402 | "minimatch": "^3.0.4", |
|
|||
6403 | "mkdirp": "^0.5.3", |
|
|||
6404 | "resolve": "^1.3.2", |
|
|||
6405 | "semver": "^5.3.0", |
|
|||
6406 | "tslib": "^1.13.0", |
|
|||
6407 | "tsutils": "^2.29.0" |
|
|||
6408 | }, |
|
|||
6409 | "bin": { |
|
|||
6410 | "tslint": "bin/tslint" |
|
|||
6411 | }, |
|
|||
6412 | "engines": { |
|
|||
6413 | "node": ">=4.8.0" |
|
|||
6414 | } |
|
|||
6415 | }, |
|
|||
6416 | "node_modules/tslint/node_modules/semver": { |
|
|||
6417 | "version": "5.7.1", |
|
|||
6418 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", |
|
|||
6419 | "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", |
|
|||
6420 | "dev": true, |
|
|||
6421 | "bin": { |
|
|||
6422 | "semver": "bin/semver" |
|
|||
6423 | } |
|
|||
6424 | }, |
|
|||
6425 | "node_modules/tslint/node_modules/tslib": { |
|
|||
6426 | "version": "1.13.0", |
|
|||
6427 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", |
|
|||
6428 | "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==", |
|
|||
6429 | "dev": true |
|
|||
6430 | }, |
|
|||
6431 | "node_modules/tsutils": { |
|
|||
6432 | "version": "2.29.0", |
|
|||
6433 | "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", |
|
|||
6434 | "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", |
|
|||
6435 | "dev": true, |
|
|||
6436 | "dependencies": { |
|
|||
6437 | "tslib": "^1.8.1" |
|
|||
6438 | } |
|
|||
6439 | }, |
|
|||
6440 | "node_modules/type-check": { |
|
6352 | "node_modules/type-check": { | |
6441 | "version": "0.4.0", |
|
6353 | "version": "0.4.0", | |
6442 | "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", |
|
6354 | "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", | |
@@ -7612,12 +7524,6 | |||||
7612 | "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", |
|
7524 | "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", | |
7613 | "dev": true |
|
7525 | "dev": true | |
7614 | }, |
|
7526 | }, | |
7615 | "builtin-modules": { |
|
|||
7616 | "version": "1.1.1", |
|
|||
7617 | "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", |
|
|||
7618 | "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", |
|
|||
7619 | "dev": true |
|
|||
7620 | }, |
|
|||
7621 | "builtins": { |
|
7527 | "builtins": { | |
7622 | "version": "5.0.1", |
|
7528 | "version": "5.0.1", | |
7623 | "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", |
|
7529 | "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", | |
@@ -7743,12 +7649,6 | |||||
7743 | "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", |
|
7649 | "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", | |
7744 | "dev": true |
|
7650 | "dev": true | |
7745 | }, |
|
7651 | }, | |
7746 | "commander": { |
|
|||
7747 | "version": "2.20.3", |
|
|||
7748 | "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", |
|
|||
7749 | "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", |
|
|||
7750 | "dev": true |
|
|||
7751 | }, |
|
|||
7752 | "commondir": { |
|
7652 | "commondir": { | |
7753 | "version": "1.0.1", |
|
7653 | "version": "1.0.1", | |
7754 | "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", |
|
7654 | "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", | |
@@ -9241,15 +9141,6 | |||||
9241 | "yallist": "^4.0.0" |
|
9141 | "yallist": "^4.0.0" | |
9242 | } |
|
9142 | } | |
9243 | }, |
|
9143 | }, | |
9244 | "mkdirp": { |
|
|||
9245 | "version": "0.5.5", |
|
|||
9246 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", |
|
|||
9247 | "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", |
|
|||
9248 | "dev": true, |
|
|||
9249 | "requires": { |
|
|||
9250 | "minimist": "^1.2.5" |
|
|||
9251 | } |
|
|||
9252 | }, |
|
|||
9253 | "ms": { |
|
9144 | "ms": { | |
9254 | "version": "2.1.2", |
|
9145 | "version": "2.1.2", | |
9255 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", |
|
9146 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", | |
@@ -9651,15 +9542,6 | |||||
9651 | "integrity": "sha512-ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg==", |
|
9542 | "integrity": "sha512-ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg==", | |
9652 | "dev": true |
|
9543 | "dev": true | |
9653 | }, |
|
9544 | }, | |
9654 | "resolve": { |
|
|||
9655 | "version": "1.17.0", |
|
|||
9656 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", |
|
|||
9657 | "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", |
|
|||
9658 | "dev": true, |
|
|||
9659 | "requires": { |
|
|||
9660 | "path-parse": "^1.0.6" |
|
|||
9661 | } |
|
|||
9662 | }, |
|
|||
9663 | "resolve-from": { |
|
9545 | "resolve-from": { | |
9664 | "version": "4.0.0", |
|
9546 | "version": "4.0.0", | |
9665 | "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", |
|
9547 | "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", | |
@@ -11273,50 +11155,6 | |||||
11273 | "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", |
|
11155 | "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", | |
11274 | "dev": true |
|
11156 | "dev": true | |
11275 | }, |
|
11157 | }, | |
11276 | "tslint": { |
|
|||
11277 | "version": "6.1.3", |
|
|||
11278 | "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.3.tgz", |
|
|||
11279 | "integrity": "sha512-IbR4nkT96EQOvKE2PW/djGz8iGNeJ4rF2mBfiYaR/nvUWYKJhLwimoJKgjIFEIDibBtOevj7BqCRL4oHeWWUCg==", |
|
|||
11280 | "dev": true, |
|
|||
11281 | "requires": { |
|
|||
11282 | "@babel/code-frame": "^7.0.0", |
|
|||
11283 | "builtin-modules": "^1.1.1", |
|
|||
11284 | "chalk": "^2.3.0", |
|
|||
11285 | "commander": "^2.12.1", |
|
|||
11286 | "diff": "^4.0.1", |
|
|||
11287 | "glob": "^7.1.1", |
|
|||
11288 | "js-yaml": "^3.13.1", |
|
|||
11289 | "minimatch": "^3.0.4", |
|
|||
11290 | "mkdirp": "^0.5.3", |
|
|||
11291 | "resolve": "^1.3.2", |
|
|||
11292 | "semver": "^5.3.0", |
|
|||
11293 | "tslib": "^1.13.0", |
|
|||
11294 | "tsutils": "^2.29.0" |
|
|||
11295 | }, |
|
|||
11296 | "dependencies": { |
|
|||
11297 | "semver": { |
|
|||
11298 | "version": "5.7.1", |
|
|||
11299 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", |
|
|||
11300 | "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", |
|
|||
11301 | "dev": true |
|
|||
11302 | }, |
|
|||
11303 | "tslib": { |
|
|||
11304 | "version": "1.13.0", |
|
|||
11305 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", |
|
|||
11306 | "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==", |
|
|||
11307 | "dev": true |
|
|||
11308 | } |
|
|||
11309 | } |
|
|||
11310 | }, |
|
|||
11311 | "tsutils": { |
|
|||
11312 | "version": "2.29.0", |
|
|||
11313 | "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", |
|
|||
11314 | "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", |
|
|||
11315 | "dev": true, |
|
|||
11316 | "requires": { |
|
|||
11317 | "tslib": "^1.8.1" |
|
|||
11318 | } |
|
|||
11319 | }, |
|
|||
11320 | "type-check": { |
|
11158 | "type-check": { | |
11321 | "version": "0.4.0", |
|
11159 | "version": "0.4.0", | |
11322 | "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", |
|
11160 | "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", |
@@ -138,7 +138,7 export function djclass<T extends Abstra | |||||
138 | // proxy - фабрика для создания прокси-методов, которые внутри |
|
138 | // proxy - фабрика для создания прокси-методов, которые внутри | |
139 | // себя вызовут this.inherited с правильными параметрами. |
|
139 | // себя вызовут this.inherited с правильными параметрами. | |
140 | const proxy = (m: (...args: unknown[]) => unknown) => function (this: dojo._base.DeclareCreatedObject, ...args: unknown[]) { |
|
140 | const proxy = (m: (...args: unknown[]) => unknown) => function (this: dojo._base.DeclareCreatedObject, ...args: unknown[]) { | |
141 | const f = this.getInherited({ callee: m, ...args, length: args.length}); |
|
141 | const f = this.getInherited({ callee: m, ...args, length: args.length }); | |
142 | return f ? f.apply(this, args) as unknown : undefined; |
|
142 | return f ? f.apply(this, args) as unknown : undefined; | |
143 |
|
143 | |||
144 | // так сделать можно только dojo 1.15+ |
|
144 | // так сделать можно только dojo 1.15+ | |
@@ -220,39 +220,35 function isNodeBindSpec(v: object): v is | |||||
220 | */ |
|
220 | */ | |
221 | export function bind(params: NodeBindSpec | MemberBindSpec) { |
|
221 | export function bind(params: NodeBindSpec | MemberBindSpec) { | |
222 | if (isNodeBindSpec(params)) { |
|
222 | if (isNodeBindSpec(params)) { | |
223 |
return (target: Record< |
|
223 | return <K extends string>(target: Record<K, unknown>, name: K) => { | |
224 | target[makeSetterName(name)] = params; |
|
224 | target[makeSetterName(name) as K /** hack to not go insane) */] = params; | |
225 | }; |
|
225 | }; | |
226 | } else { |
|
226 | } else { | |
227 | return (target: Record<string, unknown> & { _set(name: string, v: unknown): void }, name: string) => { |
|
227 | return <K extends string, | |
228 | target[name] = null; |
|
228 | T extends { [p in K]: p extends "_set" ? (name: p, v: unknown) => void : unknown; }> (target: T, name: K) => { | |
229 | target[makeSetterName(name)] = function (v: unknown) { |
|
229 | target[name] = undefined as T[K]; | |
|
230 | target[makeSetterName(name) as K] = function (this: T, v: unknown) { | |||
230 | this._set(name, v); |
|
231 | this._set(name, v); | |
231 | const inner = this[params.member] as Record<string, unknown>; |
|
232 | const inner = this[params.member] as Record<string, unknown>; | |
232 |
if (typeof inner.set === "function") |
|
233 | if (typeof inner.set === "function") | |
233 | inner.set(params.property, v); |
|
234 | inner.set(params.property, v); | |
234 | }; |
|
235 | } as T[K]; | |
235 | if (params.getter) |
|
236 | if (params.getter) | |
236 | target[makeGetterName(name)] = function () { |
|
237 | target[makeGetterName(name)] = function () { | |
237 | const inner = this[params.member] as Record<string, unknown>; |
|
238 | const inner = this[params.member] as Record<string, unknown>; | |
238 |
if (typeof inner.get === "function") |
|
239 | if (typeof inner.get === "function") | |
239 | return inner.get(params.property) as unknown; |
|
240 | return inner.get(params.property) as unknown; | |
240 | }; |
|
241 | }; | |
241 | }; |
|
242 | }; | |
242 | } |
|
243 | } | |
243 | } |
|
244 | } | |
244 |
|
245 | |||
245 | /** Создает в прототипе указанное свойство со значение `undefined`, данный |
|
|||
246 | * декоратор следует использовать для свойств, у которых нет значения по-умолчанию |
|
|||
247 | * и они не могут быть `null | undefined` |
|
|||
248 | */ |
|
|||
249 | export function prototype(): (p: object, name: string) => void; |
|
|||
250 | /** Создает в прототипе свойство с указанным значением. |
|
246 | /** Создает в прототипе свойство с указанным значением. | |
251 | * @param value Значение, которое будет указано в прототипе |
|
247 | * @param value Значение, которое будет указано в прототипе | |
252 | */ |
|
248 | */ | |
253 | export function prototype<T>(value: T): <P extends { [m in K]: T }, K extends keyof P>(p: P, name: K) => void; |
|
249 | export function prototype<T>(value: T): <P extends { [m in K]: T }, K extends keyof P>(p: P, name: K) => void; | |
254 | export function prototype<T>(value?: T) { |
|
250 | export function prototype<T>(value?: T) { | |
255 | return <P extends { [m in K]: T }, K extends keyof P>(p: P, name: K) => { |
|
251 | return (p: { [m in string]: T | undefined }, name: string) => { | |
256 |
p[name] = value |
|
252 | p[name] = value; | |
257 | }; |
|
253 | }; | |
258 | } |
|
254 | } |
@@ -4,7 +4,7 import _WidgetBase = require("dijit/_Wid | |||||
4 | import registry = require("dijit/registry"); |
|
4 | import registry = require("dijit/registry"); | |
5 |
|
5 | |||
6 | interface _WidgetBaseConstructor { |
|
6 | interface _WidgetBaseConstructor { | |
7 |
new <E extends { [k in keyof E]: Event } = |
|
7 | new <E extends { [k in keyof E]: Event } = object>(params?: Partial<_WidgetBase<E>> & ThisType<_WidgetBase<E>>, srcNodeRef?: string | Node): _WidgetBase<E> & dojo._base.DeclareCreatedObject; | |
8 | prototype: _WidgetBase; |
|
8 | prototype: _WidgetBase; | |
9 | } |
|
9 | } | |
10 |
|
10 |
@@ -12,7 +12,7 const consumer1 = { | |||||
12 | next(v: number) { |
|
12 | next(v: number) { | |
13 | this.sum += v; |
|
13 | this.sum += v; | |
14 | } |
|
14 | } | |
15 | } |
|
15 | }; | |
16 |
|
16 | |||
17 | subj1.subscribe(consumer1); |
|
17 | subj1.subscribe(consumer1); | |
18 | t.equal(consumer1.sum, 1, "Should get only one value"); |
|
18 | t.equal(consumer1.sum, 1, "Should get only one value"); | |
@@ -31,19 +31,19 let maps = 0; | |||||
31 |
|
31 | |||
32 | subj1 |
|
32 | subj1 | |
33 | .map(v => { |
|
33 | .map(v => { | |
34 |
t.comment( |
|
34 | t.comment(`map1: ${v * 2}`); | |
35 | maps++; |
|
35 | maps++; | |
36 | return v * 2; |
|
36 | return v * 2; | |
37 | }) |
|
37 | }) | |
38 | .map (v => { |
|
38 | .map (v => { | |
39 |
t.comment( |
|
39 | t.comment(`map2: ${v * 2}`); | |
40 | maps++; |
|
40 | maps++; | |
41 | return v * 2; |
|
41 | return v * 2; | |
42 | }) |
|
42 | }) | |
43 | .map(v => { |
|
43 | .map(v => { | |
44 |
t.comment( |
|
44 | t.comment(`map3: ${v * 2}`); | |
45 | maps++; |
|
45 | maps++; | |
46 | return v * 2 |
|
46 | return v * 2; | |
47 | }) |
|
47 | }) | |
48 | .subscribe(consumer2); |
|
48 | .subscribe(consumer2); | |
49 |
|
49 |
@@ -26,11 +26,11 export class MyWidget extends djbase(Djx | |||||
26 | @bind({ node: "titleNode", type: "innerHTML" }) |
|
26 | @bind({ node: "titleNode", type: "innerHTML" }) | |
27 | title = ""; |
|
27 | title = ""; | |
28 |
|
28 | |||
29 | @prototype() |
|
29 | @prototype(0) | |
30 | counter = 0; |
|
30 | counter = 0; | |
31 |
|
31 | |||
32 | render() { |
|
32 | render() { | |
33 |
const Frame = ({children, ref}: {ref: JSX.Ref<HTMLDivElement>, children: |
|
33 | const Frame = ({children, ref}: {ref: JSX.Ref<HTMLDivElement>, children: unknown[]}) => <div ref={ref} >{children}</div>; | |
34 | return <div className="myWidget" onsubmit={e => this._onSubmit(e)} tabIndex={3} style={{ alignContent: "center", border: "1px solid" }} > |
|
34 | return <div className="myWidget" onsubmit={e => this._onSubmit(e)} tabIndex={3} style={{ alignContent: "center", border: "1px solid" }} > | |
35 | <h1 data-dojo-attach-point="titleNode"></h1> |
|
35 | <h1 data-dojo-attach-point="titleNode"></h1> | |
36 | <Frame ref={ v => {}}> |
|
36 | <Frame ref={ v => {}}> |
General Comments 0
You need to be logged in to leave comments.
Login now