Давление в шинах ауди а4 б8
Перейти к содержимому

Давление в шинах ауди а4 б8

  • автор:

Давление в шинах Audi A4

Рекомендованное давление в шинах для вашего Audi A4 указано в инструкции по эксплуатации, а также дублируется на табличке (на крышке лючка бензобака, на стойке водительской двери или на крышке ящика для перчаток).

ВАЖНО! Давление требуется измерять на холодной шине (автомобиль должен находиться в состоянии покоя не менее 2-х часов до измерения).
ВАЖНО! Все указанные в таблице значения давления приведены для рекомендованных типоразмеров шин вашего Ауди А4.

Обозначения в таблице: SSR — шины RUNFLAT, позволяющие продолжить движение после потери давления воздуха в шине; VA — типоразмер шин, устанавливаемых на переднюю ось автомобиля; HA — типоразмер шин, устанавливаемых на заднюю ось автомобиля; XL — шина увеличенной грузоподъемности.

Audi A4 (B7) 2005-2007 гг / Avant (B7) 2005-2008 гг

Модель и модификация Рекомендованный размер шин Обычная загрузка Полная загрузка
Передние Задние Передние Задние
1.6 (75 kW),
2.0 MPI (96 kW),
2.0 FSI (110 kW) -06,
1.9 TDI (85 kW)
205/55 R 16 91 W 2.2 2.2 2.6 2.6
215/55 R 16 93 Y 2.1 2.1 2.5 2.5
235/45 R 17 94 Y 2.1 2.1 2.5 2.5
235/40 R 18 91 Y 2.2 2.2 2.6 2.6
1.8 T MPI (120 kW),
2.0 TDI (103 kW)
205/55 R 16 91 W 2.4 2.4 2.8 2.8
215/55 R 16 93 Y 2.2 2.2 2.6 2.6
235/45 R 17 94 Y 2.2 2.2 2.6 2.6
235/40 R 18 91 Y 2.4 2.4 2.8 2.8
2.0 T FSI (147 kW) 215/55 R 16 93 Y 2.2 2.2 2.6 2.6
235/45 R 17 94 Y 2.2 2.2 2.6 2.6
235/40 R 18 91 Y 2.4 2.4 2.8 2.8
2.0 TFSI DTM (162 kW) 235/40 R 18 95 Y XL 2.7 2.7 3.0 3.0
3.2 V 6 FSI (188 kW),
2.5 TDI V 6 (120 kW) -06,
2.0 TDI (125 kW) 06-,
2.7 TDI DPF (132 kW)
215/55 R 16 93 Y 2.3 2.3 2.6 2.6
235/45 R 17 94 Y 2.3 2.3 2.6 2.6
235/40 R 18 95 Y XL 2.6 2.6 2.9 2.9
3.0 TDI V 6 (150 kW) -06,
3.0 TDI (171 kW) 06-
215/55 R 16 97 Y XL 2.4 2.4 2.7 2.7
235/45 R 17 94 Y 2.4 2.4 2.7 2.7
235/40 R 18 95 Y XL 2.7 2.7 3.0 3.0

Audi A4 (B8) 2008-…/2012-… / Avant (B8) 2008-…/2012-… гг

