type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
ArrowFunction |
async (module: string, interpreter: PythonInterpreter, cancelToken?: CancellationToken): Promise<boolean> => {
if (interpreter && interpreter !== null) {
const newOptions: SpawnOptions = { throwOnStdErr: true, encoding: 'utf8', token: cancelToken };
newOptions.env = await this.fixupC... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
async (command?: string, cancelToken?: CancellationToken): Promise<boolean> => {
const newOptions: SpawnOptions = { throwOnStdErr: true, encoding: 'utf8', token: cancelToken };
const args = command ? [command, '--version'] : ['--version'];
const processService = await this.processServiceProm... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ClassDeclaration | // JupyterCommand objects represent some process that can be launched that should be guaranteed to work because it
// was found by testing it previously
class JupyterCommand {
private exe: string;
private requiredArgs: string[];
private launcher: IProcessService;
private interpreterPromise: Promise<... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
MethodDeclaration |
public async mainVersion(): Promise<number> {
const interpreter = await this.interpreterPromise;
if (interpreter && interpreter.version) {
return interpreter.version.major;
} else {
return this.execVersion();
}
} | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
MethodDeclaration |
public interpreter() : Promise<PythonInterpreter | undefined> {
return this.interpreterPromise;
} | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
MethodDeclaration |
public async execObservable(args: string[], options: SpawnOptions): Promise<ObservableExecutionResult<string>> {
const newOptions = { ...options };
newOptions.env = await this.fixupCondaEnv(newOptions.env);
const newArgs = [...this.requiredArgs, ...args];
return this.launcher.execOb... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
MethodDeclaration |
public async exec(args: string[], options: SpawnOptions): Promise<ExecutionResult<string>> {
const newOptions = { ...options };
newOptions.env = await this.fixupCondaEnv(newOptions.env);
const newArgs = [...this.requiredArgs, ...args];
return this.launcher.exec(this.exe, newArgs, ne... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
MethodDeclaration | /**
* Conda needs specific paths and env vars set to be happy. Call this function to fix up
* (or created if not present) our environment to run jupyter
*/
// Base Node.js SpawnOptions uses any for environment, so use that here as well
// tslint:disable-next-line:no-any
private async fixupCondaEnv(inp... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
MethodDeclaration |
private async execVersion(): Promise<number> {
if (this.launcher) {
const output = await this.launcher.exec(this.exe, ['--version'], { throwOnStdErr: false, encoding: 'utf8' });
// First number should be our result
const matches = /.*(\d+).*/m.exec(output.stdout);
... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
MethodDeclaration |
public dispose() {
// Clear our usableJupyterInterpreter
this.usablePythonInterpreter = undefined;
this.commands = {};
} | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
MethodDeclaration |
public isNotebookSupported(cancelToken?: CancellationToken): Promise<boolean> {
// See if we can find the command notebook
return Cancellation.race(() => this.isCommandSupported(NotebookCommand, cancelToken), cancelToken);
} | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
MethodDeclaration |
public async getUsableJupyterPython(cancelToken?: CancellationToken): Promise<PythonInterpreter | undefined> {
// Only try to compute this once.
if (!this.usablePythonInterpreter) {
this.usablePythonInterpreter = await Cancellation.race(() => this.getUsableJupyterPythonImpl(cancelToken),... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
MethodDeclaration |
public connectToNotebookServer(uri: string | undefined, useDefaultConfig: boolean, cancelToken?: CancellationToken, workingDir?: string): Promise<INotebookServer | undefined> {
// Return nothing if we cancel
return Cancellation.race(async () => {
let connection: IConnection;
... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
MethodDeclaration |
protected async getMatchingKernelSpec(connection?: IConnection, cancelToken?: CancellationToken): Promise<IJupyterKernelSpec | undefined> {
// If not using an active connection, check on disk
if (!connection) {
// Get our best interpreter. We want its python path
const bestI... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
MethodDeclaration |
@captureTelemetry(Telemetry.StartJupyter)
private async startNotebookServer(useDefaultConfig: boolean, cancelToken?: CancellationToken): Promise<{ connection: IConnection; kernelSpec: IJupyterKernelSpec | undefined }> {
// First we find a way to start a notebook server
const notebookCommand = aw... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
MethodDeclaration |
private onSettingsChanged() {
// Do the same thing as dispose so that we regenerate
// all of our commands
this.dispose();
} | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
MethodDeclaration |
private async addMatchingSpec(bestInterpreter: PythonInterpreter, cancelToken?: CancellationToken): Promise<void> {
const displayName = localize.DataScience.historyTitle();
const ipykernelCommand = await this.findBestCommand(KernelCreateCommand, cancelToken);
// If this fails, then we just... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
MethodDeclaration |
private async generateTempDir(): Promise<TemporaryDirectory> {
const resultDir = path.join(os.tmpdir(), uuid());
await this.fileSystem.createDirectory(resultDir);
return {
path: resultDir,
dispose: async () => {
// Try ten times. Process may still... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
MethodDeclaration |
private async readSpec(kernelSpecOutputLine: string) : Promise<JupyterKernelSpec | undefined> {
const match = KernelSpecOutputRegEx.exec(kernelSpecOutputLine);
if (match && match !== null && match.length > 2) {
// Second match should be our path to the kernel spec
const file... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
MethodDeclaration |
private supportsSearchingForCommands() : boolean {
if (this.configuration) {
const settings = this.configuration.getSettings();
if (settings) {
return settings.datascience.searchForJupyter;
}
}
return true;
} | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
FunctionDeclaration |
function handleChange(evt) {
setValue(evt.target.value);
} | JustUtahCoders/comunidades-unidas-internal | frontend/view-edit-client/interactions/custom-question-inputs/custom-text.tsx | TypeScript |
ArrowFunction |
(props, ref) => {
const [value, setValue] = useState<string>(
props.initialAnswer ? (props.initialAnswer as string) : ""
);
useImperativeHandle(ref, () => ({
getAnswer() {
return {
questionId: props.question.id,
answer: value,
};
},
}));
retur... | JustUtahCoders/comunidades-unidas-internal | frontend/view-edit-client/interactions/custom-question-inputs/custom-text.tsx | TypeScript |
ArrowFunction |
() => ({
getAnswer() {
return {
questionId: props.question.id,
answer: value,
};
},
}) | JustUtahCoders/comunidades-unidas-internal | frontend/view-edit-client/interactions/custom-question-inputs/custom-text.tsx | TypeScript |
MethodDeclaration |
getAnswer() {
return {
questionId: props.question.id,
answer: value,
};
} | JustUtahCoders/comunidades-unidas-internal | frontend/view-edit-client/interactions/custom-question-inputs/custom-text.tsx | TypeScript |
ArrowFunction |
(color: string) => (
<>
<circle
cx="127.99707" | duongdev/phosphor-react | src/icons/GlobeHemisphereEast.tsx | TypeScript |
ArrowFunction |
(color: string) => (
<>
<path
d="M187.06231,203.68216l-10.731-10.75225a7.99991,7.99991,0,0,0-3.6318-2.08674l-21.45845-5.63128a8,8,0,0,1-5.884-8.90337l2.38477-16.19606a8,8,0,0,1,4.84416-6.22191l30.45054-12.65666a8,8,0,0,1,8.4696,1.48392l24.89413,22.76769.05166-.118a96.30537,96.30537,0,0,1-29.18668,38.157Z" | duongdev/phosphor-react | src/icons/GlobeHemisphereEast.tsx | TypeScript |
ArrowFunction |
() => (
<>
<path d="M223.4873,169.18066a7.96262,7.96262,0,0,0,.49805-1.166A103.91753,103.91753,0,0,0,187.772,42.94336a8.06306,8.06306,0,0,0-1.13965-.79053A103.94567,103.94567,0,0,0,42.61768,187.31152c.04.07129.07324.145.11572.21582a7.9667,7.9667,0,0,0,.80664,1.08985A103.847,103.847,0,0,0,191.2627,210.48242a7.98,... | duongdev/phosphor-react | src/icons/GlobeHemisphereEast.tsx | TypeScript |
ArrowFunction |
(color: string) => (
<>
<circle
cx="127.99805" | duongdev/phosphor-react | src/icons/GlobeHemisphereEast.tsx | TypeScript |
ArrowFunction |
(color: string) => (
<>
<circle
cx="127.99902" | duongdev/phosphor-react | src/icons/GlobeHemisphereEast.tsx | TypeScript |
ArrowFunction |
(color: string) => (
<>
<circle
cx="128" | duongdev/phosphor-react | src/icons/GlobeHemisphereEast.tsx | TypeScript |
ArrowFunction |
(weight: IconWeight, color: string) =>
renderPathForWeight(weight, color, pathsByWeight) | duongdev/phosphor-react | src/icons/GlobeHemisphereEast.tsx | TypeScript |
ArrowFunction |
(props, ref) => <IconBase ref | duongdev/phosphor-react | src/icons/GlobeHemisphereEast.tsx | TypeScript |
ArrowFunction |
props => {
const { size, withHoverEffect, color, margin, ...restProps } = props;
return (
<SvgIcon {...{ size, withHoverEffect, color, margin, ...restProps }}>
<PermContactCalendarIconSvg {...restProps} width="1em" height="1em" />
</SvgIcon> | IshanKute/medly-components | packages/icons/src/icons/Action/PermContactCalendarIcon.tsx | TypeScript |
InterfaceDeclaration | // Button component props type
export interface ButtonProps {
children?: ReactNode;
disabled?: boolean | null;
isDark: boolean;
loading?: boolean;
label: string;
// can be changed
type: 'primary' | 'secondary' | 'default';
onPress?: () => void;
customStyles: StyleType;
// to show some loading state
... | SwarajRenghe/super | src/components/Button/types.tsx | TypeScript |
ClassDeclaration |
export default class NotFoundPage extends React.Component<INotFoundPageProps, INotFoundPageState> {
constructor(props: INotFoundPageProps) {
super(props);
this.state = {
name: this.props.history.location.pathname.substring(1, this.props.history.location.pathname.length)
}
}
componentWillMount(... | EliEladElrom/react-tutorials | react-routing-ts/src/pages/NotFoundPage/NotFoundPage.tsx | TypeScript |
InterfaceDeclaration |
interface INotFoundPageProps extends RouteComponentProps<{ name: string }> {
// TODO
} | EliEladElrom/react-tutorials | react-routing-ts/src/pages/NotFoundPage/NotFoundPage.tsx | TypeScript |
InterfaceDeclaration |
interface INotFoundPageState {
name: string
} | EliEladElrom/react-tutorials | react-routing-ts/src/pages/NotFoundPage/NotFoundPage.tsx | TypeScript |
MethodDeclaration |
componentWillMount() {
// TODO
} | EliEladElrom/react-tutorials | react-routing-ts/src/pages/NotFoundPage/NotFoundPage.tsx | TypeScript |
MethodDeclaration |
componentDidUpdate() {
// TODO
} | EliEladElrom/react-tutorials | react-routing-ts/src/pages/NotFoundPage/NotFoundPage.tsx | TypeScript |
MethodDeclaration |
componentWillUpdate() {
// TODO
} | EliEladElrom/react-tutorials | react-routing-ts/src/pages/NotFoundPage/NotFoundPage.tsx | TypeScript |
MethodDeclaration |
render() {
return (
<div className="NotFoundPage">
{this.state.name} Component
</div>);
} | EliEladElrom/react-tutorials | react-routing-ts/src/pages/NotFoundPage/NotFoundPage.tsx | TypeScript |
ArrowFunction |
(res: any) => {
if (res.status_code == 200) {
this.setState({ list: res.data.list, total: res.data.total, last_page: res.data.last_page, page: this.state.page + 1 })
} else {
Taro.showToast({ title: res.message, icon: 'none' })
}
} | vvcxxc/tuan-mai-wu-lian | src/pages/my/invitation-list/index.tsx | TypeScript |
ArrowFunction |
err => {
Taro.showToast({ title: '请求失败', icon: 'none' })
} | vvcxxc/tuan-mai-wu-lian | src/pages/my/invitation-list/index.tsx | TypeScript |
ArrowFunction |
(res: any) => {
if (res.status_code == 200) {
that.setState({ list: that.state.list.concat(res.data.list), total: res.data.total, last_page: res.data.last_page, page: that.state.page + 1 })
} else {
Taro.showToast({ title: res.message, icon: 'none... | vvcxxc/tuan-mai-wu-lian | src/pages/my/invitation-list/index.tsx | TypeScript |
ArrowFunction |
err => {
Taro.showToast({ title: '请求失败', icon: 'none' })
} | vvcxxc/tuan-mai-wu-lian | src/pages/my/invitation-list/index.tsx | TypeScript |
ArrowFunction |
(item: any, index: any) => {
return (
<View className='invitation-item' key={item}>
<View className='invitation-item-uesr'>
<View className='invitation... | vvcxxc/tuan-mai-wu-lian | src/pages/my/invitation-list/index.tsx | TypeScript |
ClassDeclaration |
export default class AppreActivity extends Component {
config = {
navigationBarTitleText: "我的邀请列表",
enablePullDownRefresh: false
};
state = {
page: 1,
total: 0,
last_page: 0,
list: [
]
};
/**
*第一次请求,替代
*/
componentDidShow() {
... | vvcxxc/tuan-mai-wu-lian | src/pages/my/invitation-list/index.tsx | TypeScript |
MethodDeclaration | /**
*第一次请求,替代
*/
componentDidShow() {
userRelationShip({ page: 1 }).then((res: any) => {
if (res.status_code == 200) {
this.setState({ list: res.data.list, total: res.data.total, last_page: res.data.last_page, page: this.state.page + 1 })
} else {
... | vvcxxc/tuan-mai-wu-lian | src/pages/my/invitation-list/index.tsx | TypeScript |
MethodDeclaration | /**
*加载更多,衔接
*/
onReachBottom() {
let that = this;
if (this.state.page <= this.state.last_page) {
userRelationShip({ page: that.state.page }).then((res: any) => {
if (res.status_code == 200) {
that.setState({ list: that.state.list.concat(res.data.l... | vvcxxc/tuan-mai-wu-lian | src/pages/my/invitation-list/index.tsx | TypeScript |
MethodDeclaration |
render() {
return (
<View className="invitation-list">
<View className="invitation-list-nav">
<View className="invitation-title">邀请的用户数量</View>
<View className="invitation-num">{this.state.total}</View>
</View>
... | vvcxxc/tuan-mai-wu-lian | src/pages/my/invitation-list/index.tsx | TypeScript |
MethodDeclaration |
require('@/assets/index/no-data.png') | vvcxxc/tuan-mai-wu-lian | src/pages/my/invitation-list/index.tsx | TypeScript |
ArrowFunction |
({ Component, pageProps }: AppProps): JSX.Element => {
return (
<>
<Head>
<title>Ethereum DAPP Demo</title>
<meta
name="viewport"
content="minimum-scale=1, initial-scale=1, width=device-width"
/>
... | VarunSAthreya/ethereum_dapp_demo | pages/_app.tsx | TypeScript |
ArrowFunction |
() => {
return (
<HomeContainer>
<h1>Nice, you are logged in</h1>
</HomeContainer> | return-main/aws-cognito-boilerplate | src/pages/Home.tsx | TypeScript |
ClassDeclaration |
@Component({
selector: 'tabs-section',
template: `
<demo-section [name]="name" [src]="src" [titleDoc]="titleDoc" [html]="html" [ts]="ts" [doc]="doc">
<tabs-demo></tabs-demo>
</demo-section>`
})
export class TabsSectionComponent {
public name:string = 'Tabs';
public src:string = 'https://github.co... | formio/ng2-bootstrap | demo/components/tabs-section.ts | TypeScript |
ClassDeclaration |
export class CreateUserUseCaseImpl implements ICreateUserUseCase {
constructor(private readonly userRepository: IUserRepository) {}
async execute(params: CreateUserParams): Promise<CreateUserResponse> {
return await this.userRepository.create(params)
}
} | ErickLuizA/rn-music-app | src/data/useCases/CreateUserUseCaseImpl.ts | TypeScript |
MethodDeclaration |
async execute(params: CreateUserParams): Promise<CreateUserResponse> {
return await this.userRepository.create(params)
} | ErickLuizA/rn-music-app | src/data/useCases/CreateUserUseCaseImpl.ts | TypeScript |
ClassDeclaration | /**
* Perform operations with the group backend microservice.
*/
@Injectable()
export class GroupService {
private groups: Group[];
// Maven fills in these variables from the pom.xml
private url = '${group.service.url}';
constructor(private http: HttpClient) {
this.url = this.url + ((this.url.in... | OpenLiberty/sample-acmegifts | front-end-ui/src/app/group/services/group.service.ts | TypeScript |
MethodDeclaration |
getGroups(userId: string): Observable<Groups> {
let headers = new HttpHeaders();
headers = headers.set('Authorization', sessionStorage.jwt);
return this.http.get<Groups>(this.url + '?userId=' + userId, { headers: headers })
.map(data => data)
} | OpenLiberty/sample-acmegifts | front-end-ui/src/app/group/services/group.service.ts | TypeScript |
MethodDeclaration |
getGroup(groupId: string): Observable<Group> {
let headers = new HttpHeaders();
headers = headers.set('Authorization', sessionStorage.jwt);
return this.http.get<Group>(this.url + groupId, { headers: headers })
.map(data => data)
} | OpenLiberty/sample-acmegifts | front-end-ui/src/app/group/services/group.service.ts | TypeScript |
MethodDeclaration |
createGroup(payload: string): Observable<HttpResponse<any>> {
let headers = new HttpHeaders();
headers = headers.set('Content-Type', 'application/json');
headers = headers.set('Authorization', sessionStorage.jwt);
return this.http.post<HttpResponse<any>>(this.url, payload, { headers: hea... | OpenLiberty/sample-acmegifts | front-end-ui/src/app/group/services/group.service.ts | TypeScript |
MethodDeclaration |
updateGroup(groupId: string, payload: string): Observable<HttpResponse<any>> {
let headers = new HttpHeaders();
headers = headers.set('Content-Type', 'application/json');
headers = headers.set('Authorization', sessionStorage.jwt);
return this.http.put<HttpResponse<any>>(this.url + groupId, pay... | OpenLiberty/sample-acmegifts | front-end-ui/src/app/group/services/group.service.ts | TypeScript |
MethodDeclaration |
deleteGroup(groupId: string): Observable<HttpResponse<any>> {
let headers = new HttpHeaders();
headers = headers.set('Authorization', sessionStorage.jwt);
return this.http.delete<HttpResponse<any>>(this.url + groupId, { headers: headers })
.map(data => data);
} | OpenLiberty/sample-acmegifts | front-end-ui/src/app/group/services/group.service.ts | TypeScript |
ArrowFunction |
(rows: Packet[] | Flow[], property: PacketTableSortProperty | FlowTableSortProperty, direction: SortDirection) => {
let sortedRows = [...rows];
sortedRows.sort((a, b) => {
let propertyA = a[property] || '';
let propertyB = b[property] || '';
if (propertyA < propertyB) {
retu... | JuroUhlar/pcapfunnel | frontend/src/charts/DataTable/tableUtils.ts | TypeScript |
ArrowFunction |
(a, b) => {
let propertyA = a[property] || '';
let propertyB = b[property] || '';
if (propertyA < propertyB) {
return direction === 'asc' ? -1 : 1;
}
if (propertyA > propertyB) {
return direction === 'asc' ? 1 : -1;
}
return 0;
} | JuroUhlar/pcapfunnel | frontend/src/charts/DataTable/tableUtils.ts | TypeScript |
TypeAliasDeclaration |
export type SortDirection = 'asc' | 'desc'; | JuroUhlar/pcapfunnel | frontend/src/charts/DataTable/tableUtils.ts | TypeScript |
ArrowFunction |
() => this.onPageIndexChange(lastIndex) | Bahubali-Dev/ng-zorro-antd | components/pagination/pagination.component.ts | TypeScript |
ArrowFunction |
() => {
this.locale = this.i18n.getLocaleData('Pagination');
this.cdr.markForCheck();
} | Bahubali-Dev/ng-zorro-antd | components/pagination/pagination.component.ts | TypeScript |
ArrowFunction |
total => {
this.onTotalChange(total);
} | Bahubali-Dev/ng-zorro-antd | components/pagination/pagination.component.ts | TypeScript |
ArrowFunction |
bp => {
if (this.nzResponsive) {
this.size = bp === NzBreakpointEnum.xs ? 'small' : 'default';
this.cdr.markForCheck();
}
} | Bahubali-Dev/ng-zorro-antd | components/pagination/pagination.component.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'nz-pagination',
exportAs: 'nzPagination',
preserveWhitespaces: false,
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<ng-container *ngIf="showPagination">
<ng-container *ngIf="nzSimple; else defaultPagination.template">
... | Bahubali-Dev/ng-zorro-antd | components/pagination/pagination.component.ts | TypeScript |
MethodDeclaration |
validatePageIndex(value: number, lastIndex: number): number {
if (value > lastIndex) {
return lastIndex;
} else if (value < 1) {
return 1;
} else {
return value;
}
} | Bahubali-Dev/ng-zorro-antd | components/pagination/pagination.component.ts | TypeScript |
MethodDeclaration |
onPageIndexChange(index: number): void {
const lastIndex = this.getLastIndex(this.nzTotal, this.nzPageSize);
const validIndex = this.validatePageIndex(index, lastIndex);
if (validIndex !== this.nzPageIndex && !this.nzDisabled) {
this.nzPageIndex = validIndex;
this.nzPageIndexChange.emit(this.nz... | Bahubali-Dev/ng-zorro-antd | components/pagination/pagination.component.ts | TypeScript |
MethodDeclaration |
onPageSizeChange(size: number): void {
this.nzPageSize = size;
this.nzPageSizeChange.emit(size);
const lastIndex = this.getLastIndex(this.nzTotal, this.nzPageSize);
if (this.nzPageIndex > lastIndex) {
this.onPageIndexChange(lastIndex);
}
} | Bahubali-Dev/ng-zorro-antd | components/pagination/pagination.component.ts | TypeScript |
MethodDeclaration |
onTotalChange(total: number): void {
const lastIndex = this.getLastIndex(total, this.nzPageSize);
if (this.nzPageIndex > lastIndex) {
Promise.resolve().then(() => this.onPageIndexChange(lastIndex));
}
} | Bahubali-Dev/ng-zorro-antd | components/pagination/pagination.component.ts | TypeScript |
MethodDeclaration |
getLastIndex(total: number, pageSize: number): number {
return Math.ceil(total / pageSize);
} | Bahubali-Dev/ng-zorro-antd | components/pagination/pagination.component.ts | TypeScript |
MethodDeclaration |
ngOnInit(): void {
this.i18n.localeChange.pipe(takeUntil(this.destroy$)).subscribe(() => {
this.locale = this.i18n.getLocaleData('Pagination');
this.cdr.markForCheck();
});
this.total$.pipe(takeUntil(this.destroy$)).subscribe(total => {
this.onTotalChange(total);
});
this.breakp... | Bahubali-Dev/ng-zorro-antd | components/pagination/pagination.component.ts | TypeScript |
MethodDeclaration |
ngOnDestroy(): void {
this.destroy$.next();
this.destroy$.complete();
} | Bahubali-Dev/ng-zorro-antd | components/pagination/pagination.component.ts | TypeScript |
MethodDeclaration |
ngOnChanges(changes: SimpleChanges): void {
const { nzHideOnSinglePage, nzTotal, nzPageSize, nzSize } = changes;
if (nzTotal) {
this.total$.next(this.nzTotal);
}
if (nzHideOnSinglePage || nzTotal || nzPageSize) {
this.showPagination = (this.nzHideOnSinglePage && this.nzTotal > this.nzPageSi... | Bahubali-Dev/ng-zorro-antd | components/pagination/pagination.component.ts | TypeScript |
ClassDeclaration |
export default class ResearcherGloves extends Item {
static get name(): string {
return 'Researcher\'s Gloves';
}
static get isPassive(): boolean {
return false;
}
static get desc(): string {
return 'A heavy sword.';
}
static get buyPrice(): number {
return 30.0;
}
static get sel... | awdogsgo2heaven/kaiscripts | lib/items/researcher-gloves.ts | TypeScript |
MethodDeclaration |
static toSymbol() {
return 'ResearcherGloves';
} | awdogsgo2heaven/kaiscripts | lib/items/researcher-gloves.ts | TypeScript |
MethodDeclaration |
public static equip(kaiScript: AvatarKaiScript) {
kaiScript.addBonus.intelligence += 30;
kaiScript.addBonus.knowledge -= 30;
} | awdogsgo2heaven/kaiscripts | lib/items/researcher-gloves.ts | TypeScript |
ArrowFunction |
(evt) => {
this.fullscreen = !!document.fullscreenElement;
} | swimmadude66/movienight | src/client/components/player/component.ts | TypeScript |
ArrowFunction |
val => {
this.setVolume(val / 100);
} | swimmadude66/movienight | src/client/components/player/component.ts | TypeScript |
ArrowFunction |
_ => this.showControls = true | swimmadude66/movienight | src/client/components/player/component.ts | TypeScript |
ArrowFunction |
_ => this.showControls = false | swimmadude66/movienight | src/client/components/player/component.ts | TypeScript |
ArrowFunction |
_ => {
this._ended = false;
this.playing = true;
this.starting = false;
this.interactionRequired = false;
this._progressSub = timer(0, 50)
.pipe(
takeWhile(_ => !this._ended)
... | swimmadude66/movienight | src/client/components/player/component.ts | TypeScript |
ArrowFunction |
_ => !this._ended | swimmadude66/movienight | src/client/components/player/component.ts | TypeScript |
ArrowFunction |
_ => {
this.currTime = this.getCurrentTime();
this.percentPlayed = Math.floor((this.currTime / this.length) * 100);
} | swimmadude66/movienight | src/client/components/player/component.ts | TypeScript |
ArrowFunction |
err => this.interactionRequired = true | swimmadude66/movienight | src/client/components/player/component.ts | TypeScript |
ArrowFunction |
_ => {
this.currTime = this.getCurrentTime();
this.percentPlayed = Math.floor((this.currTime / this.length) * 100);
} | swimmadude66/movienight | src/client/components/player/component.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'video-player',
templateUrl: './template.html',
styleUrls: ['./styles.scss']
})
export class VideoPlayerComponent extends SubscriberComponent {
@ViewChild('player') set player(p: ElementRef<HTMLVideoElement>) {
if (p && p.nativeElement) {
this._player = p.nat... | swimmadude66/movienight | src/client/components/player/component.ts | TypeScript |
MethodDeclaration |
testSeek(event: MouseEvent) {
console.log(event);
} | swimmadude66/movienight | src/client/components/player/component.ts | TypeScript |
MethodDeclaration |
mouseMove(evt) {
this._mouseSubject.next(evt);
} | swimmadude66/movienight | src/client/components/player/component.ts | TypeScript |
MethodDeclaration |
getCurrentTime(): number {
if (this._player) {
return this._player.currentTime;
}
} | swimmadude66/movienight | src/client/components/player/component.ts | TypeScript |
MethodDeclaration |
seekTo(seconds: number) {
if (seconds < 0) {
return;
}
if (this._player) {
if (this._player.duration > seconds) {
this._player.currentTime = seconds;
}
}
} | swimmadude66/movienight | src/client/components/player/component.ts | TypeScript |
MethodDeclaration |
play(startTime?: string | number | Date) {
if (this._player && this.videoSrc && this._ready) {
const now = new Date().valueOf();
const start = startTime || this.startTime;
if (!start) {
return; // no known start time
}
const seekTime =... | swimmadude66/movienight | src/client/components/player/component.ts | TypeScript |
MethodDeclaration |
stop() {
if (this._player) {
this._player.pause();
this._player.currentTime = 0;
this.currTime = 0;
this.percentPlayed = 0;
this._ended = true;
this.playing = false;
this.stopping = false;
this._cancelProgress();
... | swimmadude66/movienight | src/client/components/player/component.ts | TypeScript |
MethodDeclaration |
toggleMute() {
this.muted = !this.muted;
} | swimmadude66/movienight | src/client/components/player/component.ts | TypeScript |
MethodDeclaration |
setVolume(volume: number) {
this._player.volume = volume;
} | swimmadude66/movienight | src/client/components/player/component.ts | TypeScript |
MethodDeclaration |
goFullScreen() {
if (!this._player || !this._playerContainer) {
console.log('no player found');
return;
}
if (document.fullscreenEnabled) {
if (!!document.fullscreenElement) {
document.exitFullscreen();
} else {
thi... | swimmadude66/movienight | src/client/components/player/component.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.