{"id":301,"date":"2026-09-06T01:23:12","date_gmt":"2026-09-05T17:23:12","guid":{"rendered":"https:\/\/www.ziliaochi.cn\/index.php\/2026\/09\/06\/interview-typescript-25q\/"},"modified":"2026-09-06T01:23:12","modified_gmt":"2026-09-05T17:23:12","slug":"interview-typescript-25q","status":"publish","type":"post","link":"https:\/\/www.ziliaochi.cn\/index.php\/2026\/09\/06\/interview-typescript-25q\/","title":{"rendered":"TypeScript 25 \u95ee\uff1a\u4ece any\/unknown \u5230\u7c7b\u578b\u4f53\u64cd\u4e0e TS 7"},"content":{"rendered":"<div style=\"font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",\"PingFang SC\",\"Hiragino Sans GB\",\"Microsoft YaHei\",sans-serif;font-size:16.5px;line-height:1.9;color:#35435c;letter-spacing:.2px\">\n<div style=\"background:linear-gradient(135deg,#f5f9ff,#eef5ff);border:1px solid #dce8f8;border-left:4px solid #2fb37a;border-radius:12px;padding:16px 20px;margin:0 0 24px;font-size:14.5px;color:#3d5570;line-height:2\"><span style=\"display:inline-block;background:#2fb37a;color:#fff;font-size:12.5px;font-weight:700;padding:3px 10px;border-radius:6px;margin-right:12px;letter-spacing:1px;vertical-align:1px\">\u5173\u952e\u8bcd<\/span>TypeScript \u9762\u8bd5\u3001\u6cdb\u578b\u3001\u6761\u4ef6\u7c7b\u578b\u3001infer\u3001\u7c7b\u578b\u4f53\u64cd\u3001TS7 \u539f\u751f\u7f16\u8bd1\u5668<\/div>\n<div style=\"background:#fafbfd;border:1px solid #e8edf5;border-radius:12px;padding:18px 22px;margin:0 0 30px\">\n<div style=\"font-size:13.5px;font-weight:700;color:#8a99ae;letter-spacing:2px;margin-bottom:12px\">\u76ee\u5f55<\/div>\n<ol style=\"margin:0;padding-left:20px\">\n<li style=\"margin:8px 0;font-size:15px;line-height:1.6\"><a href=\"#sec-1\" style=\"color:#42546e;text-decoration:none;border:none\">\u4e00\u3001\u7c7b\u578b\u57fa\u7840\uff088 \u95ee\uff09<\/a><\/li>\n<li style=\"margin:8px 0;font-size:15px;line-height:1.6\"><a href=\"#sec-2\" style=\"color:#42546e;text-decoration:none;border:none\">\u4e8c\u3001\u7c7b\u578b\u7f16\u7a0b\uff0810 \u95ee\uff09<\/a><\/li>\n<li style=\"margin:8px 0;font-size:15px;line-height:1.6\"><a href=\"#sec-3\" style=\"color:#42546e;text-decoration:none;border:none\">\u4e09\u3001\u5de5\u7a0b\u914d\u7f6e\uff087 \u95ee\uff09<\/a><\/li>\n<\/ol>\n<\/div>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\"><span style=\"font-size:17px;color:#1e2f47\">TypeScript \u9762\u8bd5\u6b63\u5728\u4ece\u300c\u4f1a\u4e0d\u4f1a\u7528\u300d\u5347\u7ea7\u4e3a\u300c\u7c7b\u578b\u7cfb\u7edf\u7406\u89e3\u591a\u6df1\u300d\u2014\u2014\u5c24\u5176\u5728 TypeScript 7 \u539f\u751f\u7f16\u8bd1\u5668\uff08Go \u5b9e\u73b0\uff0c\u5f53\u524d 7.0.2\uff09\u843d\u5730\u7684\u80cc\u666f\u4e0b\uff0c\u8bed\u8a00\u5c42\u77e5\u8bc6\u6bd4\u4ee5\u5f80\u66f4\u503c\u94b1\u3002\u8fd9\u4efd 25 \u95ee\u8986\u76d6\u7c7b\u578b\u57fa\u7840\u3001\u7c7b\u578b\u7f16\u7a0b\u3001\u5de5\u7a0b\u914d\u7f6e\u4e09\u4e2a\u68af\u5ea6\uff0c\u6bcf\u95ee\u7ed9\u51fa\u7b80\u660e\u7b54\u6848\u4e0e\u52a0\u5206\u70b9\u3002<\/p>\n<h2 style=\"font-size:23px;line-height:1.45;font-weight:700;color:#0f1c2e;margin:46px 0 18px;padding:0 0 12px 14px;border-left:5px solid #2fb37a;border-bottom:1px solid #eef2f7;letter-spacing:.3px\" id=\"sec-1\">\u4e00\u3001\u7c7b\u578b\u57fa\u7840\uff088 \u95ee\uff09<\/h2>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2fb37a40\">1. any \u4e0e unknown \u7684\u533a\u522b\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">any \u5173\u95ed\u7c7b\u578b\u68c0\u67e5\uff0c\u53ef\u4ee5\u8d4b\u7ed9\u4efb\u4f55\u7c7b\u578b\u3001\u8c03\u7528\u4efb\u4f55\u65b9\u6cd5\uff1bunknown \u662f\u300c\u5b89\u5168\u7684 top type\u300d\u2014\u2014\u53ef\u4ee5\u63a5\u6536\u4efb\u4f55\u503c\uff0c\u4f46\u4f7f\u7528\u524d\u5fc5\u987b\u6536\u7a84\u3002\u5de5\u7a0b\u89c4\u8303\uff1a\u4efb\u4f55\u60f3\u5199 any \u7684\u5730\u65b9\u5148\u8003\u8651 unknown\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2fb37a40\">2. never \u7684\u7528\u9014\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u8868\u793a\u300c\u4e0d\u4f1a\u6709\u503c\u300d\uff1a\u629b\u9519\u51fd\u6570\u7684\u8fd4\u56de\u503c\u3001\u7a77\u5c3d\u68c0\u67e5\u7684\u515c\u5e95\u5206\u652f\uff08<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">const _x: never = value<\/code> \u5728\u8054\u5408\u7c7b\u578b\u6269\u5c55\u65f6\u7f16\u8bd1\u62a5\u9519\uff0c\u5f3a\u5236\u5904\u7406\u65b0\u5206\u652f\uff09\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2fb37a40\">3. type \u4e0e interface \u600e\u4e48\u9009\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u4e24\u8005\u5927\u90e8\u5206\u573a\u666f\u53ef\u4e92\u6362\u3002\u5dee\u5f02\uff1ainterface \u53ef\u58f0\u660e\u5408\u5e76\u3001\u53ef extends\uff1btype \u652f\u6301\u8054\u5408\u3001\u6761\u4ef6\u7c7b\u578b\u3001\u6620\u5c04\u7b49\u7c7b\u578b\u7f16\u7a0b\u3002\u60ef\u4f8b\uff1a\u5bf9\u8c61\u5f62\u72b6\u7528 interface\uff0c\u5176\u4f59\u4e00\u5f8b type\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2fb37a40\">4. \u679a\u4e3e\u7684\u95ee\u9898\u662f\u4ec0\u4e48\uff1f\u66ff\u4ee3\u65b9\u6848\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u8fd0\u884c\u65f6\u5bf9\u8c61 + \u6570\u5b57\u679a\u4e3e\u7684\u53cc\u5411\u6620\u5c04\u6709\u9677\u9631\uff0c<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">const enum<\/code> \u5728\u9694\u79bb\u6a21\u5757\u7f16\u8bd1\u4e0b\u53d7\u9650\u3002\u4e3b\u6d41\u66ff\u4ee3\uff1a<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">as const<\/code> \u5bf9\u8c61 + \u8054\u5408\u7c7b\u578b\u63a8\u5bfc\u3002<\/p>\n<pre style=\"background:#0f1a2b;color:#dbe6f5;border-radius:12px;padding:18px 20px;overflow-x:auto;font-size:13.6px;line-height:1.78;margin:22px 0;border:1px solid #1e2c42;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace\"><code style=\"background:none;border:none;color:inherit;padding:0;font-size:inherit;font-family:inherit\">const STATUS = { active: \"active\", archived: \"archived\" } as const;\ntype Status = typeof STATUS[keyof typeof STATUS]; \/\/ \"active\" | \"archived\"<\/code><\/pre>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2fb37a40\">5. \u53ef\u8fa8\u8bc6\u8054\u5408\u662f\u4ec0\u4e48\uff1f\u4e3a\u4ec0\u4e48\u63a8\u8350\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u7528\u5b57\u9762\u91cf\u6210\u5458\uff08\u5982 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">kind: \"circle\"<\/code>\uff09\u533a\u5206\u8054\u5408\u5206\u652f\uff0cswitch \u81ea\u52a8\u6536\u7a84\u3002\u5b83\u628a\u300c\u5408\u6cd5\u72b6\u6001\u300d\u7f16\u7801\u8fdb\u7c7b\u578b\uff0c\u914d\u5408 never \u7a77\u5c3d\u68c0\u67e5\u6d88\u706d\u6f0f\u5206\u652f\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2fb37a40\">6. \u7c7b\u578b\u6536\u7a84\u6709\u54ea\u4e9b\u624b\u6bb5\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">typeof\/instanceof\u3001in \u64cd\u4f5c\u7b26\u3001\u76f8\u7b49\u5224\u65ad\u3001\u8c13\u8bcd\u51fd\u6570\uff08<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">value is T<\/code>\uff09\u3001\u65ad\u8a00\u51fd\u6570\uff08<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">asserts value is T<\/code>\uff09\u3002\u52a0\u5206\u70b9\uff1a\u8bf4\u660e TS \u7684\u7a84\u5316\u57fa\u4e8e\u63a7\u5236\u6d41\u5206\u6790\uff0c\u8de8\u5f02\u6b65\u8fb9\u754c\u4f1a\u5931\u6548\uff08\u56de\u8c03\u91cc\u9700\u8981\u91cd\u65b0\u6821\u9a8c\uff09\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2fb37a40\">7. \u6cdb\u578b\u7684\u300c\u5206\u914d\u5f8b\u300d\u9677\u9631\u662f\u4ec0\u4e48\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u6761\u4ef6\u7c7b\u578b\u5bf9\u88f8\u7c7b\u578b\u53c2\u6570\u662f\u5206\u5e03\u5f0f\u6c42\u503c\uff1a<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">T extends U ? X : Y<\/code> \u4f5c\u7528\u5728\u8054\u5408\u7c7b\u578b\u65f6\u4f1a\u9010\u6210\u5458\u8ba1\u7b97\u3002\u60f3\u8df3\u8fc7\u5206\u5e03\u7528 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">[T] extends [U]<\/code>\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2fb37a40\">8. readonly \u6570\u7ec4\u4e0e const \u7684\u533a\u522b\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">const \u9501\u7ed1\u5b9a\uff08\u5f15\u7528\u4e0d\u53ef\u6362\uff09\uff0creadonly \u9501\u5185\u5bb9\uff08\u5143\u7d20\u4e0d\u53ef\u6539\uff09\u3002<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">ReadonlyArray&lt;T&gt;<\/code> \/ <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">as const<\/code> \u662f\u6784\u5efa\u4e0d\u53ef\u53d8\u6570\u636e\u6d41\u7684\u57fa\u7840\u3002<\/p>\n<figure style=\"margin:30px 0;text-align:center\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"900\" src=\"https:\/\/www.ziliaochi.cn\/wp-content\/uploads\/2026\/09\/interview-typescript-25q-fig.png\" alt=\"any \/ unknown \/ never \u4e00\u56fe\u5206\u6e05\" class=\"wp-image-300\" style=\"max-width:100%;height:auto;border-radius:12px;border:1px solid #e6ecf4;box-shadow:0 8px 24px rgba(15,30,60,.07)\" srcset=\"https:\/\/www.ziliaochi.cn\/wp-content\/uploads\/2026\/09\/interview-typescript-25q-fig.png 1200w, https:\/\/www.ziliaochi.cn\/wp-content\/uploads\/2026\/09\/interview-typescript-25q-fig-300x225.png 300w, https:\/\/www.ziliaochi.cn\/wp-content\/uploads\/2026\/09\/interview-typescript-25q-fig-1024x768.png 1024w, https:\/\/www.ziliaochi.cn\/wp-content\/uploads\/2026\/09\/interview-typescript-25q-fig-768x576.png 768w, https:\/\/www.ziliaochi.cn\/wp-content\/uploads\/2026\/09\/interview-typescript-25q-fig-800x600.png 800w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><figcaption style=\"margin-top:12px;font-size:13.5px;color:#7b8aa0;text-align:center;line-height:1.75\"><\/figcaption><\/figure>\n<h2 style=\"font-size:23px;line-height:1.45;font-weight:700;color:#0f1c2e;margin:46px 0 18px;padding:0 0 12px 14px;border-left:5px solid #2fb37a;border-bottom:1px solid #eef2f7;letter-spacing:.3px\" id=\"sec-2\">\u4e8c\u3001\u7c7b\u578b\u7f16\u7a0b\uff0810 \u95ee\uff09<\/h2>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2fb37a40\">9. Partial\/Required\/Pick\/Omit \u7684\u5b9e\u73b0\u539f\u7406\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u5168\u662f\u6620\u5c04\u7c7b\u578b\uff1a<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">Partial&lt;T&gt; = { [K in keyof T]?: T[K] }<\/code>\uff1bOmit \u501f\u52a9 Exclude\uff1a<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">{ [K in Exclude&lt;keyof T, U&gt;]: T[K] }<\/code>\u3002\u80fd\u624b\u5199\u8fd9\u56db\u4e2a\u662f\u7c7b\u578b\u7f16\u7a0b\u7684\u5165\u573a\u5238\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2fb37a40\">10. infer \u600e\u4e48\u7528\uff1f\u4e3e\u4f8b\u3002<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u5728\u6761\u4ef6\u7c7b\u578b\u4e2d\u300c\u58f0\u660e\u4e00\u4e2a\u5f85\u63a8\u65ad\u53d8\u91cf\u300d\uff1a<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">type Unwrap&lt;T&gt; = T extends Promise&lt;infer V&gt; ? V : T<\/code>\u3002\u5e38\u89c1\u4e8e\u63d0\u53d6\u6570\u7ec4\u5143\u7d20\u3001\u51fd\u6570\u8fd4\u56de\u503c\uff08<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">ReturnType<\/code> \u7684\u5b9e\u73b0\uff09\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2fb37a40\">11. \u5199\u4e00\u4e2a DeepPartial\u3002<\/h3>\n<pre style=\"background:#0f1a2b;color:#dbe6f5;border-radius:12px;padding:18px 20px;overflow-x:auto;font-size:13.6px;line-height:1.78;margin:22px 0;border:1px solid #1e2c42;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace\"><code style=\"background:none;border:none;color:inherit;padding:0;font-size:inherit;font-family:inherit\">type DeepPartial&lt;T&gt; = T extends object\n  ? { [K in keyof T]?: DeepPartial&lt;T[K]&gt; }\n  : T;<\/code><\/pre>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u52a0\u5206\u70b9\uff1a\u6ce8\u610f\u6570\u7ec4\u4e0e\u51fd\u6570\u7684\u5904\u7406\u8fb9\u754c\uff08\u5148\u6392\u9664 function \u518d\u9012\u5f52\uff0c\u6216\u5bf9\u6570\u7ec4\u6620\u5c04\u4e3a DeepPartial&lt;\u5143\u7d20&gt;[]\uff09\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2fb37a40\">12. Exclude \u4e0e Extract \u7684\u539f\u7406\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u57fa\u4e8e\u5206\u5e03\u5f0f\u6761\u4ef6\u7c7b\u578b\uff1a<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">Exclude&lt;T, U&gt; = T extends U ? never : T<\/code>\u3002\u8054\u5408\u7c7b\u578b\u8fdb\u3001\u8054\u5408\u7c7b\u578b\u51fa\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2fb37a40\">13. \u6a21\u677f\u5b57\u9762\u91cf\u7c7b\u578b\u80fd\u505a\u4ec0\u4e48\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u5b57\u7b26\u4e32\u7ea7\u7684\u7c7b\u578b\u8fd0\u7b97\uff1a\u8def\u7531\u6a21\u5f0f\u89e3\u6790\uff08<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">`\/user\/${infer Id}`<\/code>\uff09\u3001\u4e8b\u4ef6\u540d\u63a8\u5bfc\u3001CSS \u5355\u4f4d\u7ea6\u675f\u3002\u914d\u5408\u6620\u5c04\u7c7b\u578b\u53ef\u5b9e\u73b0\u300c\u5b57\u6bb5\u540d\u6539\u9020\u300d\uff08\u5982 getter \u524d\u7f00\uff09\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2fb37a40\">14. satisfies \u5173\u952e\u5b57\u89e3\u51b3\u4ec0\u4e48\u95ee\u9898\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u300c\u6821\u9a8c\u4f46\u4e0d\u62d3\u5bbd\u300d\uff1a<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">const config = {...} satisfies Config<\/code> \u65e2\u4fdd\u8bc1\u7b26\u5408 Config\uff0c\u53c8\u4fdd\u7559\u6bcf\u4e2a\u5b57\u9762\u91cf\u7684\u7cbe\u786e\u7c7b\u578b\uff08as \u65ad\u8a00\u4f1a\u4e22\u5931\u6536\u7a84\uff09\u3002TS 4.9 \u5f15\u5165\uff0c\u73b0\u4ee3\u4ee3\u7801\u91cc\u5e94\u4f18\u5148\u4e8e\u5e26\u7c7b\u578b\u7684 const \u58f0\u660e\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2fb37a40\">15. \u534f\u53d8\u4e0e\u9006\u53d8\u4f53\u73b0\u5728\u54ea\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u5bf9\u8c61\u5c5e\u6027\u534f\u53d8\uff08\u5b50\u7c7b\u578b\u53ef\u4ee5\u8d4b\u7ed9\u7236\u7c7b\u578b\u4f4d\u7f6e\uff09\uff0c\u51fd\u6570\u53c2\u6570\u9006\u53d8\uff08\u53c2\u6570\u8981\u6c42\u7236\u7c7b\u578b\u7684\u4f4d\u7f6e\u4e0d\u80fd\u4f20\u8981\u6c42\u5b50\u7c7b\u578b\u7684\u51fd\u6570\uff09\u3002<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">strictFunctionTypes<\/code> \u5f00\u542f\u540e\u53c2\u6570\u624d\u4e25\u683c\u9006\u53d8\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2fb37a40\">16. \u51fd\u6570\u91cd\u8f7d\u600e\u4e48\u5199\uff1f\u5b9e\u73b0\u7b7e\u540d\u4e3a\u4ec0\u4e48\u4e0d\u66b4\u9732\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u591a\u4e2a\u91cd\u8f7d\u7b7e\u540d + \u4e00\u4e2a\u5b9e\u73b0\u7b7e\u540d\uff1b\u5b9e\u73b0\u7b7e\u540d\u53ea\u7528\u4e8e\u5185\u90e8\u517c\u5bb9\uff0c\u5bf9\u5916\u4e0d\u53ef\u89c1\uff0c\u8c03\u7528\u65b9\u53ea\u80fd\u5339\u914d\u91cd\u8f7d\u7b7e\u540d\u2014\u2014\u8fd9\u4fdd\u8bc1\u4e86\u8c03\u7528\u4fa7\u7c7b\u578b\u7684\u7cbe\u786e\u6027\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2fb37a40\">17. \u58f0\u660e\u5408\u5e76\u4e0e\u6a21\u5757\u589e\u5f3a\u7684\u573a\u666f\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u7ed9\u7b2c\u4e09\u65b9\u5e93\u8865\u7c7b\u578b\uff1a<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">declare module \"lib\" { interface Options { debug?: boolean } }<\/code>\u3002\u52a0\u5206\u70b9\uff1a\u63d0\u9192\u58f0\u660e\u5408\u5e76\u662f\u53cc\u5203\u5251\uff0c\u6ee5\u7528\u4f1a\u8ba9\u7c7b\u578b\u300c\u6765\u6e90\u4e0d\u53ef\u8003\u300d\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2fb37a40\">18. \u88c5\u9970\u5668\u4e0e TS 7 \u7684\u5173\u7cfb\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">TS 7\uff08\u539f\u751f\u7f16\u8bd1\u5668\uff09\u4ee5 ECMAScript \u6807\u51c6\u88c5\u9970\u5668\u4e3a\u51c6\uff0c\u65e7\u5b9e\u9a8c\u6027\u88c5\u9970\u5668\u8bed\u4e49\u4e0d\u4fdd\u8bc1\u517c\u5bb9\u2014\u2014\u5b58\u91cf\u4ee3\u7801\u8fc1\u79fb TS 7 \u65f6\u8fd9\u662f\u91cd\u70b9\u68c0\u67e5\u9879\u4e4b\u4e00\uff08\u8be6\u89c1 <a href=\"https:\/\/github.com\/microsoft\/TypeScript\" target=\"_blank\" rel=\"noopener\" style=\"color:#2fb37a;text-decoration:none;border-bottom:1px solid #2fb37a66;transition:opacity .15s\">TypeScript \u5b98\u65b9\u4ed3\u5e93<\/a>\u7684\u8fc1\u79fb\u8bf4\u660e\uff09\u3002<\/p>\n<h2 style=\"font-size:23px;line-height:1.45;font-weight:700;color:#0f1c2e;margin:46px 0 18px;padding:0 0 12px 14px;border-left:5px solid #2fb37a;border-bottom:1px solid #eef2f7;letter-spacing:.3px\" id=\"sec-3\">\u4e09\u3001\u5de5\u7a0b\u914d\u7f6e\uff087 \u95ee\uff09<\/h2>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2fb37a40\">19. strict \u6a21\u5f0f\u5305\u542b\u54ea\u4e9b\u5173\u952e\u9879\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">strictNullChecks\uff08\u53ef\u7a7a\u6027\uff09\u3001noImplicitAny\uff08\u9690\u5f0f any \u62a5\u9519\uff09\u3001strictFunctionTypes\u3001strictBindCallApply\u3001alwaysStrict \u7b49\u3002\u9762\u8bd5\u89c2\u70b9\uff1a\u65b0\u9879\u76ee\u5168\u5f00\uff0c\u5b58\u91cf\u9879\u76ee\u4ece strictNullChecks \u5f00\u59cb\u9010\u9879\u5f00\u542f\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2fb37a40\">20. skipLibCheck \u4e3a\u4ec0\u4e48\u5efa\u8bae\u5f00\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u8df3\u8fc7\u5bf9 node_modules \u5185 .d.ts \u7684\u68c0\u67e5\u2014\u2014\u7b2c\u4e09\u65b9\u58f0\u660e\u7684\u9519\u8bef\u4e0d\u8be5\u963b\u585e\u4f60\u7684\u6784\u5efa\uff0c\u4e14\u68c0\u67e5\u5b83\u4eec\u8017\u65f6\u5de8\u5927\u3002\u81ea\u5df1\u4ee3\u7801\u7684\u68c0\u67e5\u4e0d\u53d7\u5f71\u54cd\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2fb37a40\">21. isolatedModules \u610f\u5473\u7740\u4ec0\u4e48\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u6bcf\u4e2a\u6587\u4ef6\u5fc5\u987b\u80fd\u88ab\u72ec\u7acb\u8f6c\u8bd1\uff08\u5355\u6587\u4ef6\u89c6\u89d2\u7c7b\u578b\u53ef\u5224\u5b9a\uff09\u3002\u7981\u6b62\u8de8\u6587\u4ef6\u7684\u7eaf\u7c7b\u578b\u526f\u4f5c\u7528\uff0c\u8fd9\u4e5f\u662f\u4e0e esbuild\/swc \u7c7b\u5355\u6587\u4ef6\u7f16\u8bd1\u5668\u517c\u5bb9\u7684\u524d\u63d0\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2fb37a40\">22. \u9879\u76ee\u5f15\u7528\uff08project references\uff09\u89e3\u51b3\u4ec0\u4e48\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">monorepo \u589e\u91cf\u6784\u5efa\uff1a\u62c6\u6210\u591a\u4e2a tsconfig\uff0c\u4f9d\u8d56\u65b9\u53ea\u770b\u88ab\u4f9d\u8d56\u65b9\u7684 .d.ts\uff0c\u6539\u4e00\u4e2a\u5305\u4e0d\u5fc5\u5168\u91cf\u7c7b\u578b\u68c0\u67e5\u3002\u914d\u5408 TS 7 \u539f\u751f\u7f16\u8bd1\u5668\u7684\u5e76\u884c\u80fd\u529b\uff0c\u6536\u76ca\u8fdb\u4e00\u6b65\u653e\u5927\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2fb37a40\">23. \u7c7b\u578b\u6d4b\u8bd5\u600e\u4e48\u5199\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u7528\u7c7b\u578b\u65ad\u8a00\u300c\u53ef\u8d4b\u503c\/\u4e0d\u53ef\u8d4b\u503c\u300d\u6d4b\u8bd5\u5de5\u5177\u7c7b\u578b\uff1a<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">expectTypeOf(x).toEqualTypeOf&lt;Expected&gt;()<\/code>\uff08vitest\uff09\u6216 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@ts-expect-error<\/code> \u6807\u6ce8\u9884\u671f\u7684\u7f16\u8bd1\u9519\u8bef\u3002\u7c7b\u578b\u4e5f\u662f\u4ee3\u7801\uff0c\u4e5f\u8981\u56de\u5f52\u6d4b\u8bd5\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2fb37a40\">24. public_api \u4e0e\u5185\u90e8\u7c7b\u578b\u7684\u8fb9\u754c\u600e\u4e48\u7ba1\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u5bfc\u51fa\u9762\u6700\u5c0f\u5316\uff1a\u5305\u5165\u53e3\u53ea export \u516c\u5171 API\uff0c\u5185\u90e8\u7c7b\u578b\u7528 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">\/** @internal *\/<\/code> \u6807\u8bb0\u5e76\u7531 api-extractor \u751f\u6210\u62a5\u544a\u505a\u7834\u574f\u6027\u53d8\u66f4\u68c0\u67e5\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #2fb37a40\">25. \u4ec0\u4e48\u60c5\u51b5\u4e0b\u300cany \u4e00\u6b21\u300d\u662f\u53ef\u63a5\u53d7\u7684\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u8fb9\u754c\u5904\u7684\u4e09\u65b9\u65e0\u7c7b\u578b\u6570\u636e\uff08\u7acb\u5373\u6536\u7a84\uff09\u3001\u539f\u578b\u9a8c\u8bc1\u671f\u7684\u4e34\u65f6\u901a\u9053\u2014\u2014\u4f46\u5fc5\u987b\u96c6\u4e2d\u3001\u6ce8\u91ca\u539f\u56e0\u3001\u9650\u671f\u6d88\u706d\u3002\u8fd9\u95ee\u5b9e\u9645\u8003\u5bdf\u7684\u662f\u5bf9\u300c\u7c7b\u578b\u7cfb\u7edf\u662f\u6e10\u8fdb\u7684\u300d\u8fd9\u4e00\u8bbe\u8ba1\u54f2\u5b66\u7684\u7406\u89e3\u3002<\/p>\n<div style=\"margin:42px 0 0;padding:22px 0 0;border-top:1px solid #eaeef4\">\n<div style=\"font-size:13px;color:#93a1b5;letter-spacing:1px;margin-bottom:12px\">\u6807\u7b7e<\/div>\n<p><span style=\"display:inline-block;background:#f3f6fa;border:1px solid #e4eaf2;color:#5b6c85;font-size:13px;padding:5px 12px;border-radius:999px;margin:0 8px 8px 0\">#TypeScript<\/span><span style=\"display:inline-block;background:#f3f6fa;border:1px solid #e4eaf2;color:#5b6c85;font-size:13px;padding:5px 12px;border-radius:999px;margin:0 8px 8px 0\">#\u524d\u7aef\u9762\u8bd5<\/span><span style=\"display:inline-block;background:#f3f6fa;border:1px solid #e4eaf2;color:#5b6c85;font-size:13px;padding:5px 12px;border-radius:999px;margin:0 8px 8px 0\">#\u7c7b\u578b\u7cfb\u7edf<\/span><span style=\"display:inline-block;background:#f3f6fa;border:1px solid #e4eaf2;color:#5b6c85;font-size:13px;padding:5px 12px;border-radius:999px;margin:0 8px 8px 0\">#\u9762\u8bd5\u9898<\/span><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>25 \u95ee\u8986\u76d6\u7c7b\u578b\u57fa\u7840\uff08any\/unknown\/never\/\u6536\u7a84\uff09\u3001\u7c7b\u578b\u7f16\u7a0b\uff08\u6620\u5c04\u7c7b\u578b\/infer\/DeepPartial\/satisfies\uff09\u4e0e\u5de5\u7a0b\u914d\u7f6e\uff08strict\/project references\/\u7c7b\u578b\u6d4b\u8bd5\uff09\u4e09\u4e2a\u68af\u5ea6\uff0c\u542b TS 7 \u539f\u751f\u7f16\u8bd1\u5668\u8fc1\u79fb\u76f8\u5173\u7684\u65b0\u8003\u70b9\u3002<\/p>\n","protected":false},"author":1,"featured_media":299,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,11],"tags":[84,168,170,169],"class_list":["post-301","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-frontend-question-bank","category-question-bank","tag-typescript","tag-168","tag-170","tag-169"],"_links":{"self":[{"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/posts\/301","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/comments?post=301"}],"version-history":[{"count":0,"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/posts\/301\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/media\/299"}],"wp:attachment":[{"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/media?parent=301"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/categories?post=301"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/tags?post=301"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}