Модель и модификация Рекомендованный размер шин Обычная загрузка Полная загрузка
Передние Задние Передние Задние
1.8 TFSI (88 kW),
1.8 TFSI Avant (88 kW),
2.0 TDI (88 kW),
2.0 TDI Avant (88 kW),
2.0 TDI (105 kW),
2.0 TDI Avant (105 kW)
205/60 R 16 92 V 2.5 2.2 2.6 2.6
225/55 R 16 95 Y 2.5 2.2 2.6 2.6
225/50 R 17 94 Y 2.5 2.2 2.6 2.6
245/45 R 17 95 Y 2.5 2.2 2.6 2.6
245/45 R 17 95 Y SSR 2.5 2.2 2.6 2.6
245/40 R 18 93 Y 2.5 2.2 2.6 2.6
255/35 R 19 96 Y XL 2.5 2.2 2.6 2.6
1.8 TFSI (118 kW),
1.8 TFSI Avant (118 kW),
1.8 TFSI (125 kW),
1.8 TFSI Avant (125 kW),
2.0 TFSI (132 kW),
2.0 TFSI Avant (132 kW),
2.0 TFSI / Quattro (155 kW),
2.0 TFSI Avant / Quattro (155 kW)
225/55 R 16 95 Y 2.5 2.2 2.6 2.6
225/50 R 17 94 Y 2.5 2.2 2.6 2.6
245/45 R 17 95 Y 2.5 2.2 2.6 2.6
245/45 R 17 95 Y SSR 2.5 2.2 2.6 2.6
245/40 R 18 93 Y 2.5 2.2 2.6 2.6
255/35 R 19 96 Y XL 2.5 2.2 2.6 2.6
3.2 FSI Quattro (195 kW),
3.2 FSI Quattro Avant (195 kW),
3.0 TDI Quattro (180 kW),
3.0 TDI Quattro Avant (180 kW)
225/50 R 17 94 Y 2.5 2.2 2.6 2.6
245/45 R 17 95 Y 2.5 2.2 2.6 2.6
245/45 R 17 95 Y SSR 2.5 2.2 2.6 2.6
245/40 R 18 93 Y 2.5 2.2 2.6 2.6
255/35 R 19 96 Y XL 2.5 2.2 2.6 2.6
2.0 TDI (125 kW),
2.0 TDI Avant (125 kW),
2.0 TDI / Quattro (130 kW),
2.0 TDI Avant / Quattro (130 kW),
2.7 TDI (140 kW),
2.7 TDI Avant (140 kW),
3.0 TDI (150 kW),
3.0 TDI Avant (150 kW)
225/55 R 16 95 Y 2.5 2.2 2.6 2.6
225/50 R 17 94 Y 2.5 2.2 2.6 2.6
245/45 R 17 95 Y 2.5 2.2 2.6 2.6
245/45 R 17 95 Y SSR 2.5 2.2 2.6 2.6
245/40 R 18 93 Y 2.5 2.2 2.6 2.6
255/35 R 19 96 Y XL 2.5 2.2 2.6 2.6

Audi A4 Cabrio (B7) 2006-2009 гг

Модель и модификация Рекомендованный размер шин Обычная загрузка Полная загрузка
Передние Задние Передние Задние
1.8 T (120 kW),
2.0 TDI (103 kW)
205/55 R 16 91 W 2.5 2.3 2.7 2.9
215/55 R 16 93 Y 2.2 2.2 2.4 2.6
235/45 R 17 94 Y 2.2 2.2 2.4 2.6
235/40 R 18 91 Y 2.5 2.3 2.7 2.9
2.0 TFSI (147 kW) 215/55 R 16 93 Y 2.3 2.2 2.5 2.7
235/45 R 17 94 Y 2.3 2.2 2.5 2.7
235/40 R 18 91 Y 2.6 2.3 2.8 3.0
2.7 TDI (132 kW) 06-,
3.2 FSI V 6 (188 kW),
3.0 TDI (171 kW)
215/55 R 16 93 Y 2.4 2.2 2.6 2.8
235/45 R 17 94 Y 2.4 2.2 2.6 2.8
235/40 R 18 91 Y 2.6 2.4 2.8 3.0

Audi A4 Allroad Quattro 2009-… гг

Модель и модификация Рекомендованный размер шин Обычная загрузка Полная загрузка
Передние Задние Передние Задние
2.0 TDI (105 kW),
2.0 TDI (125 kW),
2.0 TDI (130 kW)
225/55 R 17 97 W 2.2 2.1 2.3 2.5
245/45 R 18 96 Y 2.2 2.1 2.3 2.5

Давление в шинах Audi A4 B8

Для стандартных шин автомобиля A4 (B8) размером R17 оптимальное давление в передних колесах – 2.2 bar, в задних колесах – 2.4 bar, при условии минимальной загрузки автомобиля пассажирами. В таблице ниже приведены другие показатели давления с учетом подходящих типов и размеров шин.

Диаметр дисков

передних колес задних колес
передних колес задних колес
Обычные
Усиленные
Обычные
Усиленные
Ранфлет
Обычные
Низкопрофильные
Усиленные
Ранфлет
Обычные
Низкопрофильные
Усиленные
Ранфлет
Низкопрофильные
Усиленные
Ранфлет

Показатели давления указаны в bar=at=кгс/см 2 для холодных шин
О разновидностях шин
Какое давление должно быть зимой?

Для любого времени года показатели давления используемых шин будут одинаковыми, куда важнее наличие/отсутствие зимней резины. Давление должно быть отрегулировано на холодных шинах в используемой окружающей среде, а не в теплом гараже. Важно понимать, что при резкой смене температуры давление в шинах может измениться на 0,2–0,4 бар.

Давление в колесах при движении по мокрой дороге

