repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
rbernalber/archimedes-js | examples/example-angular/src/app/qux-cmd.ts | <reponame>rbernalber/archimedes-js<filename>examples/example-angular/src/app/qux-cmd.ts<gh_stars>10-100
import { Injectable } from '@angular/core'
import { Command, EvictCache } from '@archimedes/arch'
@EvictCache
@Injectable({
providedIn: 'root'
})
export class QuxCmd extends Command<number> {
async internalExecu... |
rbernalber/archimedes-js | examples/example-react/src/baz-qry.ts | import { injectable } from 'tsyringe'
import { EvictCache, Query } from '@archimedes/arch'
@EvictCache
@injectable()
export class BazQry extends Query<number> {
async internalExecute(): Promise<number> {
return 42
}
}
|
rbernalber/archimedes-js | packages/components/src/components/behavioural-components/keyboard-navigable/keyboard-navigation-handler.ts | <gh_stars>10-100
import { KeyboardNavigationAction } from './keyboard-navigable'
export interface KeyboardNavigationHandler {
getLeftItem(action: KeyboardNavigationAction): HTMLElement | undefined
getRightItem(action: KeyboardNavigationAction): HTMLElement | undefined
getUpItem(action: KeyboardNavigationAction):... |
rbernalber/archimedes-js | examples/example-react/src/use-di.ts | <gh_stars>10-100
import { container } from './container'
import { constructor } from 'tsyringe/dist/typings/types'
export function useDi<T>(token: constructor<T> | string) {
return container.resolve(token)
}
|
rbernalber/archimedes-js | packages/arch/src/notifications/notification-center.ts | <reponame>rbernalber/archimedes-js
import { Subject, Observer } from '@archimedes/utils'
import { Notification } from './notification'
import { NotificationCenterOptions } from './notification-center-options'
export class NotificationCenter implements Subject {
observers: Observer[] = []
notifications: Notificatio... |
rbernalber/archimedes-js | examples/example-angular/src/core/modules/archimedes/archimedes.module.ts | <filename>examples/example-angular/src/core/modules/archimedes/archimedes.module.ts
import { CacheLink, CacheManager, ExecutorLink, LoggerLink, Runner } from '@archimedes/arch'
import { CommonModule } from '@angular/common'
import { APP_INITIALIZER, NgModule } from '@angular/core'
const ARCHIMEDES_PROVIDERS = [
{ pr... |
rbernalber/archimedes-js | packages/utils/src/datetime/duration.spec.ts | <reponame>rbernalber/archimedes-js
import { Duration } from './duration'
describe('Duration', () => {
it('should create a duration from a timestamp', () => {
const duration = Duration.fromTimeStamp('02:30')
const actual = duration.toIso()
expect(actual).toBe('PT2H30M')
})
it('should check it it a ... |
rbernalber/archimedes-js | packages/arch/src/use-case/use-case.spec.ts | <gh_stars>10-100
import { UseCase } from './use-case'
import { Runner } from '../runner/runner'
jest.mock('../runner/runner')
describe('UseCase', () => {
it('should execute use case using runner', () => {
class MockUseCase extends UseCase<number, number> {
readonly = false
async internalExecute(valu... |
rbernalber/archimedes-js | packages/arch/src/runner/context.ts | import { UseCase } from '../use-case/use-case'
import { ExecutionOptions } from '../use-case/execution-options'
export class Context {
result?: Promise<unknown>
private constructor(
public useCase: UseCase<unknown, unknown>,
readonly executionOptions: Partial<ExecutionOptions>,
readonly param?: unknow... |
rbernalber/archimedes-js | examples/example-react/src/App.tsx | <reponame>rbernalber/archimedes-js
import React, { useEffect, useState } from 'react'
import './App.css'
import { useDi } from './use-di'
import { FooCmd } from './foo-cmd'
import { BarQry } from './bar-qry'
import { QuxCmd } from './qux-cmd'
import { BazQry } from './baz-qry'
function App() {
const [result, setResu... |
rbernalber/archimedes-js | packages/arch/src/index.ts | <filename>packages/arch/src/index.ts
export type { Cache, CacheResult } from './cache/cache'
export { InvalidationPolicy } from './cache/invalidation-policy'
export { LruCache } from './cache/lru-cache'
export { CacheManager } from './cache/cache-manager'
export { InvalidateCache } from './cache/invalidate-cache'
expor... |
rbernalber/archimedes-js | packages/arch/src/cache/cache-key.ts | <gh_stars>10-100
export type CacheKey = string
|
rbernalber/archimedes-js | packages/utils/src/observer/observer.ts | <gh_stars>10-100
import { Subject } from './subject'
export interface Observer {
update(subject: Subject): void
}
|
rbernalber/archimedes-js | packages/arch/src/use-case/command.spec.ts | <reponame>rbernalber/archimedes-js
import { Command } from './command'
describe('Command', () => {
it('should be an use case which is not readonly', () => {
class MockCommand extends Command {
async internalExecute(): Promise<void> {}
}
const mockQry = new MockCommand()
expect(mockQry.readonly... |
rbernalber/archimedes-js | examples/example-react/src/bar-qry.ts | import { BazQry } from './baz-qry'
import { injectable } from 'tsyringe'
import { EvictCache, Query } from '@archimedes/arch'
@EvictCache
@injectable()
export class BarQry extends Query<number> {
constructor(private readonly bazQry: BazQry) {
super()
}
async internalExecute(param: void): Promise<number> {
... |
rbernalber/archimedes-js | packages/components/src/components/behavioural-components/keyboard-navigable/keyboard-navigation-listener.tsx | <filename>packages/components/src/components/behavioural-components/keyboard-navigable/keyboard-navigation-listener.tsx
import { Component, h, Prop, Host, Listen } from '@stencil/core'
import { KeyboardNavigationHandler } from './keyboard-navigation-handler'
import { KeyboardNavigationAction } from './keyboard-navigabl... |
rbernalber/archimedes-js | packages/arch/src/use-case/query.spec.ts | import { Query } from './query'
describe('Query', () => {
it('should be an use case which is readonly', () => {
class MockQry extends Query {
async internalExecute(): Promise<void> {}
}
const mockQry = new MockQry()
expect(mockQry.readonly).toBe(true)
})
})
|
rbernalber/archimedes-js | packages/utils/src/http-client/http-client.ts | import { HttpError } from './http-error'
import { HttpParams } from './http-params'
import { HttpStatusCode } from './http-status-code'
type Url = string
export interface HttpClientResponse<Result> {
result: Result
status: HttpStatusCode
headers: HttpClientHeaders
options: RequestInit
}
export type HttpClien... |
rbernalber/archimedes-js | packages/utils/src/range/range.ts | export function range(start: number, end?: number) {
let length: number
let offset: number
let shouldReverse = false
if (end === undefined) {
length = start
offset = 0
} else if (start > end) {
length = start - end
if (end === 0) {
offset = 1
} else {
offset = start - end
... |
rbernalber/archimedes-js | packages/components/src/components/behavioural-components/activable-item/activated-item-listener.tsx | import { Component, h, Prop, Host, Listen } from '@stencil/core'
import { ItemPosition } from '../../../utils/position'
import { ActivatedItemHandler } from './activated-item-handler'
@Component({
tag: 'activated-item-listener',
shadow: true
})
export class ActivatedItemListener {
@Prop()
handler!: ActivatedIt... |
rbernalber/archimedes-js | packages/utils/src/datetime/duration.ts | import { Duration as LuxonDuration } from 'luxon'
import { Timestamp } from './timestamp'
import { TimeUnits } from './time-units'
export class Duration {
private constructor(public readonly value: LuxonDuration) {}
static fromTimeStamp(timestamp: Timestamp) {
const [hours, minutes, seconds, milliseconds] = t... |
rbernalber/archimedes-js | packages/arch/src/runner/cache-invalidations.ts | <reponame>rbernalber/archimedes-js
import { InvalidationPolicy } from '../cache/invalidation-policy'
import { CacheKey } from '../cache/cache-key'
type Invalidation = InvalidationPolicy | CacheKey
export class CacheInvalidations {
private static readonly cacheInvalidations: Map<CacheKey, Invalidation[]> = new Map()... |
rbernalber/archimedes-js | packages/components/src/components/behavioural-components/activable-item/activated-item-handler.ts | import { ItemPosition } from '../../../utils/position'
export interface ActivatedItemHandler {
notifyActivation(position: ItemPosition): void
}
|
rbernalber/archimedes-js | packages/components/src/utils/position.ts | <filename>packages/components/src/utils/position.ts
export type ItemPosition = ItemPosition1D | ItemPosition2D | ItemPosition3D
export interface ItemPosition1D {
x: number
}
export interface ItemPosition2D {
x: number
y: number
}
export interface ItemPosition3D {
x: number
y: number
z: number
}
export f... |
rbernalber/archimedes-js | packages/utils/src/maybe/maybe.spec.ts | import { Maybe } from './maybe'
import { MaybeEmptyError } from './maybe-empty-error'
describe('Maybe', () => {
it('should handle an undefined value', () => {
const maybe = Maybe.from<string>(undefined)
expect(maybe.getOrElse('test')).toBe('test')
})
it('should a false value', () => {
const maybe = ... |
rbernalber/archimedes-js | packages/components/src/components/behavioural-components/focusable-item/focused-item-listener.e2e.ts | <reponame>rbernalber/archimedes-js
import { newE2EPage } from '@stencil/core/testing'
import { ItemPosition } from '../../../utils/position'
describe('focused-item-listener', () => {
it('renders', async () => {
const page = await newE2EPage()
await page.setContent('<focused-item-listener></focused-item-liste... |
rbernalber/archimedes-js | packages/components/src/components/behavioural-components/focusable-item/focused-item-listener.tsx | <filename>packages/components/src/components/behavioural-components/focusable-item/focused-item-listener.tsx<gh_stars>10-100
import { Component, h, Host, Prop, Listen } from '@stencil/core'
import { ItemPosition } from '../../../utils/position'
import { FocusedItemHandler } from './focused-item-handler'
@Component({
... |
rbernalber/archimedes-js | packages/components/src/components/behavioural-components/activable-item/activable-item.tsx | <filename>packages/components/src/components/behavioural-components/activable-item/activable-item.tsx
import { Component, h, Host, Prop, Event, EventEmitter, Listen } from '@stencil/core'
import { KeyCodes } from '../../../utils/keycodes'
import { ItemPosition } from '../../../utils/position'
@Component({
tag: 'acti... |
rbernalber/archimedes-js | packages/arch/src/notifications/notification.ts | export interface Notification {
message: string
}
|
rbernalber/archimedes-js | packages/components/src/components/behavioural-components/activable-item/activable-item.e2e.ts | <filename>packages/components/src/components/behavioural-components/activable-item/activable-item.e2e.ts
import { newE2EPage } from '@stencil/core/testing'
import { KeyCodes } from '../../../utils/keycodes'
describe('activable-item', () => {
it('renders', async () => {
const page = await newE2EPage()
await p... |
rbernalber/archimedes-js | packages/arch/src/notifications/notification-center-options.ts | export interface NotificationCenterOptions {
notificationTimeout: number
}
|
rbernalber/archimedes-js | packages/utils/src/datetime/mock-datetime.ts | import { Settings } from 'luxon'
import { Datetime } from './datetime'
export class MockDatetime {
private static ORIGINAL_NOW = Settings.now
static mock(date: Datetime) {
Settings.now = () => date.jsDate.valueOf()
}
static reset() {
Settings.now = MockDatetime.ORIGINAL_NOW
}
static mockTimezone... |
gregoranders/ts-jhu-covid19 | src/index.ts | <gh_stars>0
/**
* Provides access to the data published at the COVID-19 Data Repository by the Center for Systems Science and Engineering (CSSE) at Johns Hopkins University.
*
* https://github.com/CSSEGISandData/COVID-19
*
* @packageDocumentation
*/
import { default as Provider } from './provider';
/**
* librar... |
gregoranders/ts-jhu-covid19 | src/index.spec.ts | import * as TestSubject from '.';
describe(`${TestSubject.libname} ${TestSubject.libversion}`, () => {
describe('exports', () => {
it('libname', () => {
expect(TestSubject.libname).toBe('@gregoranders/jhu-covid19');
});
it('libversion', () => {
expect(TestSubject.libversion).toBe('0.0.8');
... |
gregoranders/ts-jhu-covid19 | src/provider.ts | import {
FetchLike,
FetchLikeOptions,
FetchLikeResult,
ModelCollector,
RowModel,
RowModelValue,
} from './collector';
export { FetchLike, FetchLikeOptions, FetchLikeResult };
/**
* metric value type
*
* @example
* ```ts
* {
* confirmed: 1,
* dead: 1,
* recovered: 1,
* active: 1,
* }
* `... |
gregoranders/ts-jhu-covid19 | src/provider.spec.ts | import { libname, libversion } from '.';
import * as TestSubject from './provider';
const resolved = (text: string) =>
Promise.resolve({
text: () => Promise.resolve(text),
});
const mockFetch = (
lookup: string,
confirmed: string,
deaths: string,
recovered: string,
) =>
jest.fn().mockImplementation(... |
gregoranders/ts-jhu-covid19 | src/collector.ts | import Parser from '@gregoranders/csv';
type TempModelValue = {
value: number;
timestamp: number;
};
type CountryState = { country: string; state: string };
type TempModel = CountryState & {
lat: number;
lon: number;
values: TempModelValue[];
};
const sortByCountryAndState = (a: CountryState, b: CountrySt... |
jin-wk/nest-basic | src/users/users.controller.ts | <reponame>jin-wk/nest-basic
import { Body, Controller, Delete, Get, Param, Post } from '@nestjs/common';
import { ApiBody, ApiTags, ApiOperation } from '@nestjs/swagger';
import { User } from './users.entity';
import { UsersService } from './users.service';
@ApiTags('User')
@Controller('users')
export class UsersContr... |
jin-wk/nest-basic | src/users/users.entity.ts | <filename>src/users/users.entity.ts
import { ApiProperty } from '@nestjs/swagger';
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
@Entity()
export class User {
@PrimaryGeneratedColumn()
id: number;
@Column({
type: 'timestamp',
default: () => 'CURRENT_TIMESTAMP',
})
created_at: Dat... |
jin-wk/nest-basic | src/auth/auth.endtity.ts | <reponame>jin-wk/nest-basic
import { ApiProperty } from '@nestjs/swagger';
export class Auth {
@ApiProperty({ type: String, description: 'User Email' })
readonly email: string;
@ApiProperty({ type: String, description: 'User Password' })
readonly password: string;
}
|
jin-wk/nest-basic | src/app.controller.ts | <filename>src/app.controller.ts
import { Controller, Get } from '@nestjs/common';
import { ApiOperation, ApiTags } from '@nestjs/swagger';
import { AppService } from './app.service';
@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}
@ApiTags('Health')
@ApiOperati... |
jin-wk/nest-basic | src/logger/logger.service.ts | import { format, transports } from 'winston';
import { WinstonModule } from 'nest-winston';
import 'winston-daily-rotate-file';
const logDir = 'logs';
const logFormat = format.printf((log) => {
return `[${log.timestamp}] [${log.level.toUpperCase()}]: ${log.message}`;
});
const Logger = WinstonModule.createLogger({
... |
jin-wk/nest-basic | src/main.ts | <reponame>jin-wk/nest-basic<filename>src/main.ts
import { NestFactory } from '@nestjs/core';
import { SwaggerModule } from '@nestjs/swagger';
import { BaseAPIDocumentation } from './api/base.document';
import { AppModule } from './app.module';
import Logger from './logger/logger.service';
async function bootstrap() {
... |
jin-wk/nest-basic | src/api/base.document.ts | <reponame>jin-wk/nest-basic
import { DocumentBuilder } from '@nestjs/swagger';
export class BaseAPIDocumentation {
public builder = new DocumentBuilder();
public initializeOptions() {
return this.builder
.setTitle('Nest-Basic API')
.setDescription('Basic Application with NestJS')
.setVersion... |
azu/dynamic-import-assets | src/index.ts | const loadJs = (url: string): Promise<HTMLScriptElement> => {
const script = document.createElement("script");
script.src = url;
document.querySelector("head")!.appendChild(script);
return new Promise((resolve, reject): void => {
script.addEventListener("load", () => {
resolve(script... |
AndresCL/metabolicpathways | src/app/color-scheme/colorscheme.component.ts | import { Component } from '@angular/core';
declare var jQuery:any;
@Component({
selector: 'color-scheme',
templateUrl: 'app/color-scheme/colorscheme.component.html'
})
export class ColorschemeComponent {
// On change event handler
switchcolor(checked: boolean){
if(checked){
... |
AndresCL/metabolicpathways | src/app/load-pathway/loadpathway.component.ts | import { Component, Output, EventEmitter } from '@angular/core';
// Declaring vars for libraries
declare var escher: any;
declare var d3: any;
declare var Materialize: any;
@Component({
selector: 'load-pathway',
templateUrl: 'app/load-pathway/loadpathway.component.html'
})
export class LoadpathwayComponent { ... |
AndresCL/metabolicpathways | src/app/app.routes.ts | import { Routes, RouterModule } from '@angular/router';
const ROUTES: Routes = [
];
export const ROUTING = RouterModule.forRoot(ROUTES);
|
AndresCL/metabolicpathways | src/app/app.component.ts | import { Component, OnInit } from '@angular/core';
// Declaring vars for libraries
declare var escher: any;
declare var d3: any;
declare var Materialize: any;
@Component({
selector: 'app-component',
template: `
<nav>
<div class="nav-wrapper layout-margin">
<a href="#" class="br... |
AndresCL/metabolicpathways | src/app/app.module.ts | <filename>src/app/app.module.ts
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { ROUTING } from './app.routes';
import { AppComponent } from './app.component';
import { LoadpathwayComponent } from './load-pathway/loadpathway.component';
import { ColorschemeC... |
zhuozhanyou/vben-Admin-vue3-vant-thinkphp6- | front/src/views/stock/location/schema.data.ts | import { StockList } from '/@/api/stock/stock';
import { DicItem } from '/@/api/system/system';
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { h } from 'vue';
export const columns: BasicColumn[] = [
{
title: '仓库',
dataIndex: 'stock.fname',
wi... |
zhuozhanyou/vben-Admin-vue3-vant-thinkphp6- | front/src/views/system/menu/menu.data.ts | import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { h } from 'vue';
import { Tag } from 'ant-design-vue';
import { Icon } from '/@/components/Icon';
export const columns: BasicColumn[] = [
{
title: '菜单名称',
dataIndex: 'title',
width: 200,
align... |
zhuozhanyou/vben-Admin-vue3-vant-thinkphp6- | front/src/locales/lang/zh-CN/layout.ts | <filename>front/src/locales/lang/zh-CN/layout.ts
export default {
footer: { onlinePreview: '在线预览', onlineDocument: '在线文档' },
header: {
// user dropdown
dropdownItemDoc: '帮助文档',
dropdownItemLoginOut: '退出系统',
// tooltip
tooltipErrorLog: '错误日志',
tooltipLock: '锁定屏幕',
tooltipNotify: '消息通知',
... |
zhuozhanyou/vben-Admin-vue3-vant-thinkphp6- | front/src/api/stock/stock.ts | <reponame>zhuozhanyou/vben-Admin-vue3-vant-thinkphp6-
import { defHttp } from '/@/utils/http/axios';
enum Api {
StockList = '/stock.stock/getList',
StockAdd = '/stock.stock/add',
StockDel = '/stock.stock/del',
LocationList = '/stock.location/getList',
LocationAdd = '/stock.location/add',
LocationDel = '/s... |
zhuozhanyou/vben-Admin-vue3-vant-thinkphp6- | front/src/views/system/dictionaries/schemas.data.ts | import { BasicColumn, FormSchema } from '/@/components/Table';
export const columns: BasicColumn[] = [
{
title: '项目名称',
dataIndex: 'name',
width: 120,
align: 'left',
},
{
title: '项目编码',
dataIndex: 'code',
width: 120,
align: 'left',
},
{
title: '简拼',
dataIndex: 'spell',... |
zhuozhanyou/vben-Admin-vue3-vant-thinkphp6- | front/src/views/system/notice/data.ts | import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { h } from 'vue';
import { Tinymce } from '/@/components/Tinymce/index';
import { Tag } from 'ant-design-vue';
export const columns: BasicColumn[] = [
{
title: '标题',
dataIndex: 'title',
width: 160,
... |
zhuozhanyou/vben-Admin-vue3-vant-thinkphp6- | front/src/views/stock/stock/schema.data.ts | import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { h } from 'vue';
import { Tag } from 'ant-design-vue';
export const columns: BasicColumn[] = [
{
title: '编码',
dataIndex: 'fnumber',
width: 160,
align: 'left',
},
{
title: '名称',
dat... |
zhuozhanyou/vben-Admin-vue3-vant-thinkphp6- | front/src/views/system/log/schema.data.ts | import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
export const columns: BasicColumn[] = [
{
title: '操作用户',
dataIndex: 'user_name',
width: 100,
},
{
title: '操作功能',
dataIndex: 'api.name',
width: 200,
align: 'left',
},
{
title: '... |
zhuozhanyou/vben-Admin-vue3-vant-thinkphp6- | front/src/api/system/system.ts | <reponame>zhuozhanyou/vben-Admin-vue3-vant-thinkphp6-
import { defHttp } from '/@/utils/http/axios';
enum Api {
MenuList = '/system.menu/getList',
MenuAdd = '/system.menu/add',
MenuDel = '/system.menu/del',
DeptList = '/system.dept/getList',
DeptAdd = '/system.dept/add',
DeptDel = '/system.dept/del',
Ac... |
zhuozhanyou/vben-Admin-vue3-vant-thinkphp6- | front/src/views/system/account/account.data.ts | <reponame>zhuozhanyou/vben-Admin-vue3-vant-thinkphp6-<filename>front/src/views/system/account/account.data.ts<gh_stars>1-10
import { getAllRoleList } from '/@/api/system/system';
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
export const columns: BasicColumn[] = [... |
tanhuidong/my-blog-front | src/main.ts | import { createApp } from 'vue'
import App from './App.vue'
import router from "./router";
import ElementPlus from "element-plus"
import locale from "element-plus/lib/locale/lang/zh-cn"
import 'element-plus/theme-chalk/index.css'
import '@/styles/reset.scss'
const app = createApp(App)
app.use(ElementPlus, { locale, si... |
ludohenin/ng2-wp-blog | src/blog/pagination/pagination.component.ts | <reponame>ludohenin/ng2-wp-blog
import {Component, EventEmitter, Input, Output, ViewEncapsulation} from 'angular2/core';
import {RouterLink} from 'angular2/router';
@Component({
selector: 'pagination',
moduleId: module.id,
templateUrl: './pagination.component.html',
styleUrls: ['./pagination.component.css'],
... |
ludohenin/ng2-wp-blog | src/main.ts | import {bootstrap} from 'angular2/platform/browser';
import {provide, enableProdMode, PLATFORM_PIPES} from 'angular2/core';
import {HTTP_PROVIDERS} from 'angular2/http';
import {ROUTER_PROVIDERS, APP_BASE_HREF} from 'angular2/router';
import {AppComponent} from './app/app';
import {SHARED_PIPES_PROVIDERS} from './share... |
ludohenin/ng2-wp-blog | src/blog/services/wp/wp_resource.ts | import {EventEmitter, Injectable} from 'angular2/core';
import {RequestOptionsArgs, Response, URLSearchParams} from 'angular2/http';
import {find, merge} from 'lodash';
import {ApiService} from './xhr';
function mapFromConfig(ctx, conf) {
ctx['url'] = conf.url;
ctx['urlRoot'] = conf.urlRoot;
ctx['namespace'] = c... |
ludohenin/ng2-wp-blog | src/blog/services/wp/users.ts | import {Injectable} from 'angular2/core';
import {ApiService} from './xhr';
import {WpCollection, WpModel, WpResourceConfig, WpModelFactory} from './wp_resource';
@Injectable()
export class UserModel extends WpModel {
_links: any;
avatar_urls: any;
description: string;
id: number;
link: string;
name: strin... |
ludohenin/ng2-wp-blog | src/shared/pipes/moment.pipe.ts | <filename>src/shared/pipes/moment.pipe.ts
import {Pipe, PipeTransform} from 'angular2/core';
import * as moment from 'moment';
@Pipe({name: 'moment'})
export class MomentPipe implements PipeTransform {
transform(value:number, args:string[]) : any {
let date = moment(value);
if (date.isValid()) {
retur... |
ludohenin/ng2-wp-blog | tools/utils/seed/tsproject.ts | <reponame>ludohenin/ng2-wp-blog
import * as gulpLoadPlugins from 'gulp-load-plugins';
const plugins = <any>gulpLoadPlugins();
export function makeTsProject() {
return plugins.typescript.createProject('tsconfig.json', {
typescript: require('typescript')
});
}
|
ludohenin/ng2-wp-blog | src/blog/preloader/preloader.component.ts | import {Component} from 'angular2/core';
@Component({
selector: 'preloader',
moduleId: module.id,
templateUrl: './preloader.component.html',
styleUrls: ['./preloader.component.css']
})
export class PreloaderComponent {
}
|
ludohenin/ng2-wp-blog | src/blog/services/wp/terms.ts | <filename>src/blog/services/wp/terms.ts
import {Injectable} from 'angular2/core';
import {ApiService} from './xhr';
import {WpCollection, WpModel, WpResourceConfig, WpModelFactory} from './wp_resource';
@Injectable()
export class TagModel extends WpModel {
_links: any;
count: number;
description: string;
id: n... |
ludohenin/ng2-wp-blog | src/blog/services/wp/posts.ts | import {Injectable} from 'angular2/core';
// import {isArray} from 'lodash';
import {ApiService} from './xhr';
import {WpCollection, WpModel, WpResourceConfig, WpModelFactory} from './wp_resource';
@Injectable()
export class PostModel extends WpModel {
url: string = '/posts';
_tags: any[];
id: number;
date: ... |
ludohenin/ng2-wp-blog | tools/utils/project/normalize_dependencies.ts | <filename>tools/utils/project/normalize_dependencies.ts
import {InjectableDependency} from '../../config/seed.config.interface';
export function normalizeDependencies(deps: InjectableDependency[]) {
deps
.filter((d:InjectableDependency) => !/\*/.test(d.src)) // Skip globs
.forEach((d:InjectableDependency) =>... |
ludohenin/ng2-wp-blog | src/blog/services/wp/wp.ts | <filename>src/blog/services/wp/wp.ts
import {Injectable} from 'angular2/core';
import {RootModel} from './root';
import {PostsCollection} from './posts';
import {UsersCollection} from './users';
import {TermsCollection} from './terms';
@Injectable()
export class WpService {
namespace: string;
constructor(public ... |
ludohenin/ng2-wp-blog | tools/config/app.config.ts | import {ENV} from '../config';
const APP_CONFIG_DEV = {
WP_API_ROOT: 'https://3dots.io/wp-blog-test/wp-json',
WP_API_NAMESPACE: '/wp/v2',
DISQUS_SRC: 'https://3dotsblogtest.disqus.com/embed.js',
GA_ID: 'UA-71460906-1'
};
const APP_CONFIG_PROD = {
WP_API_ROOT: 'https://3dots.io/blog/wp-json',
WP_API_NAMESP... |
ludohenin/ng2-wp-blog | src/blog/excerpt/excerpt.component.ts | <reponame>ludohenin/ng2-wp-blog
import {Component, Input, ViewEncapsulation} from 'angular2/core';
@Component({
selector: 'excerpt',
moduleId: module.id,
template: '<div [innerHtml]="excerptContent"></div>',
encapsulation: ViewEncapsulation.None
})
export class ExcerptComponent {
@Input() excerptContent: st... |
ludohenin/ng2-wp-blog | src/blog/post/post.component.spec.ts | <filename>src/blog/post/post.component.spec.ts
import {
TestComponentBuilder,
describe,
expect,
injectAsync,
it,
beforeEachProviders
} from 'angular2/testing';
import {Component, View} from 'angular2/core';
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
import {PostComponent} from './post.compo... |
ludohenin/ng2-wp-blog | tools/tasks/project/copy2wp.ts | <filename>tools/tasks/project/copy2wp.ts
import * as gulp from 'gulp';
import {join} from 'path';
import {APP_DEST, WP_DIR} from '../../config';
export = () => {
return gulp.src(join(APP_DEST, '**/*.*'))
.pipe(gulp.dest(WP_DIR));
};
|
ludohenin/ng2-wp-blog | src/blog/blog/blog.component.ts | import {Component, provide, ViewEncapsulation} from 'angular2/core';
import {RouteConfig, ROUTER_DIRECTIVES} from 'angular2/router';
import {NavbarComponent} from '../navbar/navbar.component';
import {PostComponent} from '../post/post.component';
import {PostsComponent} from '../posts/posts.component';
import {Preload... |
ludohenin/ng2-wp-blog | src/blog/post/post.component.ts | import {Component, ElementRef, AfterViewChecked, OnDestroy, ViewEncapsulation} from 'angular2/core';
import {ROUTER_DIRECTIVES, RouteParams} from 'angular2/router';
import {Subscription} from 'rxjs';
import {WpService, PostModel} from '../services/wp.service';
import {DisqusComponent} from '../disqus/disqus.component'... |
ludohenin/ng2-wp-blog | src/app/app.component.ts | <reponame>ludohenin/ng2-wp-blog
import {Component, ViewEncapsulation} from 'angular2/core';
import {RouteConfig, ROUTER_DIRECTIVES} from 'angular2/router';
import {GoogleAnalyticsService} from '../shared/services';
import {BlogComponent} from '../blog/blog';
@Component({
selector: 'app',
providers: [GoogleAnalyt... |
ludohenin/ng2-wp-blog | src/blog/services/wp/root.ts | import {EventEmitter, Injectable} from 'angular2/core';
import {Response} from 'angular2/http';
import {merge} from 'lodash';
import {ApiService} from './xhr';
import {WpModel, WpResourceConfig} from './wp_resource';
@Injectable()
export class RootModel extends WpModel {
_links: any;
authentication: any[];
descr... |
ludohenin/ng2-wp-blog | src/blog/disqus/disqus.component.ts | <gh_stars>100-1000
import {Component, ViewEncapsulation} from 'angular2/core';
@Component({
selector: 'disqus',
moduleId: module.id,
templateUrl: './disqus.component.html',
styleUrls: ['./disqus.component.css'],
encapsulation: ViewEncapsulation.None,
properties: ['post']
})
export class DisqusComponent {
... |
ludohenin/ng2-wp-blog | src/shared/pipes.ts | <reponame>ludohenin/ng2-wp-blog
import {MomentPipe} from './pipes/moment.pipe';
export const SHARED_PIPES_PROVIDERS = [
MomentPipe
];
|
ludohenin/ng2-wp-blog | src/app/app.ts | <reponame>ludohenin/ng2-wp-blog
export {AppComponent} from './app.component';
|
ludohenin/ng2-wp-blog | tools/config/project.config.ts | <filename>tools/config/project.config.ts
import {join} from 'path';
import {argv} from 'yargs';
import {SeedConfig} from './seed.config';
import {InjectableDependency} from './seed.config.interface';
export class ProjectConfig extends SeedConfig {
APP_CONFIG = require('./app.config');
DEST ... |
ludohenin/ng2-wp-blog | src/blog/blog.ts | <filename>src/blog/blog.ts
export {BlogComponent} from './blog/blog.component';
export {DisqusComponent} from './disqus/disqus.component';
export {ExcerptComponent} from './excerpt/excerpt.component';
export {NavbarComponent} from './navbar/navbar.component';
export {PaginationComponent} from './pagination/pagination.c... |
ludohenin/ng2-wp-blog | src/blog/services/wp/xhr.ts | <reponame>ludohenin/ng2-wp-blog
import {EventEmitter, Injectable, provide} from 'angular2/core';
import {Http, Request, RequestMethod, RequestOptions, RequestOptionsArgs, Response} from 'angular2/http';
import {extend} from 'lodash';
export function makeRequestOtions(opts: RequestOptions|RequestOptionsArgs): RequestO... |
ludohenin/ng2-wp-blog | src/shared/services/google_analytics.service.ts | import {Injectable} from 'angular2/core';
import {Router} from 'angular2/router';
import {APP_CONFIG} from '../../config';
@Injectable()
export class GoogleAnalyticsService {
base: string = '';
ga: any;
constructor(public router: Router) {
this.initializeGaFunction();
this.init(APP_CONFIG.GA_ID, '/blog/'... |
ludohenin/ng2-wp-blog | tools/utils/project.utils.ts | export * from './project/sample_util';
export * from './project/normalize_dependencies';
|
ludohenin/ng2-wp-blog | src/blog/posts/posts.component.ts | <reponame>ludohenin/ng2-wp-blog
import {Component, OnDestroy, ViewEncapsulation} from 'angular2/core';
import {Router, ROUTER_DIRECTIVES, RouteParams} from 'angular2/router';
import {Subscription} from 'rxjs';
import {WpService, PostsCollection, PostModel} from '../services/wp.service';
import {ExcerptComponent} from ... |
ludohenin/ng2-wp-blog | src/blog/services/wp.service.ts | <reponame>ludohenin/ng2-wp-blog
import {XHR_SERVICE_PROVIDERS} from './wp/xhr';
import {WP_RESOURCE_PROVIDERS} from './wp/wp_resource';
import {ROOT_PROVIDERS} from './wp/root';
import {POSTS_PROVIDERS} from './wp/posts';
import {USERS_PROVIDERS} from './wp/users';
import {TERMS_PROVIDERS} from './wp/terms';
import {Wp... |
ludohenin/ng2-wp-blog | src/config.ts | interface IAppConfig {
WP_API_ROOT: string;
WP_API_NAMESPACE: string;
DISQUS_SRC: string;
GA_ID: string;
}
export const APP_CONFIG: IAppConfig = JSON.parse('<%= JSON.stringify(APP_CONFIG) %>');
|
ludohenin/ng2-wp-blog | src/blog/navbar/navbar.component.spec.ts | import {
TestComponentBuilder,
describe,
expect,
injectAsync,
it,
beforeEachProviders
} from 'angular2/testing';
import {Component, View, provide, DirectiveResolver} from 'angular2/core';
import {Location, Router, RouteRegistry} from 'angular2/router';
import {SpyLocation} from 'angular2/src/mock/location_... |
ludohenin/ng2-wp-blog | src/shared/services.ts | <gh_stars>100-1000
export * from './services/google_analytics.service';
|
live-codes/go2js | src/get-url.ts | export const getUrl = (baseUrl?: string) => {
if (baseUrl) {
if (typeof baseUrl === 'string') {
if (baseUrl.endsWith('/')) {
return baseUrl.slice(0, -1);
}
return baseUrl;
} else {
throw new Error('invalid baseUrl');
}
}
const metaUrl = import.meta?.url;
const curren... |
live-codes/go2js | src/index.ts | export { compile } from './compile';
export { format } from './format';
|
live-codes/go2js | src/format.ts | <reponame>live-codes/go2js
import { getUrl } from './get-url';
export const format = async (code: string, baseUrl?: string, imports = true): Promise<string> => {
const url = getUrl(baseUrl);
const filename = imports ? '/go2js-format.js' : '/go2js-format-no-imports.js';
await import(url + filename);
return new ... |
live-codes/go2js | src/compile.ts | <reponame>live-codes/go2js
import { getUrl } from './get-url';
export const compile = async (code: string, baseUrl?: string): Promise<string> => {
const url = getUrl(baseUrl);
await import(url + '/go2js-compile.js');
return new Promise((resolve, reject) => {
(globalThis as any).go2jsCompile(code, url, (err: ... |
vijathanga/vscode | src/vs/workbench/browser/panel.ts | <gh_stars>1-10
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*------------------------------------------------... |
agtenr/styled-fabricui-components | src/webparts/styleableBeer/components/beer/Beer.ts | import { styled } from 'office-ui-fabric-react/lib/Utilities';
import { IBeerProps } from "./IBeerProps";
import { IBeerStyleProps } from "./IBeerStyleProps";
import { IBeerStyles } from "./IBeerStyles";
import { BeerBase } from "./Beer.base";
import { getStyles } from "./Beer.styles";
export const Beer: React.SFC<IBe... |
agtenr/styled-fabricui-components | src/webparts/componentCatalog/components/ComponentCatalog.tsx | <filename>src/webparts/componentCatalog/components/ComponentCatalog.tsx<gh_stars>0
import * as React from 'react';
import styles from './ComponentCatalog.module.scss';
import { IComponentCatalogProps } from './IComponentCatalogProps';
import { CompanyPrimaryButton } from "../controls/CompanyPrimaryButton";
import { Com... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.