interface 用于接收服务器的数据。

eg:

interface mmmmm {
x: string,
y: number,
z: number,
select: KnockoutObservable<boolean>
}

$.post(url + '/app.ashx',
ko.utils.stringifyJson( {x: '12', y: 1, z: 10 }),
function (response) {
var result = $.parseJSON(response);

alert('ok');
var mm = <mmmmm>result;
mm.select = ko.observable(false);
alert(mm.select());
});

不会在js中出现。

可扩展的对象,定义为接口。可在ts中使用。不会报错。

interface Element {
scaleX: number;
scaleY: number;
offsetHeight: number;
offsetTop: number;
style: CSSStyleDeclaration,
offsetWidth: number;
}

interface Window {
startY: number;
Transform: (el: Element) => void;
yhaoTouch: (el: any) => void;
isscroll: boolean;
}

最新文章

  1. 【WCF】终结点的监听地址
  2. jQuery中的map()方法
  3. Linq中查询List组合相同值数量大于1
  4. spring简单事务管理器
  5. MongoDB基本命令的使用
  6. 锋利的jQuery第2版学习笔记8~11章
  7. hdu 2256 Problem of Precision 构造整数 + 矩阵快速幂
  8. 教你利用iframe在网页中显示天气
  9. HelloGitHub.com 网站开源了
  10. [CodeForces10D]LCIS(最长公共上升子序列) - DP
  11. mongodb 创建更新语法
  12. Go语言为何说它优雅?-- Golang中的几个常用初始化设计
  13. Activity的Launch mode详解,A B C D的singleTask模式
  14. Python3红楼梦人名出现次数统计分析
  15. Git - 回滚与撤销
  16. js实现响应式瀑布流
  17. TensorFlow数据读取方式:Dataset API
  18. nodejs 监控代码变动实现ftp上传
  19. HDU 1710 Binary Tree Traversals (二叉树遍历)
  20. Python3.5 执行发邮件脚本失败【惑】==&gt;【搞定】

热门文章

  1. tcp状态-TIME_WAIT与CLOSE_WAIT带来的坑
  2. Visual Studio 断点无法命中怎么办?
  3. Linux下交叉编译gdb和gdbserver
  4. 用友u8数据库表结构
  5. 物联仓储系统ZigBee组网原理
  6. CSS3 animation动画
  7. SVG 基础图形
  8. scrapy-splash抓取动态数据例子十五
  9. Swing:LookAndFeel 教程第一篇——手把手教你写出自己的 LookAndFeel
  10. websocket 和 socket.io 之间的区别