При движении по мокрой трассе возникает проблема неправильного распределения сил в точке, где покрышка контактирует с водой. В таких ситуациях, необходимо внимательнее следить за стабильностью давления в колесах.

Нельзя специально снижать давление в шине или перекачивать ее. Из-за пониженного давления, шины будут слабее контактировать в центральной части протектора. Если же колеса перекачаны, то слабый контакт будет присутствовать в плечевых зонах, что также сильно снижает устойчивость к аквапланированию.

Как еще узнать какое давление необходимо

Информацию о правильном давлении для передних и задних колес автомобиля Audi A4 B8, можно узнать из справочных табличек расположенных на торце водительской двери или на внутренней стороне крышки бензобака.

В справочных мануалах сервисной книжки также содержится информация о показателях давления для шин, рекомендуемых заводом изготовителем.

Если планируется эксплуатировать подходящую резину не заводских параметров, диапазон давлений может быть указан непосредственно на ее боковой части среди другой маркировки.

Все поколения Audi A4

Давление в шинах Audi A4 B8

Для стандартных шин автомобиля A4 (B8) размером R17 оптимальное давление в передних колесах – 2.2 bar, в задних колесах – 2.4 bar, при условии минимальной загрузки автомобиля пассажирами. В таблице ниже приведены другие показатели давления с учетом подходящих типов и размеров шин.

Диаметр дисков

передних колес задних колес
передних колес задних колес
Обычные
Усиленные
Обычные
Усиленные
Ранфлет
Обычные
Низкопрофильные
Усиленные
Ранфлет
Обычные
Низкопрофильные
Усиленные
Ранфлет
Низкопрофильные
Усиленные
Ранфлет

Показатели давления указаны в bar=at=кгс/см 2 для холодных шин
О разновидностях шин
Какое давление должно быть зимой?

Для любого времени года показатели давления используемых шин будут одинаковыми, куда важнее наличие/отсутствие зимней резины. Давление должно быть отрегулировано на холодных шинах в используемой окружающей среде, а не в теплом гараже. Важно понимать, что при резкой смене температуры давление в шинах может измениться на 0,2–0,4 бар.

Давление в колесах при движении по мокрой дороге

При движении по мокрой трассе возникает проблема неправильного распределения сил в точке, где покрышка контактирует с водой. В таких ситуациях, необходимо внимательнее следить за стабильностью давления в колесах.

Нельзя специально снижать давление в шине или перекачивать ее. Из-за пониженного давления, шины будут слабее контактировать в центральной части протектора. Если же колеса перекачаны, то слабый контакт будет присутствовать в плечевых зонах, что также сильно снижает устойчивость к аквапланированию.

Как еще узнать какое давление необходимо

Информацию о правильном давлении для передних и задних колес автомобиля Audi A4 B8, можно узнать из справочных табличек расположенных на торце водительской двери или на внутренней стороне крышки бензобака.

В справочных мануалах сервисной книжки также содержится информация о показателях давления для шин, рекомендуемых заводом изготовителем.

Если планируется эксплуатировать подходящую резину не заводских параметров, диапазон давлений может быть указан непосредственно на ее боковой части среди другой маркировки.

Все поколения Audi A4

Announcing TypeScript 4.8 RC

Today we’re excited to announce our Release Candidate (RC) of TypeScript 4.8. Between now and the stable release of TypeScript 4.8, we expect no further changes apart from critical bug fixes. To get started using the RC, you can get it through NuGet, or use npm with the following command:

npm install -D typescript@rc 
  • Downloading for Visual Studio 2022/2019
  • Following directions for Visual Studio Code.

Here’s a quick list of what’s new in TypeScript 4.8!

  • Improved Intersection Reduction, Union Compatibility, and Narrowing
  • Improved Inference for infer Types in Template String Types
  • —build , —watch , and —incremental Performance Improvements
  • Errors When Comparing Object and Array Literals
  • Improved Inference from Binding Patterns
  • File-Watching Fixes (Especially Across git checkout s)
  • Find-All-References Performance Improvements
  • Exclude Specific Files from Auto-Imports
  • Correctness Fixes and Breaking Changes

What’s New Since the Beta?

Since our beta release, the RC now has support for excluding which files are considered in auto-imports. The beta release post also did not document a break around unused destructuring aliases in type signatures, which is now detailed in our Correctness Fixes and Breaking Changes section.

Improved Intersection Reduction, Union Compatibility, and Narrowing

TypeScript 4.8 brings a series of correctness and consistency improvements under —strictNullChecks . These changes affect how intersection and union types work, and are leveraged in how TypeScript narrows types.

