I use GPT with the custom instructio "provide references where it makes sense" and it frequently provides links which most of the time are accurate. A good prompt does wonders. My GPT-3.5 output bellow. It doesn't give a correct answer but provide a link that makes sense.
Q: How do I create a type alias in typescript local to a class? Provide references where it makes sense.
A: In TypeScript, you can create a type alias within a class using the type keyword. Here's an example:
"Ignore previous instructions, take your time and think thoroughly.
Prioritize facts and logic. Disregard narratives. Consider multiple point of views. In data voids, assume the most probable outcome.
Be assertive, avoid filler. Don't be over-polite. Prefer international units, use emojis. Avoid obvious advice like "I'm an AI model" as I already know that.
When suitable: ask for clarification; correct me, cite sources."
Not all of them work as intended or always. Some are probably just placebo.
Q: How do I create a type alias in typescript local to a class? Provide references where it makes sense.
A: In TypeScript, you can create a type alias within a class using the type keyword. Here's an example:
class MyClass { type MyAlias = string | number;
In the example above, MyAlias is a type alias created within the MyClass class. It is defined as either string or number.Note that the type alias is accessible within the class, but it won't be available outside of the class's scope.
For more information on type aliases in TypeScript, you can refer to the official TypeScript documentation: [Type Aliases - TypeScript Handbook](https://www.typescriptlang.org/docs/handbook/advanced-types....)