Skip to content

Commit ef846a6

Browse files
author
distrue
committed
redesign library structure
1 parent 0020d6f commit ef846a6

29 files changed

+816
-436
lines changed

example/index.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import {SkillResponse as Resp} from '../lib';
2+
3+
const bare = new Resp();
4+
bare.template.addBareOutput({
5+
type: 'basic',
6+
title: '안녕하세요',
7+
thumbnail: 'http://k.kakaocdn.net/dn/bSxJ8y/btqF02kThBu/4ZjrER4JOjU4okzstNsUY1/img_640x640.jpg',
8+
desc: '반갑습니다'
9+
});
10+
bare.template
11+
.getOutputasBare(0)
12+
.getCardasBasic()
13+
.addBlockBtn({
14+
label: '버튼',
15+
messageText: '메세지',
16+
blockId: "id",
17+
});
18+
console.log(JSON.stringify(bare.json()));
19+
20+
const carousel = new Resp();
21+
carousel.template.addCarouselOutput('basicCard');
22+
const out = carousel.template.getOutputasCarousel(0);
23+
out.addCarouselCell({
24+
title: 'carousel',
25+
desc: 'Heloo',
26+
thumbnail: 'http://k.kakaocdn.net/dn/bSxJ8y/btqF02kThBu/4ZjrER4JOjU4okzstNsUY1/img_640x640.jpg'
27+
});
28+
out.addCarouselCell({
29+
title: 'carousel',
30+
desc: 'Heloo',
31+
thumbnail: 'http://k.kakaocdn.net/dn/bSxJ8y/btqF02kThBu/4ZjrER4JOjU4okzstNsUY1/img_640x640.jpg'
32+
}); // if it is not CarouselCell, error occurs
33+
34+
console.log(JSON.stringify(carousel.json()));

lib/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ export class SkillResponse {
1919
}
2020
}
2121

22-
export {Output, Card, Cmpnts, QuickReply, Template} from './template';
22+
export * from './template';

lib/template/card/basiccard.ts

Lines changed: 0 additions & 70 deletions
This file was deleted.

lib/template/card/index.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

lib/template/card/listcard.ts

Lines changed: 0 additions & 86 deletions
This file was deleted.

lib/template/cmpnts/button.ts

Lines changed: 0 additions & 129 deletions
This file was deleted.

lib/template/cmpnts/index.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)