For example, unknown is close in spirit to the union type <> | null | undefined because it accepts null , undefined , and any other type. TypeScript now recognizes this, and allows assignments from unknown to <> | null | undefined .

function f(x: unknown, y: <> | null | undefined) x = y; // always worked y = x; // used to error, now works > 

Another change is that <> intersected with any other object type simplifies right down to that object type. That meant that we were able to rewrite NonNullable to just use an intersection with <> , because <> & null and <> & undefined just get tossed away.

- type NonNullable = T extends null | undefined ? never : T; + type NonNullable = T & <>; 

This is an improvement because intersection types like this can be reduced and assigned to, while conditional types currently cannot. So NonNullable> now simplifies at least to NonNullable , whereas it didn’t before.

function fooT>(x: NonNullableT>, y: NonNullableNonNullableT>>) x = y; // always worked y = x; // used to error, now works > 

These changes also allowed us to bring in sensible improvements in control flow analysis and type narrowing. For example, unknown is now narrowed just like <> | null | undefined in truthy branches.

function narrowUnknownishUnion(x: <> | null | undefined) if (x) x; // <> > else  x; // <> | null | undefined > > function narrowUnknown(x: unknown) if (x) x; // used to be 'unknown', now '<>' > else  x; // unknown > > 

Generic values also get narrowed similarly. When checking that a value isn’t null or undefined , TypeScript now just intersects it with <> – which again, is the same as saying it’s NonNullable . Putting many of the changes here together, we can now define the following function without any type assertions.

function throwIfNullableT>(value: T): NonNullableT> if (value === undefined || value === null) throw Error("Nullable value!"); > // Used to fail because 'T' was not assignable to 'NonNullable'. // Now narrows to 'T & <>' and succeeds because that's just 'NonNullable'. return value; > 

value now gets narrowed to T & <> , and is now identical with NonNullable – so the body of the function just works with no TypeScript-specific syntax.

On their own, these changes may appear small – but they represent fixes for many many paper cuts that have been reported over several years.

For more specifics on these improvements, you can read more here.

Improved Inference for infer Types in Template String Types

TypeScript recently introduced a way to add extends constraints to infer type variables in conditional types.

// Grabs the first element of a tuple if it's assignable to 'number', // and returns 'never' if it can't find one. type TryGetNumberIfFirstT> = T extends [infer U extends number, . unknown[]] ? U : never; 

If these infer types appear in a template string type and are constrained to a primitive type, TypeScript will now try to parse out a literal type.

// SomeNum used to be 'number'; now it's '100'. type SomeNum = "100" extends `$infer U extends number>` ? U : never; // SomeBigInt used to be 'bigint'; now it's '100n'. type SomeBigInt = "100" extends `$infer U extends bigint>` ? U : never; // SomeBool used to be 'boolean'; now it's 'true'. type SomeBool = "true" extends `$infer U extends boolean>` ? U : never; 

This can now better convey what a library will do at runtime, and give more precise types.

One note on this is that when TypeScript parses these literal types out it will greedily try to parse out as much of what looks like of the appropriate primitive type; however it then checks to see if the print-back of that primitive matches up with the string contents. In other words, TypeScript checks whether the going from the string, to the primitive, and back matches. If it doesn’t see that the string can be «round-tripped», then it will fall back to the base primitive type.

// JustNumber is `number` here because TypeScript parses out `"1.0"`, but `String(Number("1.0"))` is `"1"` and doesn't match. type JustNumber = "1.0" extends `$infer T extends number>` ? T : never; 

—build , —watch , and —incremental Performance Improvements

TypeScript 4.8 introduces several optimizations that should speed up scenarios around —watch and —incremental , along with project references builds using —build . For example, TypeScript is now able to avoid spending time updating timestamps during no-op changes in —watch mode, which makes rebuilds faster and avoids messing with other build tools that might be watching for TypeScript’s output. Many other optimizations where we’re able to reuse information across —build , —watch , and —incremental have been introduced as well.

How big are these improvements? Well, on a fairly large internal codebase, we’ve seen time reductions on the order of 10%-25% on many simple common operations, with around 40% time reductions in no-change scenarios. We’ve seen similar results on the TypeScript codebase as well.

Errors When Comparing Object and Array Literals

In many languages, operators like == perform what’s called «value» equality on objects. For example, in Python it’s valid to check whether a list is empty by checking whether a value is equal to the empty list using == .

