Add initial types for samples
This commit is contained in:
3
media/@types/_/index.js
Normal file
3
media/@types/_/index.js
Normal 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
35
media/@types/_/index.ts
Normal 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
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
5
media/@types/sap/capire/media/MediaServer/index.js
Normal file
5
media/@types/sap/capire/media/MediaServer/index.js
Normal 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
|
||||
22
media/@types/sap/capire/media/MediaServer/index.ts
Normal file
22
media/@types/sap/capire/media/MediaServer/index.ts
Normal 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/@types/sap/capire/media/index.js
Normal file
5
media/@types/sap/capire/media/index.js
Normal 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
|
||||
22
media/@types/sap/capire/media/index.ts
Normal file
22
media/@types/sap/capire/media/index.ts
Normal 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
5
media/jsconfig.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"checkJs": true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user