import { Injectable } from '@angular/core' ; import { DEFAULT_BOOLEAN_DESERIALIZER , DEFAULT_BOOLEAN_SERIALIZER , DEFAULT_NUMBER_DESERIALIZER , DEFAULT_NUMBER_SERIALIZER , DEFAULT_STRING_DESERIALIZER , DEFAULT_STRING_SERIALIZER } from './serializers' ; import { LOOSE_IDENTITY_COMPARATOR } from './util' ; import { RouterOptions } from './router-adapter/router-adapter.interface' ; import { MultiQueryParam , QueryParam , PartitionedQueryParam } from './model/query-param' ; import { QueryParamGroup } from './model/query-param-group' ; import { MultiQueryParamOpts , PartitionedQueryParamOpts , QueryParamGroupOpts , QueryParamOpts } from './model/query-param-opts' ; function isMultiOpts < T > ( opts ) { return opts . multi === true ; } /**
 * Service to create parameters and groups.
 *
 * This service provides a simple API to create  QueryParamGroup and  QueryParam * instances and is the recommended way to set them up.
  @ Injectable ( { providedIn : 'root' } ) export class QueryParamBuilder { /**
     * Creates a new  QueryParamGroup .
     *
     * This is the primary method to create a new group of parameters. Pass a list of
     *  QueryParam instances by using the `xxxParam` methods.
     *
     *  param queryParams List of  QueryParam s keyed by a unique name.
     *  param extras returns The new  QueryParamGroup .
      public group ( queryParams , extras = { } ) { return new QueryParamGroup ( queryParams , extras ) ; } ignore public partition < T , G1 > ( queryParams , opts ) ; ignore public partition < T , G1 , G2 > ( queryParams , opts ) ; ignore public partition < T , G1 , G2 , G3 > ( queryParams , opts ) ; param queryParams param opts See  PartitionedQueryParamOpts .
      public partition < T , G extends unknown [ ] > ( queryParams , opts ) { return new PartitionedQueryParam ( queryParams , opts ) ; } ignore public stringParam ( urlParam , opts ) ; ignore public stringParam ( urlParam , opts ? ) ; /**
     * Create a new parameter of type `string`.
     *
     * See  QueryParamOpts .
      public stringParam ( urlParam , opts = { } ) { opts = { serialize : DEFAULT_STRING_SERIALIZER , deserialize : DEFAULT_STRING_DESERIALIZER , compareWith : LOOSE_IDENTITY_COMPARATOR , ... opts , } ; if ( isMultiOpts ( opts ) ) { return new MultiQueryParam < string > ( urlParam , opts ) ; } else { return new QueryParam < string > ( urlParam , opts ) ; } } ignore public numberParam ( urlParam , opts ) ; ignore public numberParam ( urlParam , opts ? ) ; /**
     * Create a new parameter of type `number`.
     *
     * See  QueryParamOpts .
      public numberParam ( urlParam , opts = { } ) { opts = { serialize : DEFAULT_NUMBER_SERIALIZER , deserialize : DEFAULT_NUMBER_DESERIALIZER , compareWith : LOOSE_IDENTITY_COMPARATOR , ... opts , } ; if ( isMultiOpts ( opts ) ) { return new MultiQueryParam < number > ( urlParam , opts ) ; } else { return new QueryParam < number > ( urlParam , opts ) ; } } ignore public booleanParam ( urlParam , opts ) ; ignore public booleanParam ( urlParam , opts ? ) ; /**
     * Create a new parameter of type `boolean`.
     *
     * See  QueryParamOpts .
      public booleanParam ( urlParam , opts = { } ) { opts = { serialize : DEFAULT_BOOLEAN_SERIALIZER , deserialize : DEFAULT_BOOLEAN_DESERIALIZER , compareWith : LOOSE_IDENTITY_COMPARATOR , ... opts , } ; if ( isMultiOpts ( opts ) ) { return new MultiQueryParam < boolean > ( urlParam , opts ) ; } else { return new QueryParam < boolean > ( urlParam , opts ) ; } } ignore public param < T > ( urlParam , opts ) ; ignore public param < T > ( urlParam , opts ? ) ; /**
     * Create a new parameter for a complex type.
     *
     * See  QueryParamOpts .
      public param < T > ( urlParam , opts = { } ) { opts = { compareWith : LOOSE_IDENTITY_COMPARATOR , ... opts , } ; if ( isMultiOpts ( opts ) ) { return new MultiQueryParam < T > ( urlParam , opts ) ; } else { return new QueryParam < T > ( urlParam , opts ) ; } } }