type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
FunctionDeclaration | /**
* Helper function to create a {@link vscode.Task Task} with the given parameters.
*/
export function createSwiftTask(args: string[], name: string, config?: TaskConfig): vscode.Task {
const swift = getSwiftExecutable();
const task = new vscode.Task(
{ type: "swift", command: swift, args: args },
... | compnerd/vscode-swift | src/SwiftTaskProvider.ts | TypeScript |
FunctionDeclaration | /*
* Execute swift command as task and wait until it is finished
*/
export async function executeSwiftTaskAndWait(args: string[], name: string, config?: TaskConfig) {
const swift = getSwiftExecutable();
const task = new vscode.Task(
{ type: "swift", command: "swift", args: args },
config?.scop... | compnerd/vscode-swift | src/SwiftTaskProvider.ts | TypeScript |
FunctionDeclaration | /*
* Execute shell command as task and wait until it is finished
*/
export async function executeShellTaskAndWait(
command: string,
args: string[],
name: string,
config?: TaskConfig
) {
const task = new vscode.Task(
{ type: "swift", command: command, args: args },
config?.scope ?? ... | compnerd/vscode-swift | src/SwiftTaskProvider.ts | TypeScript |
FunctionDeclaration | /*
* Execute task and wait until it is finished. This function assumes that no
* other tasks with the same name will be run at the same time
*/
export async function executeTaskAndWait(task: vscode.Task) {
return new Promise<void>(resolve => {
const disposable = vscode.tasks.onDidEndTask(({ execution }) ... | compnerd/vscode-swift | src/SwiftTaskProvider.ts | TypeScript |
ArrowFunction |
resolve => {
const disposable = vscode.tasks.onDidEndTask(({ execution }) => {
if (execution.task.name === task.name && execution.task.scope === task.scope) {
disposable.dispose();
resolve();
}
});
vscode.tasks.executeTask(task);
} | compnerd/vscode-swift | src/SwiftTaskProvider.ts | TypeScript |
ArrowFunction |
({ execution }) => {
if (execution.task.name === task.name && execution.task.scope === task.scope) {
disposable.dispose();
resolve();
}
} | compnerd/vscode-swift | src/SwiftTaskProvider.ts | TypeScript |
ClassDeclaration | /**
* A {@link vscode.TaskProvider TaskProvider} for tasks that match the definition
* in **package.json**: `{ type: 'swift'; command: string; args: string[] }`.
*
* See {@link SwiftTaskProvider.provideTasks provideTasks} for a list of provided tasks.
*/
export class SwiftTaskProvider implements vscode.TaskProvide... | compnerd/vscode-swift | src/SwiftTaskProvider.ts | TypeScript |
InterfaceDeclaration | /**
* References:
*
* - General information on tasks:
* https://code.visualstudio.com/docs/editor/tasks
* - Contributing task definitions:
* https://code.visualstudio.com/api/references/contribution-points#contributes.taskDefinitions
* - Implementing task providers:
* https://code.visualstudio.com/api/ext... | compnerd/vscode-swift | src/SwiftTaskProvider.ts | TypeScript |
MethodDeclaration | /**
* Provides tasks to run the following commands:
*
* - `swift build`
* - `swift package clean`
* - `swift package resolve`
* - `swift package update`
* - `swift run ${target}` for every executable target
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async pr... | compnerd/vscode-swift | src/SwiftTaskProvider.ts | TypeScript |
MethodDeclaration | /**
* Resolves a {@link vscode.Task Task} specified in **tasks.json**.
*
* Other than its definition, this `Task` may be incomplete,
* so this method should fill in the blanks.
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
resolveTask(task: vscode.Task, token: vscode.Cancella... | compnerd/vscode-swift | src/SwiftTaskProvider.ts | TypeScript |
FunctionDeclaration |
export default function WalletCreateList() {
const history = useHistory();
const { url } = useRouteMatch();
function handleCreateDistributedIdentity() {
history.push(`${url}/did`);
}
return (
<Flex flexDirection="column" gap={3}>
<Flex flexGrow={1}>
<Typography variant="h5">
... | AmineKhaldi/chia-blockchain-gui | src/components/wallet/create/WalletCreateList.tsx | TypeScript |
FunctionDeclaration |
function handleCreateDistributedIdentity() {
history.push(`${url}/did`);
} | AmineKhaldi/chia-blockchain-gui | src/components/wallet/create/WalletCreateList.tsx | TypeScript |
ClassDeclaration |
@Component({
selector: 'notification-item',
templateUrl: './notification-item.component.html',
styleUrls: ['./notification-item.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class NotificationItemComponent {
@Input() notification: Notification;
private errorMessage = "This ur... | ioaNikas/blockframes | libs/notification/src/lib/notification/notification-item/notification-item.component.ts | TypeScript |
MethodDeclaration |
public goToPath() {
try {
this.router.navigate([this.notification.path]);
this.service.readNotification(this.notification.id);
} catch (error) {
console.error(error);
throw new Error(this.errorMessage);
}
} | ioaNikas/blockframes | libs/notification/src/lib/notification/notification-item/notification-item.component.ts | TypeScript |
MethodDeclaration |
public goToTeamwork() {
try {
this.router.navigate([this.notification.path]);
this.service.readNotification(this.notification.id);
} catch (error) {
console.error(error);
throw new Error(this.errorMessage);
}
} | ioaNikas/blockframes | libs/notification/src/lib/notification/notification-item/notification-item.component.ts | TypeScript |
MethodDeclaration |
public read() {
this.service.readNotification(this.notification.id);
} | ioaNikas/blockframes | libs/notification/src/lib/notification/notification-item/notification-item.component.ts | TypeScript |
ClassDeclaration |
export class Tenderfoot extends Unit {
protected baseAttributes = new Attributes();
color: Color.ColorName = 'Neutral';
spec: Color.Spec = 'Starter';
flavorType = 'Virtuoso';
name: string = 'Tenderfoot';
techLevel: TechLevel = 0;
importPath: string = './neutral/starter';
constructor(o... | rgraciano/codex | src/cards/neutral/starter/Tenderfoot.ts | TypeScript |
FunctionDeclaration | /** @deprecated use getResponseTypes instead, this function will be removed in a future version. */
function onlySuccessful(statusCode: string) {
return successfulCodes.includes(statusCode);
} | IZEDx/swagger-typescript-codegen | src/view-data/responseType.ts | TypeScript |
FunctionDeclaration | /** @deprecated use getResponseTypes instead, this function will be removed in a future version. */
function getSuccessfulResponse(op: HttpOperation): SwaggerType {
const definedSuccessCodes = Object.keys(op.responses).filter(onlySuccessful);
if (definedSuccessCodes.length === 0) {
throw new Error("No success ... | IZEDx/swagger-typescript-codegen | src/view-data/responseType.ts | TypeScript |
FunctionDeclaration | /** @deprecated use getResponseTypes instead, this function will be removed in a future version. */
export function getSuccessfulResponseType(
op: HttpOperation,
swagger: Swagger
): [string, boolean] {
let successfulResponseTypeIsRef = false;
let successfulResponseType;
try {
const successfulResponse = g... | IZEDx/swagger-typescript-codegen | src/view-data/responseType.ts | TypeScript |
ArrowFunction |
(
responseTypeName: string,
httpOperation: HttpOperation,
swagger: Swagger
): string =>
uniq(
responseTypesToStrings(
responseTypeName,
convertResponseTypes(responseTypes(httpOperation), swagger)
)
).join(" | ") | IZEDx/swagger-typescript-codegen | src/view-data/responseType.ts | TypeScript |
ArrowFunction |
(
httpOperation: HttpOperation
): ResponseType<SwaggerType>[] =>
entries(httpOperation.responses).map(kvp => ({
statusType: kvp[0],
bodyType: kvp[1]
})) | IZEDx/swagger-typescript-codegen | src/view-data/responseType.ts | TypeScript |
ArrowFunction |
kvp => ({
statusType: kvp[0],
bodyType: kvp[1]
}) | IZEDx/swagger-typescript-codegen | src/view-data/responseType.ts | TypeScript |
ArrowFunction |
(
swaggerTypes: ResponseType<SwaggerType>[],
swagger: Swagger
): ResponseType<TypeSpec>[] =>
swaggerTypes.map(swaggerType => convertResponseType(swaggerType, swagger)) | IZEDx/swagger-typescript-codegen | src/view-data/responseType.ts | TypeScript |
ArrowFunction |
swaggerType => convertResponseType(swaggerType, swagger) | IZEDx/swagger-typescript-codegen | src/view-data/responseType.ts | TypeScript |
ArrowFunction |
(
swaggerType: ResponseType<SwaggerType>,
swagger: Swagger
): ResponseType<TypeSpec> => ({
statusType: convertStatusType(swaggerType.statusType),
bodyType: convertType(swaggerType.bodyType, swagger)
}) | IZEDx/swagger-typescript-codegen | src/view-data/responseType.ts | TypeScript |
ArrowFunction |
(str: string): string =>
isHttpStatusCode(str) ? str : defaultHttpStatusType | IZEDx/swagger-typescript-codegen | src/view-data/responseType.ts | TypeScript |
ArrowFunction |
(str: string): boolean =>
str.match(/^[1-5]\d{2}$/) !== null | IZEDx/swagger-typescript-codegen | src/view-data/responseType.ts | TypeScript |
ArrowFunction |
(
responseTypeName: string,
typeSpecs: ResponseType<TypeSpec>[]
): string[] => typeSpecs.map(ts => responseTypeToString(responseTypeName, ts)) | IZEDx/swagger-typescript-codegen | src/view-data/responseType.ts | TypeScript |
ArrowFunction |
ts => responseTypeToString(responseTypeName, ts) | IZEDx/swagger-typescript-codegen | src/view-data/responseType.ts | TypeScript |
ArrowFunction |
(
responseTypeName: string,
typeSpec: ResponseType<TypeSpec>
): string =>
`${responseTypeName}<${typeSpec.statusType}, ${typeSpecToString(
typeSpec.bodyType
)}>` | IZEDx/swagger-typescript-codegen | src/view-data/responseType.ts | TypeScript |
ArrowFunction |
(typeSpec: TypeSpec): string =>
typeSpec.target || typeSpec.tsType || defaultResponseType | IZEDx/swagger-typescript-codegen | src/view-data/responseType.ts | TypeScript |
InterfaceDeclaration |
interface ResponseType<T> {
statusType: string;
bodyType: T;
} | IZEDx/swagger-typescript-codegen | src/view-data/responseType.ts | TypeScript |
InterfaceDeclaration | /**
* Interface for the jqXHR object
*/
interface JQueryXHR extends XMLHttpRequest, JQueryPromise<any> {
/**
* The .overrideMimeType() method may be used in the beforeSend() callback function, for example, to modify the response content-type header. As of jQuery 1.5.1, the jqXHR object also contains the over... | Gubancs/chess-profile | src/main/webapp/resources/dts/jquery.d.ts | TypeScript |
InterfaceDeclaration | /**
* Interface for the JQuery callback
*/
interface JQueryCallback {
/**
* Add a callback or a collection of callbacks to a callback list.
*
* @param callbacks A function, or array of functions, that are to be added to the callback list.
*/
add(callbacks: Function): JQueryCallback;
/*... | Gubancs/chess-profile | src/main/webapp/resources/dts/jquery.d.ts | TypeScript |
InterfaceDeclaration | /**
* Allows jQuery Promises to interop with non-jQuery promises
*/
interface JQueryGenericPromise<T> {
/**
* Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
*
* @param doneFilter A function that is called when the Deferred is resolved.
* @param ... | Gubancs/chess-profile | src/main/webapp/resources/dts/jquery.d.ts | TypeScript |
InterfaceDeclaration | /**
* Interface for the JQuery promise/deferred callbacks
*/
interface JQueryPromiseCallback<T> {
(value?: T, ...args: any[]): void;
} | Gubancs/chess-profile | src/main/webapp/resources/dts/jquery.d.ts | TypeScript |
InterfaceDeclaration |
interface JQueryPromiseOperator<T, U> {
(callback1: JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[], ...callbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<U>;
} | Gubancs/chess-profile | src/main/webapp/resources/dts/jquery.d.ts | TypeScript |
InterfaceDeclaration | /**
* Interface for the JQuery promise, part of callbacks
*/
interface JQueryPromise<T> extends JQueryGenericPromise<T> {
/**
* Determine the current state of a Deferred object.
*/
state(): string;
/**
* Add handlers to be called when the Deferred object is either resolved or rejected.
... | Gubancs/chess-profile | src/main/webapp/resources/dts/jquery.d.ts | TypeScript |
InterfaceDeclaration | /**
* Interface for the JQuery deferred, part of callbacks
*/
interface JQueryDeferred<T> extends JQueryGenericPromise<T> {
/**
* Determine the current state of a Deferred object.
*/
state(): string;
/**
* Add handlers to be called when the Deferred object is either resolved or rejected.
... | Gubancs/chess-profile | src/main/webapp/resources/dts/jquery.d.ts | TypeScript |
InterfaceDeclaration | /**
* Interface of the JQuery extension of the W3C event object
*/
interface BaseJQueryEventObject extends Event {
data: any;
delegateTarget: Element;
isDefaultPrevented(): boolean;
isImmediatePropagationStopped(): boolean;
isPropagationStopped(): boolean;
namespace: string;
originalEvent:... | Gubancs/chess-profile | src/main/webapp/resources/dts/jquery.d.ts | TypeScript |
InterfaceDeclaration |
interface JQueryInputEventObject extends BaseJQueryEventObject {
altKey: boolean;
ctrlKey: boolean;
metaKey: boolean;
shiftKey: boolean;
} | Gubancs/chess-profile | src/main/webapp/resources/dts/jquery.d.ts | TypeScript |
InterfaceDeclaration |
interface JQueryMouseEventObject extends JQueryInputEventObject {
button: number;
clientX: number;
clientY: number;
offsetX: number;
offsetY: number;
pageX: number;
pageY: number;
screenX: number;
screenY: number;
} | Gubancs/chess-profile | src/main/webapp/resources/dts/jquery.d.ts | TypeScript |
InterfaceDeclaration |
interface JQueryKeyEventObject extends JQueryInputEventObject {
char: any;
charCode: number;
key: any;
keyCode: number;
} | Gubancs/chess-profile | src/main/webapp/resources/dts/jquery.d.ts | TypeScript |
InterfaceDeclaration |
interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject{
} | Gubancs/chess-profile | src/main/webapp/resources/dts/jquery.d.ts | TypeScript |
InterfaceDeclaration | /*
Collection of properties of the current browser
*/
interface JQuerySupport {
ajax?: boolean;
boxModel?: boolean;
changeBubbles?: boolean;
checkClone?: boolean;
checkOn?: boolean;
cors?: boolean;
cssFloat?: boolean;
hrefNormalized?: boolean;
htmlSerialize?: boolean;
leadingWh... | Gubancs/chess-profile | src/main/webapp/resources/dts/jquery.d.ts | TypeScript |
InterfaceDeclaration |
interface JQueryParam {
/**
* Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
*
* @param obj An array or object to serialize.
*/
(obj: any): string;
/**
* Create a serialized representation of an array or object, su... | Gubancs/chess-profile | src/main/webapp/resources/dts/jquery.d.ts | TypeScript |
InterfaceDeclaration | /**
* The interface used to construct jQuery events (with $.Event). It is
* defined separately instead of inline in JQueryStatic to allow
* overriding the construction function with specific strings
* returning specific event objects.
*/
interface JQueryEventConstructor {
(name: string, eventProperties?: any):... | Gubancs/chess-profile | src/main/webapp/resources/dts/jquery.d.ts | TypeScript |
InterfaceDeclaration | /**
* The interface used to specify coordinates.
*/
interface JQueryCoordinates {
left: number;
top: number;
} | Gubancs/chess-profile | src/main/webapp/resources/dts/jquery.d.ts | TypeScript |
InterfaceDeclaration | /**
* Elements in the array returned by serializeArray()
*/
interface JQuerySerializeArrayElement {
name: string;
value: string;
} | Gubancs/chess-profile | src/main/webapp/resources/dts/jquery.d.ts | TypeScript |
InterfaceDeclaration |
interface JQueryAnimationOptions {
/**
* A string or number determining how long the animation will run.
*/
duration?: any;
/**
* A string indicating which easing function to use for the transition.
*/
easing?: string;
/**
* A function to call once the animation is complete... | Gubancs/chess-profile | src/main/webapp/resources/dts/jquery.d.ts | TypeScript |
InterfaceDeclaration |
interface JQueryEasingFunction {
( percent: number ): number;
} | Gubancs/chess-profile | src/main/webapp/resources/dts/jquery.d.ts | TypeScript |
InterfaceDeclaration |
interface JQueryEasingFunctions {
[ name: string ]: JQueryEasingFunction;
linear: JQueryEasingFunction;
swing: JQueryEasingFunction;
} | Gubancs/chess-profile | src/main/webapp/resources/dts/jquery.d.ts | TypeScript |
FunctionDeclaration | // 将html字符串解析成jQuery对象
function parseHtml(html_str: string) {
let nodes = $.parseHTML(html_str, null, true);
let elem;
if (nodes.length != 1)
elem = $(document.createElement('div')).append(nodes);
else
elem = $(nodes[0]);
return elem;
} | DogWars/PyWebIO | webiojs/src/models/output.ts | TypeScript |
FunctionDeclaration |
export function getWidgetElement(spec: any) {
if (!(spec.type in type2widget))
throw Error("Unknown type in getWidgetElement() :" + spec.type);
let elem = type2widget[spec.type].get_element(spec);
if (spec.style) {
let old_style = elem.attr('style') || '';
elem.attr({"style": old_s... | DogWars/PyWebIO | webiojs/src/models/output.ts | TypeScript |
FunctionDeclaration | // 将output指令的spec字段解析成html字符串
export function outputSpecToHtml(spec: any) {
let html = '';
try {
let nodes = getWidgetElement(spec);
for (let node of nodes)
html += node.outerHTML || '';
} catch (e) {
console.error('Get sub widget html error,', e, spec);
}
return ... | DogWars/PyWebIO | webiojs/src/models/output.ts | TypeScript |
InterfaceDeclaration | /*
* 当前限制
* 若Widget被作为其他Widget的子项时,该Widget中绑定的事件将会失效
* */
export interface Widget {
handle_type: string;
get_element(spec: any): JQuery;
} | DogWars/PyWebIO | webiojs/src/models/output.ts | TypeScript |
InterfaceDeclaration |
interface itemType {
data: string,
col?: number,
row?: number
} | DogWars/PyWebIO | webiojs/src/models/output.ts | TypeScript |
FunctionDeclaration |
declare function SimpleSelect(props: SimpleSelectProps & React.RefAttributes<HTMLInputElement>): JSX.Element; | gregor-gh/carbon | src/components/select/simple-select/simple-select.d.ts | TypeScript |
InterfaceDeclaration |
export interface SimpleSelectProps extends FormInputPropTypes {
/** Child components (such as Option or OptionRow) for the SelectList */
children: React.ReactNode;
/** The default selected value(s), when the component is operating in uncontrolled mode */
defaultValue?: string | object;
/** Boolean to toggle ... | gregor-gh/carbon | src/components/select/simple-select/simple-select.d.ts | TypeScript |
ArrowFunction |
(flag: string): boolean => {
const context = useContext(ReactSimpleFlagsContext)
if (!context) return false
const match = context?.find((f) => f.name === flag)
if (!match) return false
return Boolean(match.enabled)
} | emileaublet/react-simple-flags | src/hook.tsx | TypeScript |
ArrowFunction |
(f) => f.name === flag | emileaublet/react-simple-flags | src/hook.tsx | TypeScript |
ArrowFunction |
({
authData,
authRoute,
children,
}) => {
return (
<AuthStateContext.Provider
value={{
authData,
authRoute: authRoute ?? AuthRoute.SignIn,
dispatchAuthState,
}} | dkershner6/amplify-authenticator-react-custom | src/test/TestWrapper.tsx | TypeScript |
ArrowFunction |
({ user, ...props }) => {
if (props.isAuthenticated === isAuthenticated.True) {
if (!user) {
props.getUser();
return <div>...Getting User...</div>
}
const values = queryString.parse(props.location.search)
if (values.userType) {
let userType:UserLoginType = parseInt(values.userType a... | AminHussaini/brillder | src/components/app/AuthRedirectRoute.tsx | TypeScript |
ArrowFunction |
(role:any) => role.roleId === UserType.Admin | AminHussaini/brillder | src/components/app/AuthRedirectRoute.tsx | TypeScript |
ArrowFunction |
(role:any) =>
role.roleId === UserType.Admin || role.roleId === UserType.Builder || role.roleId === UserType.Editor | AminHussaini/brillder | src/components/app/AuthRedirectRoute.tsx | TypeScript |
ArrowFunction |
(state: any) => {
return {
isAuthenticated: state.auth.isAuthenticated,
user: state.user.user,
}
} | AminHussaini/brillder | src/components/app/AuthRedirectRoute.tsx | TypeScript |
ArrowFunction |
(dispatch: any) => {
return {
isAuthorized: () => dispatch(actions.isAuthorized()),
getUser: () => dispatch(userActions.getUser()),
}
} | AminHussaini/brillder | src/components/app/AuthRedirectRoute.tsx | TypeScript |
ArrowFunction |
() => dispatch(actions.isAuthorized()) | AminHussaini/brillder | src/components/app/AuthRedirectRoute.tsx | TypeScript |
ArrowFunction |
() => dispatch(userActions.getUser()) | AminHussaini/brillder | src/components/app/AuthRedirectRoute.tsx | TypeScript |
InterfaceDeclaration |
interface AuthRedirectProps {
isAuthenticated: isAuthenticated,
user: User,
getUser():void,
isAuthorized():void,
} | AminHussaini/brillder | src/components/app/AuthRedirectRoute.tsx | TypeScript |
FunctionDeclaration |
export function withThemeCreator<Theme = DefaultTheme>(
option?: WithThemeCreatorOption<Theme>
): PropInjector<WithTheme<Theme>, ThemedComponentProps>; | GenaAiv/portfolio-website | node_modules/@material-ui/styles/withTheme/withTheme.d.ts | TypeScript |
FunctionDeclaration |
export default function withTheme<
Theme,
C extends React.ComponentType<ConsistentWith<React.ComponentProps<C>, WithTheme<Theme>>>
>(
component: C
): React.ComponentType<
Omit<JSX.LibraryManagedAttributes<C, React.ComponentProps<C>>, keyof WithTheme<Theme>> &
Partial<WithTheme<Theme>> &
ThemedC... | GenaAiv/portfolio-website | node_modules/@material-ui/styles/withTheme/withTheme.d.ts | TypeScript |
InterfaceDeclaration |
export interface WithThemeCreatorOption<Theme = DefaultTheme> {
defaultTheme?: Theme;
} | GenaAiv/portfolio-website | node_modules/@material-ui/styles/withTheme/withTheme.d.ts | TypeScript |
InterfaceDeclaration |
export interface WithTheme<Theme = DefaultTheme> {
theme: Theme;
/**
* Deprecated. Will be removed in v5. Refs are now automatically forwarded to
* the inner component.
* @deprecated since version 4.0
*/
innerRef?: React.Ref<any>;
} | GenaAiv/portfolio-website | node_modules/@material-ui/styles/withTheme/withTheme.d.ts | TypeScript |
InterfaceDeclaration |
export interface ThemedComponentProps extends Partial<WithTheme> {
ref?: React.Ref<unknown>;
} | GenaAiv/portfolio-website | node_modules/@material-ui/styles/withTheme/withTheme.d.ts | TypeScript |
ClassDeclaration |
@Component({
templateUrl: './chat.component.html',
styleUrls: ['./chat.styles.scss'],
})
export class ChatComponent implements OnInit {
public messageForm: FormGroup;
public get message() { return this.messageForm.get('message'); }
constructor(
public service: ChatService,
privat... | Zuzon/chat-app | src/app/chat/chat.component.ts | TypeScript |
MethodDeclaration |
public ngOnInit(): void {
if (!this.service.registered) {
this.router.navigate(['/']);
return;
}
this.messageForm = new FormGroup({
message: new FormControl('')
});
} | Zuzon/chat-app | src/app/chat/chat.component.ts | TypeScript |
MethodDeclaration |
public onSubmit() {
if (this.message.value.trim().length) {
this.service.connection.send({
type: 'message',
message: this.message.value.trim()
});
this.message.setValue('');
}
} | Zuzon/chat-app | src/app/chat/chat.component.ts | TypeScript |
FunctionDeclaration |
export function Vec4Equals (a: IVec4Like, b: IVec4Like): boolean
{
return a.x === b.x && a.y === b.y && a.z === b.z && a.w === b.w;
} | CyberDex/phaser4 | src/math/vec4/Vec4Equals.ts | TypeScript |
ArrowFunction |
({ children }) => {
const [state, setState] = useState(false);
const contextValue = {
state,
toggle: () => setState(!state),
};
return (
<ToggleContext.Provider value={contextValue}>
{children}
</ToggleContext.Provider> | CarlosTeixeiraCIANDT/Bodiless-JS | examples/test-site/src/data/pages/api/fclasses/index.tsx | TypeScript |
ArrowFunction |
() => setState(!state) | CarlosTeixeiraCIANDT/Bodiless-JS | examples/test-site/src/data/pages/api/fclasses/index.tsx | TypeScript |
ArrowFunction |
() => useContext(ToggleContext) | CarlosTeixeiraCIANDT/Bodiless-JS | examples/test-site/src/data/pages/api/fclasses/index.tsx | TypeScript |
ArrowFunction |
() => useStateContext().state | CarlosTeixeiraCIANDT/Bodiless-JS | examples/test-site/src/data/pages/api/fclasses/index.tsx | TypeScript |
ArrowFunction |
props => {
const { toggle } = useStateContext();
return <BaseButton {...props} onClick={toggle} />;
} | CarlosTeixeiraCIANDT/Bodiless-JS | examples/test-site/src/data/pages/api/fclasses/index.tsx | TypeScript |
ArrowFunction |
(props: any) => (
<Page {...props}>
<Layout>
<SubTitle>Adding | CarlosTeixeiraCIANDT/Bodiless-JS | examples/test-site/src/data/pages/api/fclasses/index.tsx | TypeScript |
ArrowFunction |
() => {
let component: AppCalendarHeaderComponent;
let fixture: ComponentFixture<AppCalendarHeaderComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AppCalendarHeaderComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.creat... | djr-taureau/angular7-dotNetCore-starter | src/AspNetCoreSpa.Web/ClientApp/src/app/+examples/examples/calendar/calendar-header/calendar-header.component.spec.ts | TypeScript |
ArrowFunction |
() => {
TestBed.configureTestingModule({
declarations: [ AppCalendarHeaderComponent ]
})
.compileComponents();
} | djr-taureau/angular7-dotNetCore-starter | src/AspNetCoreSpa.Web/ClientApp/src/app/+examples/examples/calendar/calendar-header/calendar-header.component.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture = TestBed.createComponent(AppCalendarHeaderComponent);
component = fixture.componentInstance;
fixture.detectChanges();
} | djr-taureau/angular7-dotNetCore-starter | src/AspNetCoreSpa.Web/ClientApp/src/app/+examples/examples/calendar/calendar-header/calendar-header.component.spec.ts | TypeScript |
ClassDeclaration |
export abstract class WeightActivityData {
abstract getWeightActivityData(period: string): Observable<WeightActive[]>;
} | mschlech/beelogger-admin | src/app/@core/data/weight-activity.ts | TypeScript |
InterfaceDeclaration |
export interface WeightActive {
date: string;
pagesVisitCount: number;
deltaUp: boolean;
newVisits: number;
} | mschlech/beelogger-admin | src/app/@core/data/weight-activity.ts | TypeScript |
MethodDeclaration |
abstract getWeightActivityData(period: string): Observable<WeightActive[]>; | mschlech/beelogger-admin | src/app/@core/data/weight-activity.ts | TypeScript |
ClassDeclaration |
export declare class UiIncentiveDataProviderFactory extends ContractFactory {
constructor(signer?: Signer);
static connect(address: string, signerOrProvider: Signer | Provider): UiIncentiveDataProvider;
} | MorganIsBatman/aave-ui-caching-server | backend/@aave/contract-helpers/dist/cjs/ui-incentive-data-provider/typechain/UiIncentiveDataProviderFactory.d.ts | TypeScript |
MethodDeclaration |
static connect(address: string, signerOrProvider: Signer | Provider): UiIncentiveDataProvider; | MorganIsBatman/aave-ui-caching-server | backend/@aave/contract-helpers/dist/cjs/ui-incentive-data-provider/typechain/UiIncentiveDataProviderFactory.d.ts | TypeScript |
ClassDeclaration |
@Injectable()
export class ModalService {
constructor(private modalCtrl: ModalController, @Optional() private navParams: NavParams) { }
getParam<T>(key: string): T {
return this.navParams?.get(key);
}
async show(options: IModalOptions): Promise<IModal> {
const modalOptions = {
... | AndriiBilych/smartsoft | libs/shared/angular/src/lib/services/modal/modal.service.ts | TypeScript |
InterfaceDeclaration |
export interface IModalOptions {
component;
props?;
mode?: 'default' | 'bottom';
cssClass?: string[];
backdropDismiss?: boolean;
} | AndriiBilych/smartsoft | libs/shared/angular/src/lib/services/modal/modal.service.ts | TypeScript |
InterfaceDeclaration |
export interface IModal {
dismiss: () => void;
onDidDismiss(): Promise<{ data: any }>
} | AndriiBilych/smartsoft | libs/shared/angular/src/lib/services/modal/modal.service.ts | TypeScript |
MethodDeclaration |
getParam<T>(key: string): T {
return this.navParams?.get(key);
} | AndriiBilych/smartsoft | libs/shared/angular/src/lib/services/modal/modal.service.ts | TypeScript |
MethodDeclaration |
async show(options: IModalOptions): Promise<IModal> {
const modalOptions = {
component: options.component,
componentProps: options.props,
cssClass: options.cssClass ? options.cssClass : [],
backdropDismiss: options.backdropDismiss
} as ModalOptions<any>;
... | AndriiBilych/smartsoft | libs/shared/angular/src/lib/services/modal/modal.service.ts | TypeScript |
MethodDeclaration |
async dismiss<T>(data: T = null): Promise<void> {
await this.modalCtrl.dismiss(data);
} | AndriiBilych/smartsoft | libs/shared/angular/src/lib/services/modal/modal.service.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.