Building upon the insights shared by Mark:
Indeed, it is possible to directly include these scripts in the head section of your HTML file before loading your bundle or Angular 2 project.
To utilize the code within a component, you can simply declare the 'goog' variable above the 'Component' class like so:
declare var goog: any;
Now, you can freely employ any methods you require within your component, albeit without auto-completion support.
If you desire auto-completion functionality, consider installing the TypeScript definition files via npm: https://www.npmjs.com/package/@types/gae.channel.api
Alternatively, for immediate access, place the definitions in your 'typings' folder and reference them at the beginning of your component file using:
/// <reference path="../typings/gae.channel.api.d.ts" />
gae.channel.api.d.ts:
// Type definitions for GoogleAppEngine's Channel API
// Project: https://developers.google.com/appengine/docs/java/channel/javascript
// Definitions by: vvakame <https://github.com/vvakame>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace goog.appengine {
export class Channel {
constructor(token: string);
open(handler?: Function): Socket;
}
export class Socket {
close(): void;
onopen: () => void;
onmessage: (message: any) => void;
onerror: Function;
onclose: () => void;
}
}