te.rewrite-javascript.0.13.0.source-code.TypeScriptTypeGoat.ts Maven / Gradle / Ivy
/*
* Copyright 2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
abstract class TypeScriptTypeGoat & A> {
protected constructor() {
}
public static parameterizedField: PT;
public static unionField: typeof TypeScriptTypeGoat.TypeA | typeof TypeScriptTypeGoat.TypeB
public static TypeA = class {
}
public static TypeB = class {
}
ExtendsTypeScriptTypeGoat = class extends TypeScriptTypeGoat {
enumTypeA(n: EnumTypeA): void {
}
genericIntersection(n: U): U {
return undefined;
}
genericRecursive(n: TypeScriptTypeGoat): TypeScriptTypeGoat {
return undefined;
}
inheritedTypeScriptTypeGoat(n: InheritedTypeScriptTypeGoat): InheritedTypeScriptTypeGoat {
return undefined;
}
}
clazz(n: A): void {
}
primitive(n: number): void {
}
array(n: A[]): void {
}
multidimensionalArray(n: A[][]): void {
}
parameterized(n: PT): PT {
return n
}
parameterizedRecursive(n: PT>): PT> {
return n
}
generic(n: PT): PT {
return n
}
public abstract genericRecursive>(n: TypeScriptTypeGoat): TypeScriptTypeGoat;
genericUnbounded(n: PT): PT {
return n
}
public abstract enumTypeA(n: EnumTypeA): void;
public abstract inheritedTypeScriptTypeGoat & C>(n: InheritedTypeScriptTypeGoat): InheritedTypeScriptTypeGoat;
public abstract genericIntersection & C>(n: U): U;
genericT(n: T): T {
return n
}
recursiveIntersection & Intersection>(n: U): void {
}
merged(n: B) {
n.foo()
n.bar()
n.buz()
}
mergedGeneric(n: PT): PT {
return n
}
}
interface A {
}
interface B {
foo(): void
}
interface B {
bar(): void
}
class B {
buz(): void {
}
}
interface C {
}
interface PT {
}
interface Intersection & Intersection> {
getIntersectionType(): T
}
abstract class Extension> {
}
function decorator(value: boolean) {
return function (target: any,
propertyKey: string,
descriptor: PropertyDescriptor) {
descriptor.enumerable = value;
};
}
enum EnumTypeA {
FOO, BAR
}
abstract class InheritedTypeScriptTypeGoat & C> extends TypeScriptTypeGoat {
protected constructor() {
super();
}
}