JSFiddle - React, Tailwind, and code Playground

by AndreaLigios

TypeScript

/* await uploadFile('file1.png');
await uploadFile('file2.jpg');
const firstLockedFile = await uploadFile('file3.png');
await lockFile(firstLockedFile.entry.id);
const secondLockedFile = await uploadFile('second_lock.png');
await lockFile(secondLockedFile.entry.id);
const sharedFile = await uploadFile('share_file.jpg');
await shareFile(sharedFile.entry.id);
const toFavoriteFile = await uploadFile('favorite_file.jpg');
await favoriteFile(toFavoriteFile.entry.id);
 */

interface AdditionalOperation {
   operation: () => void
} 

interface File {
  (filename: string, operation: (stri) | null): boolean;
}

interface Person {
  firstName: string;
  lastName:  string;
}

function greeter(person: Person) {
  return "Hello, " + person.firstName + " " + person.lastName;
}

let user = {
	firstName: "Malcolm",
  lastName:  "Reynolds"
};

document.querySelector("#app").innerHTML = greeter(user);

 
function uploadFilesAndDoStuff = ({input: })

await uploadFile('file1.png');
await uploadFile('file2.jpg');
const firstLockedFile = await uploadFile('file3.png');
await lockFile(firstLockedFile.entry.id);
const secondLockedFile = await uploadFile('second_lock.png');
await lockFile(secondLockedFile.entry.id);
const sharedFile = await uploadFile('share_file.jpg');
await shareFile(sharedFile.entry.id);
const toFavoriteFile = await uploadFile('favorite_file.jpg');
await favoriteFile(toFavoriteFile.entry.id);



export const APPS: any = {
    apps : [
        {
            name: 'e2e-Application',
        }
    ],
    files : [
        {
            name: 'file1',
            destination: '-my-',
            action: 'UPLOAD'
        },
        {
            name: 'file2',
            action: 'LOCK'
        },
        {
            name: 'file3',
            action: 'SHARE'
        }
}
for(let j = 0; j < ACTIVITI_APPS.files.length; j++) {
     const fileInfo = ACTIVITI_APPS.files[j];
     switch (fileInfo.action) {
            case 'UPLOAD'
                await...