consdata.com
Technical blog Business blog HR department
PL
typescript

Czy wiesz, że w TypeScript możesz łączyć typy za pomocą interpolacji ciągów znaków?

author Piotr Grobelny
29 December 2023

W TypeScript możemy tworzyć swoje własne typy (Literal Types) w następujący sposób:

type lang = 'pl' | 'en';

gdzie używamy znaku | aby móc zdefiniować kilka różnych typów (Union Types).

W TypeScript 4.1 pojawiła się możliwość łączenia ze sobą typów za pomocą interpolacji ciągów:

type lang = 'pl' | 'en';
type textType = 'description' | 'title';

type textType = '${textType}_${lang};

Dzięki temu możemy otrzymać każdą możliwą kombinację typów w ramach nowego typu. Dla tego przykładu będą to: description_pl, description_en, title_pl, title_en.

Więcej informacji znajdziecie pod adresem: https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html

Newest posts

  • Reliable event delivery in Apache Kafka based on retry and DLQ
  • Event Tracking - finding a needle in a haystack
  • Kouncil - a modern Kafka frontend
Join us

  • SENIOR FULLSTACK DEVELOPER (JAVA + ANGULAR) Poznań (hybrydowo) lub zdalnie UoP 14 900 - 20 590 PLN brutto
    B2B 19 680 - 27 220 PLN netto
  • REGULAR FULLSTACK DEVELOPER (JAVA + ANGULAR) Poznań (hybrydowo) lub zdalnie UoP 11 300 - 15 900 PLN brutto
    B2B 14 950 - 21 000 PLN netto
  • ZOBACZ WSZYSTKIE OGŁOSZENIA

technical

newsletter

Sign up

Podobne wpisy

post-image
kouncil

Reliable event delivery in Apache Kafka based on retry and DLQ

Why is there no DLQ in Kafka? Most popular queueing systems such as RabbitMQ or ActiveMQ have built-in systems responsible for reliable message delivery. So why doesn't Kafka offer one?...

author
Jacek Grobelny 13 Sep 2021
post-image
kouncil

Event Tracking - finding a needle in a haystack

Event tracking allows for tracking and visualising the path of a given event or process through Kafka topics.

author
Marcin Mergo 8 Sep 2021
post-image
kouncil

Kouncil - a modern Kafka frontend

Kouncil is a modern Kafka frontend equipped with features essential for developers.

author
Jacek Grobelny 30 Aug 2021
Join us

  • SENIOR FULLSTACK DEVELOPER (JAVA + ANGULAR) Poznań (hybrydowo) lub zdalnie UoP 14 900 - 20 590 PLN brutto
    B2B 19 680 - 27 220 PLN netto
  • REGULAR FULLSTACK DEVELOPER (JAVA + ANGULAR) Poznań (hybrydowo) lub zdalnie UoP 11 300 - 15 900 PLN brutto
    B2B 14 950 - 21 000 PLN netto
  • ZOBACZ WSZYSTKIE OGŁOSZENIA

Sign up for a

technical

newsletter

consdata.com
  • Contact

    • sales@consdata.com
    • +48 61 41 51 000

  • Office

    • K9Office
      Krysiewicza 9/14
      61-825 Poznań
      Polska

  • Solutions

    • Eximee
    • Kouncil
  • Blog Join us
Copyright © 2024 Consdata. All rights reserved. Privacy Policy & Cookies
Chcemy używać plików cookie oraz skryptów podmiotów trzecich do polepszania funkcjonowania tej strony Zgadzam się