Skip to content

Commit

Permalink
Merge pull request #203 from robbert-vdh/feature/indirect-buffer-support
Browse files Browse the repository at this point in the history
Add support for indirect buffers
  • Loading branch information
josteink authored Dec 11, 2017
2 parents c5d8330 + 181184a commit 5fb082c
Show file tree
Hide file tree
Showing 6 changed files with 204 additions and 60 deletions.
5 changes: 5 additions & 0 deletions example/all.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
/// <reference path='./typings/react/react.d.ts' />

declare module "*.vue" {
// This should normally reexport the entire 'vue' module
export default {};
}
50 changes: 50 additions & 0 deletions example/literate.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Nullam eu ante vel est convallis dignissim. Fusce suscipit, wisi nec facilisis
facilisis, est dui fermentum leo, quis tempor ligula erat quis odio. Nunc porta
vulputate tellus. Nunc rutrum turpis sed pede. Sed bibendum. Aliquam posuere.
Nunc aliquet, augue nec adipiscing interdum, lacus tellus malesuada massa, quis
varius mi purus non odio. Pellentesque condimentum, magna ut suscipit hendrerit,
ipsum augue ornare nulla, non luctus diam neque sit amet urna. Curabitur
vulputate vestibulum lorem. Fusce sagittis, libero non molestie mollis, magna
orci ultrices dolor, at vulputate neque nulla lacinia eros. Sed id ligula quis
est convallis tempor. Curabitur lacinia pulvinar nibh. Nam a sapien.

#+BEGIN_SRC typescript
class Animal {
constructor(public name) { }
move(meters) {
console.log(this.name + " moved " + meters + "m.");
}
}

class Snake extends Animal {
move() {
console.log("Slithering...");
super.move(5);
}
}

class Horse extends Animal {
move() {
console.log("Galloping...");
super.move(45);
}
}

var sam = new Snake("Sammy the Python");
var tom: Animal = new Horse("Tommy the Palomino");

sam.move();
tom.move(34);
#+END_SRC

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit tempor
tellus. Donec pretium posuere tellus. Proin quam nisl, tincidunt et, mattis
eget, convallis nec, purus. Cum sociis natoque penatibus et magnis dis
parturient montes, nascetur ridiculus mus. Nulla posuere. Donec vitae dolor.
Nullam tristique diam non turpis. Cras placerat accumsan nulla. Nullam rutrum.
Nam vestibulum accumsan nisl.

#+BEGIN_SRC typescript
// This should show an error as the two snippets are evaluated seperately
var tom: Animal = new Horse("Tommy the Palomino");
#+END_SRC
2 changes: 1 addition & 1 deletion example/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var y = Game;
var obj: Object;

@readonly
class Person {
export class Person {
name: string;
isAdmin: boolean;

Expand Down
4 changes: 3 additions & 1 deletion example/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
"all.d.ts",
"reactComponent.tsx",
"test.ts",
"another.js"
"another.js",
"vueComponent.vue",
"literate.org"
]
}
31 changes: 31 additions & 0 deletions example/vueComponent.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<template>
<p>{{ greeting }} World, visitor {{ visitorId }}!</p>
</template>

<script lang="ts">
import {Person} from './test';
const randomNumber: number = Math.random();
const notANumber: number = 'this should show an error';
const person = new Person('name', 'should have been a boolean');
export default {
data: {
visitorId: randomNumber
},
props: {
todo: {
type: Object,
required: true
}
}
}
</script>

<style scoped>
p {
font-size: 2em;
text-align: center;
}
</style>
Loading

0 comments on commit 5fb082c

Please sign in to comment.