if people_at_home == []: print("that's where she lies, broken inside. ) 

This is not the case in JavaScript, where == and === between objects and arrays check whether both references point to the same instance. We believe that this is at best an early foot-gun for JavaScript developers, and at worst a bug in production code. That’s why TypeScript now disallows code like the following.

let peopleAtHome = []; if (peopleAtHome === []) // ~~~~~~~~~~~~~~~~~~~ // This condition will always return 'false' since JavaScript compares objects by reference, not value. console.log("that's where she lies, broken inside. ) > 

We’d like to extend our gratitude to Jack Works who contributed this check. You can view the changes involved here.

Improved Inference from Binding Patterns

In some cases, TypeScript will pick up a type from a binding pattern to make better inferences.

declare function chooseRandomlyT>(x: T, y: T): T; let [a, b, c] = chooseRandomly([42, true, "hi!"], [0, false, "bye!"]); // ^ ^ ^ // | | | // | | string // | | // | boolean // | // number 

When chooseRandomly needs to figure out a type for T , it will primarily look at [42, true, «hi!»] and [0, false, «bye!»] ; but TypeScript needs to figure out whether those two types should be Array or the tuple type [number, boolean, string] . To do that, it will look for existing candidates as a hint to see whether there are any tuple types. When TypeScript sees the binding pattern [a, b, c] , it creates the type [any, any, any] , and that type gets picked up as a low-priority candidate for T which also gets used as a hint for the types of [42, true, «hi!»] and [0, false, «bye!»] .

You can see how this was good for chooseRandomly , but it fell short in other cases. For example, take the following code

declare function fT>(x?: T): T; let [x, y, z] = f(); 

The binding pattern [x, y, z] hinted that f should produce an [any, any, any] tuple; but f really shouldn’t change its type argument based on a binding pattern. It can’t suddenly conjure up a new array-like value based on what it’s being assigned to, so the binding pattern type has way too much influence on the produced type. On top of that, because the binding pattern type is full of any s, we’re left with x , y , and z being typed as any .

In TypeScript 4.8, these binding patterns are never used as candidates for type arguments. Instead, they’re just consulted in case a parameter needs a more specific type like in our chooseRandomly example. If you need to revert to the old behavior, you can always provide explicit type arguments.

You can look at the change on GitHub if you’re curious to learn more.

File-Watching Fixes (Especially Across git checkout s)

We’ve had a long-standing bug where TypeScript has a very hard time with certain file changes in —watch mode and editor scenarios. Sometimes the symptoms are stale or inaccurate errors that might show up that require restarting tsc or VS Code. Frequently these occur on Unix systems, and you might have seen these after saving a file with vim or swapping branches in git.

This was caused by assumptions of how Node.js handles rename events across file systems. File systems used by Linux and macOS utilize inodes, and Node.js will attach file watchers to inodes rather than file paths. So when Node.js returns a watcher object, it might be watching a path or an inode depending on the platform and file system.

To be a bit more efficient, TypeScript tries to reuse the same watcher objects if it detects a path still exists on disk. This is where things went wrong, because even if a file still exists at that path, a distinct file might have been created, and that file will have a different inode. So TypeScript would end up reusing the watcher object instead of installing a new watcher at the original location, and watch for changes at what might be a totally irrelevant file. So TypeScript 4.8 now handles these cases on inode systems and properly installs a new watcher and fixes this.

We’d like to extend our thanks to Marc Celani and his team at Airtable who invested lots of time in investigating the issues they were experiencing and pointing out the root cause. You can view the specific fixes around file-watching here.

Find-All-References Performance Improvements

When running find-all-references in your editor, TypeScript is now able to act a little smarter as it aggregates references. This reduced the amount of time TypeScript took to search a widely-used identifier in its own codebase by about 20%.

Exclude Specific Files from Auto-Imports

TypeScript 4.8 introduces an editor preference for excluding files from auto-imports. In Visual Studio Code, file names or globs can be added under «Auto Import File Exclude Patterns» in the Settings UI, or in a .vscode/settings.json file:

 // Note that `javascript.preferences.autoImportFileExcludePatterns` can be specified for JavaScript too. "typescript.preferences.autoImportFileExcludePatterns": [ "**/node_modules/@types/node" ] > 

This can be useful in cases where you can’t avoid having certain modules or libraries in your compilation but you rarely want to import from them. These modules might have lots of exports that can pollute the auto-imports list and make it harder to navigate, and this option can help in those situations.

Correctness Fixes and Breaking Changes

Due to the nature of type system changes, there are very few changes that can be made that don’t affect some code; however, there are a few changes that are more likely to require adapting existing code.

lib.d.ts Updates

While TypeScript strives to avoid major breaks, even small changes in the built-in libraries can cause issues. We don’t expect major breaks as a result of DOM and lib.d.ts updates, but one notable change is that the cause property on Error s now has the type unknown instead of Error .

Unconstrained Generics No Longer Assignable to <>

In TypeScript 4.8, for projects with strictNullChecks enabled, TypeScript will now correctly issue an error when an unconstrained type parameter is used in a position where null or undefined are not legal values. That will include any type that expects <> , object , or an object type with all-optional properties.

A simple example can be seen in the following.

// Accepts any non-null non-undefined value function bar(value: <>) Object.keys(value); // This call throws on null/undefined at runtime. > // Unconstrained type parameter T. function fooT>(x: T) bar(x); // Used to be allowed, now is an error in 4.8. // ~ // error: Argument of type 'T' is not assignable to parameter of type '<>'. > foo(undefined); 

As demonstrated above, code like this has a potential bug – the values null and undefined can be indirectly passed through these unconstrained type parameters to code that is not supposed to observe those values.

This behavior will also be visible in type positions. One example would be:

interface FooT> x: BarT>; > interface BarT extends <>> 

Existing code that didn’t want to handle null and undefined can be fixed by propagating the appropriate constraints through.

- function foo(x: T) + function foo>(x: T) 

Another work-around would be to check for null and undefined at runtime.

 function foo(x: T) + if (x !== null && x !== undefined)  bar(x); + > > 

And if you know that for some reason, your generic value can’t be null or undefined , you can just use a non-null assertion.

 function foo(x: T) - bar(x); + bar(x!); > 

When it comes to types, you’ll often either need to propagate constraints, or intersect your types with <> .

Types Cannot Be Imported/Exported in JavaScript Files

TypeScript previously allowed JavaScript files to import and export entities declared with a type, but no value, in import and export statements. This behavior was incorrect, because named imports and exports for values that don’t exist will cause a runtime error under ECMAScript modules. When a JavaScript file is type-checked under —checkJs or through a // @ts-check comment, TypeScript will now issue an error.

// @ts-check // Will fail at runtime because 'SomeType' is not a value. import  someValue, SomeType > from "some-module"; /** * @type  */ export const myValue = someValue; /** * @typedef MyType */ // Will fail at runtime because 'MyType' is not a value. export  MyType as MyExportedType >; 

To reference a type from another module, you can instead directly qualify the import.

- import < someValue, SomeType >from "some-module"; + import < someValue >from "some-module"; /** - * @type + * @type */ export const myValue = someValue; 

To export a type, you can just use a /** @typedef */ comment in JSDoc. @typedef comments already automatically export types from their containing modules.

 /** * @typedef MyType */ + /** + * @typedef MyExportedType + */ - export < MyType as MyExportedType >; 

Binding Patterns Do Not Directly Contribute to Inference Candidates

As mentioned above, binding patterns no longer change the type of inference results in function calls. You can read more about the original change here.

Unused Renames in Binding Patterns are Now Errors in Type Signatures

TypeScript’s type annotation syntax often looks like it can be used when destructuring values. For example, take the following function.

declare function makeCar( name: string, age: number >): Person; 

You might read this signature and thing that makePerson obviously takes an object with a name property with the type string and an age property with the type number ; however, JavaScript’s destructuring syntax is actually taking precedence here. makePerson does say that it’s going to take an object with a name and an age property, but instead of specifying a type for them, it’s just saying that it renames name and age to string and number respectively.

In a pure type construct, writing code like this is useless, and typically a mistake since developers usually assume they’re writing a type annotation.

TypeScript 4.8 makes these an error unless they’re referenced later in the signature. The correct way to write the above signature would be as follows:

declare function makePerson(options:  name: string, age: number >): Person; // or declare function makePerson( name, age >:  name: string, age: number >): Person; 

This change can catch bugs in declarations, and has been helpful for improving existing code. We’d like to extend our thanks to GitHub user uhyo for providing this check. You can read up on the change here.

What’s Next?

In the coming weeks, our team will be focusing on work for TypeScript 4.9, while only making critical fixes for TypeScript 4.8’s stable release. You can keep track of our target dates on the TypeScript 4.8 Iteration Plan.

In the meantime, download the Release Candidate today, and if you run into anything, give us your feedback so we can make TypeScript 4.8 even better!

– Daniel Rosenwasser and the TypeScript Team

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *