Add initial types for samples

This commit is contained in:
Daniel O'Grady
2022-09-15 15:59:27 +02:00
parent a704f12b40
commit f891be5251
82 changed files with 2052 additions and 0 deletions

3
media/@types/_/index.js Normal file
View File

@@ -0,0 +1,3 @@
// This is an automatically generated file. Please do not change its contents manually!
const cds = require('@sap/cds')
const cson = cds.entities('_')

35
media/@types/_/index.ts Normal file
View File

@@ -0,0 +1,35 @@
// This is an automatically generated file. Please do not change its contents manually!
export namespace Association {
export type to <T> = T & ((fn:(a:T)=>any) => T)
export namespace to {
// type many <T> = T[] & (T extends (infer R)[] ? R[] & ((fn:(a:R)=>any) => R[]) : T[]);
export type many <T extends readonly unknown[]> = T & ((fn:(a:T[number])=>any) => T[number]);
}
}
export namespace Composition {
export type of <T> = T & ((fn:(a:T)=>any) => T)
export namespace of {
//type many <T> = T[] & (T extends (infer R)[] ? R[] & ((fn:(a:R)=>any) => R[]) : T[]);
export type many <T extends readonly unknown[]> = T & ((fn:(a:T[number])=>any) => T[number]);
}
}
export class Entity {
static data<T extends Entity> (this:T, input:Object) : T {
return {} as T // mock
}
}
export type EntitySet<T> = T[] & {
data (input:object[]) : T[]
data (input:object) : T
}

View File

@@ -0,0 +1,5 @@
// This is an automatically generated file. Please do not change its contents manually!
const cds = require('@sap/cds')
const cson = cds.entities('sap.capire.media.MediaServer')
module.exports.Media = cson.Media
module.exports.Media_ = cson.Media

View File

@@ -0,0 +1,22 @@
// This is an automatically generated file. Please do not change its contents manually!
import * as __ from './../../../../_';
export function Media<TBase extends new (...args: any[]) => {}>(Base: TBase) {
return class MediaAspect extends Base {
id: number;
content: string;
mediaType: string;
fileName: string;
applicationName: string;
};
}
const MediaXtended = Media(__.Entity)
export type Media = InstanceType<typeof MediaXtended>
export class Media_ extends Array<Media> {
}

View File

@@ -0,0 +1,5 @@
// This is an automatically generated file. Please do not change its contents manually!
const cds = require('@sap/cds')
const cson = cds.entities('sap.capire.media')
module.exports.Media = cson.Media
module.exports.Media_ = cson.Media

View File

@@ -0,0 +1,22 @@
// This is an automatically generated file. Please do not change its contents manually!
import * as __ from './../../../_';
export function Media<TBase extends new (...args: any[]) => {}>(Base: TBase) {
return class MediaAspect extends Base {
id: number;
content: string;
mediaType: string;
fileName: string;
applicationName: string;
};
}
const MediaXtended = Media(__.Entity)
export type Media = InstanceType<typeof MediaXtended>
export class Media_ extends Array<Media> {
}

5
media/jsconfig.json Normal file
View File

@@ -0,0 +1,5 @@
{
"compilerOptions": {
"checkJs": true
}
}