Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

242
Views
What is this format in javascript or typescript?

What is this format in javascript or typescript? I couldn't find any info.

  1. export type XXX<> = | true (= |)

  2. $ReadOnly (meanings)

  3. <{| ... |}>

export type AttributeType<T, V> =
  | true
  | $ReadOnly<{|
      diff?: (arg1: T, arg2: T) => boolean,
      process?: (arg1: V) => T,
    |}>;
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

  1. The code is a typescript.
  2. The $ReadOnly Prefix is used to make a property read-only. Read-only members can be accessed outside the class, but their value cannot be changed. Since read-only members cannot be changed outside the class, they either need to be initialized at the declaration or initialized inside the class constructor.
  3. The | part is making the rest as a union, so it only returns the true or read-only . In the read only return , the diff will be identified as boolean | undefined; and process will be identified as type | undefined; Since all values has a default value of undefined, the compiler won't complain that process or diff is not assigned.
about 4 years ago · Juan Pablo Isaza Report

0

I found it... Facebook use 'flow'. (no typescript) https://flow.org/en/

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!